Skip to content

Commit

Permalink
ensure that the plugin is installed via the initContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Michels committed Jun 15, 2022
1 parent b540522 commit 9b49356
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 44 deletions.
45 changes: 21 additions & 24 deletions charts/velero/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,38 +186,35 @@ spec:
{{- if .Values.initContainers }}
initContainers:
{{- if eq $provider "aws" }}
- name: velero-plugin-for-aws
image: velero/velero-plugin-for-aws:v1.4.1
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /target
name: plugins
- name: {{ .Values.initContainers.name | default "velero-plugin-for-aws" | quote }}
image: {{ .Values.initContainers.name | default "velero/velero-plugin-for-aws:v1.4.1" | quote }}
{{- else if eq $provider "csi"}}
- name: {{ .Values.initContainers.name | default "velero-velero-plugin-for-csi" | quote }}
image: {{ .Values.initContainers.name | default "velero/velero-plugin-for-csi:v0.2.0" | quote }}
{{- else if eq $provider "gcp"}}
- name: velero-velero-plugin-for-gcp
image: velero/velero-plugin-for-microsoft-azure:v1.5.0
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /target
name: plugins
- name: {{ .Values.initContainers.name | default "velero-velero-plugin-for-gcp" | quote }}
image: {{ .Values.initContainers.name | default "velero/velero-plugin-for-gcp:v1.4.1" | quote }}
{{- else if eq $provider "azure" }}
- name: velero-velero-plugin-for-microsoft-azure
image: velero/velero-plugin-for-microsoft-azure:v1.4.0
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /target
name: plugins
- name: {{ .Values.initContainers.name | default "velero-velero-plugin-for-microsoft-azure" | quote }}
image: {{ .Values.initContainers.name | default "velero/velero-plugin-for-microsoft-azure:v1.4.1" | quote }}
{{- else if eq $provider "alibabacloud" }}
- name: velero-velero-plugin-for-alibabacloud
image: velero/velero-plugin-for-alibabacloud:latest
- name: {{ .Values.initContainers.name | default "velero-velero-plugin-for-alibabacloud" | quote }}
image: {{ .Values.initContainers.name | default "registry.cn-hangzhou.aliyuncs.com/acs/velero-plugin-alibabacloud:v1.0.0" | quote }}
{{- else }}
- name: {{ .Values.initContainers.name }}
image: {{ .Values.initContainers.image }}
{{- end }}
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /target
name: plugins
{{- with .Values.initContainers.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if eq (typeOf .Values.initContainers.extraSpec) "string" }}
{{- tpl .Values.initContainers.extraSpec . | nindent 8 }}
{{- else }}
{{- toYaml .Values.initContainers.extraSpec | nindent 8 }}
{{- with .Values.initContainers.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
volumes:
Expand Down
26 changes: 6 additions & 20 deletions charts/velero/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,13 @@ resources:
dnsPolicy: ClusterFirst

# Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required.
# If the value is a string then it is evaluated as a template.
# see .Values.configuration.provider
initContainers:
extraSpec: {}
# - name: velero-plugin-for-csi
# image: velero/velero-plugin-for-csi:v0.2.0
# imagePullPolicy: IfNotPresent
# volumeMounts:
# - mountPath: /target
# name: plugins
# - name: velero-plugin-for-aws
# image: velero/velero-plugin-for-aws:v1.4.1
# imagePullPolicy: IfNotPresent
# volumeMounts:
# - mountPath: /target
# name: plugins
# - name: velero-velero-plugin-for-microsoft-azure
# image: velero/velero-plugin-for-microsoft-azure:v1.4.0
# imagePullPolicy: IfNotPresent
# volumeMounts:
# - mountPath: /target
# name: plugins
name:
image:
containerSecurityContext: {}
resources: {}


# SecurityContext to use for the Velero deployment. Optional.
# Set fsGroup for `AWS IAM Roles for Service Accounts`
Expand Down

0 comments on commit 9b49356

Please sign in to comment.