helm_website/templates/deployment.yaml

99 lines
3.1 KiB
YAML
Raw Normal View History

2024-11-14 08:13:40 +01:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
labels:
{{- include "basic-app.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "basic-app.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "basic-app.selectorLabels" . | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 80
protocol: TCP
volumeMounts:
- name: data
mountPath: /data
2024-11-14 08:25:23 +01:00
env:
{{- with .Values.env.plain }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- range .Values.env.configMapKeys }}
- name: {{ .name }}
valueFrom:
configMapKeyRef:
name: {{ .configMapName }}
key: {{ .key }}
{{- end }}
{{- range .Values.env.secretKeys }}
- name: {{ .name }}
valueFrom:
secretKeyRef:
name: {{ .secretName }}
key: {{ .key }}
{{- end }}
envFrom:
{{- range .Values.env.configMapRefs }}
- configMapRef:
name: {{ .name }}
optional: {{ .optional | default false }}
{{- end }}
{{- range .Values.env.secretRefs }}
- secretRef:
name: {{ .name }}
optional: {{ .optional | default false }}
{{- end }}
2024-11-18 10:12:41 +01:00
- name: {{ .Chart.PullName }}
image: "{{ .Values.puller.image.repository }}:{{ .Values.puller.image.tag }}"
imagePullPolicy: {{ .Values.puller.image.pullPolicy }}
2024-11-18 10:12:41 +01:00
ports:
- containerPort: 80
protocol: TCP
volumeMounts:
- name: data
mountPath: /data
env:
{{- with .Values.env.plain }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- range .Values.env.configMapKeys }}
- name: {{ .name }}
valueFrom:
configMapKeyRef:
name: {{ .configMapName }}
key: {{ .key }}
{{- end }}
{{- range .Values.env.secretKeys }}
- name: {{ .name }}
valueFrom:
secretKeyRef:
name: {{ .secretName }}
key: {{ .key }}
{{- end }}
envFrom:
{{- range .Values.env.configMapRefs }}
- configMapRef:
name: {{ .name }}
optional: {{ .optional | default false }}
{{- end }}
{{- range .Values.env.secretRefs }}
- secretRef:
name: {{ .name }}
optional: {{ .optional | default false }}
{{- end }}
2024-11-14 08:13:40 +01:00
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ .Release.Name }}-pvc