ckotzbauer_helm-charts/charts/sbom-operator/templates/deployment.yaml

91 lines
2.5 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "app.name" . }}
labels:
{{- include "app.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "app.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "app.selectorLabels" . | nindent 8 }}
{{- if .Values.podAnnotations }}
annotations:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "app.serviceAccountName" . }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
{{- range $key, $value := .Values.args }}
{{- if $value }}
- --{{ $key }}={{ $value }}
{{- else }}
- --{{ $key }}
{{- end }}
{{- end }}
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.envVars }}
{{ toYaml .Values.envVars | nindent 12 }}
{{- end }}
{{- if .Values.jobImageMode }}
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_UID
valueFrom:
fieldRef:
fieldPath: metadata.uid
{{- end }}
securityContext:
{{ toYaml .Values.securityContext | indent 12 }}
resources:
{{ toYaml .Values.resources | indent 12 }}
ports:
- containerPort: 8080
name: http
protocol: TCP
livenessProbe:
timeoutSeconds: 3
httpGet:
path: "/health"
port: http
readinessProbe:
timeoutSeconds: 3
httpGet:
path: "/health"
port: http
volumeMounts:
- mountPath: /work
name: work
- mountPath: /tmp
name: tmp
volumes:
- name: work
emptyDir: {}
- name: tmp
emptyDir: {}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}