k8s-basic/helm-chart/templates/deployment.yaml
2025-04-14 08:53:59 -05:00

80 lines
2.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
service: {{ .Values.name }}
name: {{ .Values.name }}
namespace: {{ .Values.namespace | default .Values.name }}
spec:
replicas: 1
selector:
matchLabels:
service: {{ .Values.name }}
template:
metadata:
labels:
service: {{ .Values.name }}
annotations:
diun.enable: "true"
spec:
securityContext:
{{ toYaml .Values.podSecurityContext | indent 8 }}
containers:
- image: {{ .Values.image.repository }}/{{ .Values.image.name | default .Values.name }}:{{ .Values.image.tag }}
name: {{ .Values.name }}
securityContext:
{{ toYaml .Values.containerSecurityContext | indent 12 }}
ports:
- containerPort: {{ .Values.port }}
protocol: TCP
resources:
requests:
cpu: {{ .Values.cpuRequest }}
memory: {{ .Values.memoryRequest }}
limits:
cpu: {{ .Values.cpuLimit }}
memory: {{ .Values.memoryLimit }}
volumeMounts:
- name: tmp
mountPath: /tmp
livenessProbe:
httpGet:
path: {{ .Values.probes.liveness.path }}
port: {{ .Values.port }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
successThreshold: {{ .Values.probes.liveness.successThreshold }}
readinessProbe:
httpGet:
path: {{ .Values.probes.readiness.path }}
port: {{ .Values.port }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
successThreshold: {{ .Values.probes.readiness.successThreshold }}
startupProbe:
httpGet:
path: {{ .Values.probes.readiness.path }}
port: {{ .Values.port }}
failureThreshold: 30
periodSeconds: 10
volumes:
- name: tmp
emptyDir: {}
imagePullSecrets:
- name: {{ .Values.imagePullSecret }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}