Skip to content

Commit

Permalink
feat(k3): add initContainers
Browse files Browse the repository at this point in the history
  • Loading branch information
xom4ek committed Oct 31, 2024
1 parent 4c3a1f4 commit 486c7c9
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
20 changes: 20 additions & 0 deletions charts/k3/templates/register.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@ spec:
{{- include "k3Register.labels" . | nindent 8 }}
spec:
containers:
initContainers:
- name: register-init
{{- with .Values.register.initContainer.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.register.initContainer.args }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.register.initContainer.image.repository }}:{{ .Values.register.initContainer.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.register.initContainer.image.pullPolicy }}
{{- with .Values.register.initContainer.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- toYaml .Values.register.initContainer.env | nindent 12 }}
- name: register
image: "{{ .Values.register.image.repository }}:{{ .Values.register.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.register.image.pullPolicy }}
Expand Down
20 changes: 20 additions & 0 deletions charts/k3/templates/statefulset.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,26 @@ spec:
serviceAccountName: {{ .Values.serviceAccount.name | default (include "k3.fullname" .) }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: node-init
{{- with .Values.node.initContainer.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.node.initContainer.args }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.node.initContainer.image.repository }}:{{ .Values.node.initContainer.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.node.initContainer.image.pullPolicy }}
{{- with .Values.node.initContainer.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- toYaml .Values.node.initContainer.env | nindent 12 }}
containers:
- name: node
{{- with .Values.node.command }}
Expand Down
25 changes: 23 additions & 2 deletions charts/k3/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,36 @@ configs:
leave empty
register:
initContainer:
image:
repository: ghcr.io/foundry-rs/foundry
pullPolicy: IfNotPresent
tag: "latest"
volumeMounts: []
env: []
command:
- /bin/sh
args:
- date
enabled: true
image:
repository: k3official/k3-labs-avs-operator
pullPolicy: Always
tag: "latest"
args:
- register

node:
initContainer:
image:
repository: ghcr.io/foundry-rs/foundry
pullPolicy: IfNotPresent
tag: "latest"
volumeMounts: []
env: []
command:
- /bin/sh
args:
- date

volumeMounts: []
image:
repository: k3official/k3-labs-avs-operator
Expand Down

0 comments on commit 486c7c9

Please sign in to comment.