helm_website/templates/deployment.yaml

99 lines
3.1 KiB
YAML

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
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 }}
- name: {{ .Chart.PullName }}
image: "{{ .Values.puller.image.repository }}:{{ .Values.puller.image.tag }}"
imagePullPolicy: {{ .Values.puller.image.pullPolicy }}
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 }}
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ .Release.Name }}-pvc