Because we are already in the context of spire-agent the API looks more logical to not have another 'agent' part in the name. Furthermore to make it more clear the oidc provider only requires the name of the socket as opposed to the entire path like in the other charts I made that more explicit in the name of the value. --------- Signed-off-by: Marco Franssen <[email protected]>
135 lines
5.0 KiB
YAML
135 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 "spiffe-oidc-discovery-provider.image" (dict "appVersion" $.Chart.AppVersion "image" .Values.image) }}
|
|
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
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /live
|
|
port: healthz
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
{{- if .Values.insecureScheme.enabled }}
|
|
- name: nginx
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: {{ template "spiffe-oidc-discovery-provider.image" .Values.insecureScheme.nginx }}
|
|
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 "spiffe-oidc-discovery-provider.image" .Values.telemetry.prometheus.nginxExporter }}
|
|
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 }}
|