Add volumeMounts feature

This commit is contained in:
klimenkoas 2023-12-12 19:05:25 +04:00
parent 0d5921af5e
commit fa14ce6771
6 changed files with 124 additions and 2 deletions

View file

@ -62,7 +62,17 @@ spec:
{{- end }}
- configMapRef:
name: {{ include "django.fullname" . }}
{{- with .Values.beat.nodeSelector }}
{{- if .Values.volumeMounts }}
volumeMounts:
{{- range .Values.volumeMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.web.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
@ -74,5 +84,19 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.volumeMounts }}
volumes:
{{- range .Values.volumeMounts }}
- name: {{ .name }}
{{- if .source.configMap }}
configMap:
name: {{ .source.configMap.name }}
{{- end }}
{{- if .source.secret }}
secret:
secretName: {{ .source.secret.secretName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -5,7 +5,7 @@ metadata:
name: {{ include "django.fullname" . }}-flower
labels:
{{- include "django.labels" . | nindent 4 }}
app.kubernetes.io/component: flower
app.kubernetes.io/component: flower
spec:
replicas: 1
selector:
@ -57,6 +57,16 @@ spec:
{{- end }}
- configMapRef:
name: {{ include "django.fullname" . }}
{{- if .Values.volumeMounts }}
volumeMounts:
{{- range .Values.volumeMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.flower.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
@ -69,4 +79,18 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.volumeMounts }}
volumes:
{{- range .Values.volumeMounts }}
- name: {{ .name }}
{{- if .source.configMap }}
configMap:
name: {{ .source.configMap.name }}
{{- end }}
{{- if .source.secret }}
secret:
secretName: {{ .source.secret.secretName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -49,4 +49,28 @@ spec:
envFrom:
- configMapRef:
name: {{ include "django.fullname" . }}
{{- if .Values.volumeMounts }}
volumeMounts:
{{- range .Values.volumeMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.volumeMounts }}
volumes:
{{- range .Values.volumeMounts }}
- name: {{ .name }}
{{- if .source.configMap }}
configMap:
name: {{ .source.configMap.name }}
{{- end }}
{{- if .source.secret }}
secret:
secretName: {{ .source.secret.secretName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -83,6 +83,16 @@ spec:
{{- end }}
- configMapRef:
name: {{ include "django.fullname" . }}
{{- if .Values.volumeMounts }}
volumeMounts:
{{- range .Values.volumeMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.web.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
@ -95,3 +105,17 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.volumeMounts }}
volumes:
{{- range .Values.volumeMounts }}
- name: {{ .name }}
{{- if .source.configMap }}
configMap:
name: {{ .source.configMap.name }}
{{- end }}
{{- if .source.secret }}
secret:
secretName: {{ .source.secret.secretName }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -66,6 +66,16 @@ spec:
{{- end }}
- configMapRef:
name: {{ include "django.fullname" . }}
{{- if .Values.volumeMounts }}
volumeMounts:
{{- range .Values.volumeMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.worker.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
@ -78,4 +88,18 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.volumeMounts }}
volumes:
{{- range .Values.volumeMounts }}
- name: {{ .name }}
{{- if .source.configMap }}
configMap:
name: {{ .source.configMap.name }}
{{- end }}
{{- if .source.secret }}
secret:
secretName: {{ .source.secret.secretName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -24,6 +24,8 @@ env:
existingSecret: ""
volumeMounts: []
web:
replicaCount: 2
port: 8080