Files
helm-charts-hardened/charts/spire/charts/spiffe-oidc-discovery-provider/templates/deployment.yaml
T
Mariusz Sabath 1247b68f4d Parametrize probes (#310)
This PR addresses #307 by parametrizing Probes and moving them to
values.yaml

---------

Signed-off-by: Mariusz Sabath <[email protected]>
2023-05-25 08:53:44 -04:00

133 lines
5.0 KiB
YAML

{{- $configSum := (include (print $.Template.BasePath "/configmap.yaml") . | sha256sum) }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "spiffe-oidc-discovery-provider.fullname" . }}
namespace: {{ include "spiffe-oidc-discovery-provider.namespace" . }}
labels:
{{- include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "spiffe-oidc-discovery-provider.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
checksum/config: {{ $configSum }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "spiffe-oidc-discovery-provider.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "spiffe-oidc-discovery-provider.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: {{ template "spire-lib.image" (dict "appVersion" $.Chart.AppVersion "image" .Values.image "global" .Values.global) }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- -config
- /run/spire/oidc/config/oidc-discovery-provider.conf
ports:
- containerPort: 8008
name: healthz
{{- if not .Values.insecureScheme.enabled }}
- containerPort: 443
name: https
{{- end }}
volumeMounts:
- name: spiffe-workload-api
mountPath: {{ include "spiffe-oidc-discovery-provider.workload-api-socket-path" . | dir }}
readOnly: true
- name: spire-oidc-sockets
mountPath: /run/spire/oidc-sockets
readOnly: false
- name: spire-oidc-config
mountPath: /run/spire/oidc/config/oidc-discovery-provider.conf
subPath: oidc-discovery-provider.conf
readOnly: true
readinessProbe:
httpGet:
path: /ready
port: healthz
{{- toYaml .Values.readinessProbe | nindent 12 }}
livenessProbe:
httpGet:
path: /live
port: healthz
{{- toYaml .Values.livenessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.insecureScheme.enabled }}
- name: nginx
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: {{ template "spire-lib.image" (dict "image" .Values.insecureScheme.nginx.image "global" .Values.global) }}
imagePullPolicy: {{ .Values.insecureScheme.nginx.image.pullPolicy }}
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: spire-oidc-sockets
mountPath: /run/spire/oidc-sockets
readOnly: true
- name: spire-oidc-config
mountPath: /etc/nginx/conf.d/default.conf
subPath: default.conf
readOnly: true
- name: nginx-tmp
mountPath: /tmp
readOnly: false
resources:
{{- toYaml .Values.insecureScheme.nginx.resources | nindent 12 }}
{{- if (dig "telemetry" "prometheus" "enabled" .Values.telemetry.prometheus.enabled .Values.global) }}
- name: nginx-exporter
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: {{ template "spire-lib.image" (dict "image" .Values.telemetry.prometheus.nginxExporter.image "global" .Values.global) }}
imagePullPolicy: {{ .Values.telemetry.prometheus.nginxExporter.image.pullPolicy }}
args:
- -nginx.scrape-uri=http://127.0.0.1:8080/stub_status
resources:
{{- toYaml .Values.telemetry.prometheus.nginxExporter.resources | nindent 12 }}
ports:
- containerPort: 9113
name: prom
{{- end }}
{{- end }}
volumes:
- name: spiffe-workload-api
csi:
driver: "csi.spiffe.io"
readOnly: true
- name: spire-oidc-sockets
emptyDir: {}
- name: spire-oidc-config
configMap:
name: {{ include "spiffe-oidc-discovery-provider.fullname" . }}
- name: nginx-tmp
emptyDir: {}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}