Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to apply extra volumes and volume mounts to the daemonset #1322

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion charts/vsphere-cpi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,15 @@ The following table lists the configurable parameters of the vSphere CPI chart a
| `daemonset.cmdline.logging` | Logging level | 2 |
| `daemonset.cmdline.cloudConfig.dir` | vSphere conf directory | /etc/cloud |
| `daemonset.cmdline.cloudConfig.file` | vSphere conf filename | vsphere.conf |
| `daemonset.replicaCount` | Node resources | `[]` |
| `daemonset.replicaCount` | Node resources | 1 |
| `daemonset.resources` | Node resources | `[]` |
| `daemonset.podAnnotations` | Annotations for CPI pod | nil |
| `daemonset.podLabels` | Labels for CPI pod | nil |
| `daemonset.nodeSelector` | User-defined node selectors | nil |
| `daemonset.tolerations` | User-defined tolerations | nil |
| `daemonset.affinity` | User-defined affinities | nil |
| `daemonset.extraVolumes` | User-defined volumes | `[]` |
| `daemonset.extraVolumeMounts` | User-defined volume mounts | `[]` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install` using Helm v3.X. For example,

Expand Down
2 changes: 2 additions & 0 deletions charts/vsphere-cpi/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ data:
port: 443
{{- if $config.thumbprint }}
thumbprint: {{ $config.thumbprint }}
{{- else if $config.caFile }}
ca-file = {{ $config.caFile }}
{{- else }}
# set insecure-flag to true if the vCenter uses a self-signed cert
insecureFlag: true
Expand Down
6 changes: 6 additions & 0 deletions charts/vsphere-cpi/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ spec:
- mountPath: {{ .Values.daemonset.cmdline.cloudConfig.dir }}
name: vsphere-config-volume
readOnly: true
{{- if .Values.daemonset.extraVolumeMounts }}
{{- toYaml .Values.daemonset.extraVolumeMounts | nindent 10 }}
{{- end }}
{{- if .Values.daemonset.resources }}
resources:
{{- toYaml .Values.daemonset.resources | nindent 10 }}
Expand All @@ -80,3 +83,6 @@ spec:
- name: vsphere-config-volume
configMap:
name: {{ if $config.enabled }}{{- $config.name }}{{- else }}cloud-config{{- end }}
{{- if .Values.daemonset.extraVolumes }}
{{- toYaml .Values.daemonset.extraVolumes | nindent 8 }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/vsphere-cpi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ config:
region: "k8s-region"
zone: "k8s-zone"
thumbprint: ""
caFile: "" # Path to the ca-file if it has been mounted into the pod.
secret:
# Specifies whether Secret should be created from config values
create: true
Expand Down Expand Up @@ -93,3 +94,5 @@ daemonset:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
extraVolumes: []
extraVolumesMounts: []