This repository has been archived on 2024-12-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
onechart/charts/onechart/templates/deployment.yaml
T

115 lines
3.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "helm-chart.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
{{- include "helm-chart.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "helm-chart.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Release.Name }}
securityContext: &securityContext
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.command }}
command:
- {{ .Values.shell }}
- -c
- {{ .Values.command | quote }}
{{- end }}
envFrom: &envFrom
{{- if .Values.vars }}
- configMapRef:
name: {{ .Release.Name }}
{{- end }}
{{- if .Values.secret.enabled }}
- secretRef:
name: {{ .Release.Name }}
{{- end }}
{{- if .Values.sealedSecrets }}
- secretRef:
name: {{ .Release.Name }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.containerPort }}
protocol: TCP
{{- if .Values.probe.enabled }}
readinessProbe:
failureThreshold: 3
httpGet:
path: {{ .Values.probe.path }}
port: {{ .Values.containerPort }}
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
{{- end }}
volumeMounts: &volumeMounts
{{- range .Values.volumes }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- end }}
{{- range .Values.sealedFileSecrets }}
- name: {{ .name }}
mountPath: {{ .path }}
readOnly: true
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.debugSidecarEnabled }}
- name: {{ .Release.Name }}-debug
securityContext: *securityContext
image: {{ .Values.debugSidecar.image }}
command:
- {{ .Values.debugSidecar.shell }}
- -c
- {{ .Values.debugSidecar.command | quote }}
envFrom: *envFrom
volumeMounts: *volumeMounts
{{- end }}
volumes:
{{- range .Values.volumes }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ printf "%s-%s" $.Release.Name .name }}
{{- end }}
{{- range .Values.sealedFileSecrets }}
- name: {{ .name }}
secret:
secretName: {{ printf "%s-%s" $.Release.Name .name }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}