k8s-pulse/helm-chart/templates/deployment.yaml

95 lines
3.1 KiB
YAML
Raw Permalink Normal View History

2026-07-24 00:15:19 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
2026-07-24 11:17:10 +00:00
name: {{ include "k8s-pulse.fullname" . }}
2026-07-24 00:15:19 +00:00
labels:
2026-07-24 11:17:10 +00:00
{{- include "k8s-pulse.labels" . | nindent 4 }}
2026-07-24 00:15:19 +00:00
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
2026-07-24 11:17:10 +00:00
{{- include "k8s-pulse.selectorLabels" . | nindent 6 }}
2026-07-24 00:15:19 +00:00
template:
metadata:
labels:
2026-07-24 11:17:10 +00:00
{{- include "k8s-pulse.selectorLabels" . | nindent 8 }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
2026-07-24 00:15:19 +00:00
spec:
2026-07-24 11:17:10 +00:00
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "k8s-pulse.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
2026-07-24 00:15:19 +00:00
containers:
- name: {{ .Chart.Name }}
2026-07-24 11:17:10 +00:00
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
2026-07-24 12:01:49 +00:00
{{- if .Values.kubeconfig.enabled }}
env:
- name: KUBECONFIG
value: {{ .Values.kubeconfig.mountPath | quote }}
{{- end }}
2026-07-24 00:15:19 +00:00
ports:
- name: http
2026-07-24 11:17:10 +00:00
containerPort: {{ .Values.service.targetPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
2026-07-24 11:17:10 +00:00
port: http
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
httpGet:
path: /healthz
2026-07-24 11:17:10 +00:00
port: http
initialDelaySeconds: 5
periodSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
2026-07-24 12:01:49 +00:00
{{- if or .Values.persistence.enabled .Values.kubeconfig.enabled }}
2026-07-24 00:15:19 +00:00
volumeMounts:
2026-07-24 12:01:49 +00:00
{{- if .Values.persistence.enabled }}
2026-07-24 00:15:19 +00:00
- name: data
mountPath: /app/data
2026-07-24 12:01:49 +00:00
{{- end }}
{{- if .Values.kubeconfig.enabled }}
- name: kubeconfig-volume
mountPath: {{ .Values.kubeconfig.mountPath | quote }}
subPath: {{ .Values.kubeconfig.secretKey | default "config" | quote }}
readOnly: true
{{- end }}
2026-07-24 11:17:10 +00:00
{{- end }}
2026-07-24 12:01:49 +00:00
{{- if or .Values.persistence.enabled .Values.kubeconfig.enabled }}
2026-07-24 00:15:19 +00:00
volumes:
2026-07-24 12:01:49 +00:00
{{- if .Values.persistence.enabled }}
2026-07-24 00:15:19 +00:00
- name: data
persistentVolumeClaim:
2026-07-24 11:17:10 +00:00
claimName: {{ include "k8s-pulse.fullname" . }}-data
2026-07-24 12:01:49 +00:00
{{- end }}
{{- if .Values.kubeconfig.enabled }}
- name: kubeconfig-volume
secret:
secretName: {{ include "k8s-pulse.kubeconfigSecretName" . }}
{{- end }}
2026-07-24 11:17:10 +00:00
{{- 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 }}