Skip to content

Commit

Permalink
Merge pull request #86 from dasmeta/DMVP-fix-init-container
Browse files Browse the repository at this point in the history
fix(DMVP-fix-init-container): Fix init container
  • Loading branch information
aghamyan44 authored Dec 7, 2023
2 parents 22d47fc + 28ab769 commit 1dbe3cd
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 5 deletions.
4 changes: 2 additions & 2 deletions charts/base/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.53
version: 0.1.54

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.53"
appVersion: "0.1.54"
26 changes: 25 additions & 1 deletion charts/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,28 @@ base:
app.kubernetes.io/name: base-fullname
maxSkew: 2
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
whenUnsatisfiable: ScheduleAnyway


### Init container

initContainers:
name: config
args:
- /config.json
- /test/config.json
secrets:
- CLIENT_ID:
from: client-market
key: client_id
- AUTH_TOKEN:
from: auth-token
key: token
image:
repository: nginx
pullPolicy: IfNotPresent
tag: latest
volumes:
- mountPath: /config.json
name: config-json
subPath: config.json
41 changes: 39 additions & 2 deletions charts/base/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,45 @@ spec:
serviceAccountName: {{ include "base.serviceAccountName" . }}
{{- if .Values.initContainers }}
initContainers:
{{- toYaml .Values.initContainers | nindent 6 }}
image: {{ .Values.initContainer.image }}:{{ .Values.initContainer.tag }}
- name: {{ .Values.initContainers.name }}
image: "{{ .Values.initContainers.image.repository }}:{{ .Values.initContainers.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.initContainers.image.pullPolicy }}
{{- if $.Values.initContainers.command }}
command:
{{ toYaml .Values.initContainers.command | nindent 12 }}
{{- end }}
{{- if $.Values.initContainers.args }}
args: {{ toYaml .Values.initContainers.args | nindent 12 }}
{{- end }}
{{- if or .Values.initContainers.extraEnv .Values.initContainers.secrets}}
env:
{{- range $key, $value := .Values.initContainers.extraEnv }}
- name: {{ $key | quote}}
value: {{ $value | quote }}
{{- end }}
{{- range $secret := .Values.initContainers.secrets }}
{{- if ne (kindOf $secret) "string" }}
{{- range $map_key,$map_value := $secret }}
- name: {{ $map_key }}
valueFrom:
secretKeyRef:
key: {{ $map_value.key }}
name: {{ $map_value.from }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.initContainers.volumes }}
volumeMounts:
{{- range $index, $element := .Values.initContainers.volumes }}
- name: {{ coalesce $element.name (add $index 1) }}
mountPath: {{ $element.mountPath }}
readOnly: {{ $element.readOnly | default false }}
{{- if $element.subPath }}
subPath: {{ $element.subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.topologySpreadConstraints }}
topologySpreadConstraints:
Expand Down

0 comments on commit 1dbe3cd

Please sign in to comment.