261 lines
9.6 KiB
YAML
261 lines
9.6 KiB
YAML
{{- $configSum := (include (print $.Template.BasePath "/configmap.yaml") . | sha256sum) }}
|
|
{{- $configSum2 := (include (print $.Template.BasePath "/secret.yaml") . | sha256sum) }}
|
|
{{- $configSum3 := (include (print $.Template.BasePath "/controller-manager-configmap.yaml") . | sha256sum) }}
|
|
{{- $configSumTornjak := (include (print $.Template.BasePath "/tornjak-config.yaml") . | sha256sum) }}
|
|
{{- $fullname := include "spire-server.fullname" . }}
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: {{ include "spire-server.fullname" . }}
|
|
namespace: {{ include "spire-server.namespace" . }}
|
|
labels:
|
|
{{- include "spire-server.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.autoscaling.enabled }}
|
|
{{- if and (eq .Values.dataStore.sql.databaseType "sqlite3") (gt (int .Values.replicaCount) 1) }}
|
|
{{- fail "When running with sqlite3 database, you can't scale up to more then one instance. 'replicaCount' MUST be 1" }}
|
|
{{- end }}
|
|
replicas: {{ .Values.replicaCount }}
|
|
{{- end }}
|
|
serviceName: {{ include "spire-server.fullname" . }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "spire-server.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
checksum/config: {{ $configSum }}
|
|
checksum/config2: {{ $configSum2 }}
|
|
checksum/config3: {{ $configSum3 }}
|
|
checksum/configTornjak: {{ $configSumTornjak }}
|
|
{{- with .Values.podAnnotations }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "spire-server.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "spire-server.serviceAccountName" . }}
|
|
shareProcessNamespace: true
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
{{- if gt (len .Values.initContainers) 0 }}
|
|
initContainers:
|
|
{{- toYaml .Values.initContainers | nindent 8 }}
|
|
{{- end }}
|
|
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:
|
|
- -expandEnv
|
|
- -config
|
|
- /run/spire/config/server.conf
|
|
env:
|
|
- name: PATH
|
|
value: "/opt/spire/bin:/bin"
|
|
{{- if ne .Values.dataStore.sql.databaseType "sqlite3" }}
|
|
- name: DBPW
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ $fullname }}-dbpw
|
|
key: DBPW
|
|
{{- end }}
|
|
ports:
|
|
- name: grpc
|
|
containerPort: 8081
|
|
protocol: TCP
|
|
- containerPort: 8080
|
|
name: healthz
|
|
{{- with .Values.federation }}
|
|
{{- if eq (.enabled | toString) "true" }}
|
|
- name: federation
|
|
containerPort: {{ .bundleEndpoint.port }}
|
|
protocol: TCP
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if (dig "telemetry" "prometheus" "enabled" .Values.telemetry.prometheus.enabled .Values.global) }}
|
|
- containerPort: 9988
|
|
name: prom
|
|
{{- end }}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /live
|
|
port: healthz
|
|
failureThreshold: 2
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 60
|
|
timeoutSeconds: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /ready
|
|
port: healthz
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: spire-server-socket
|
|
mountPath: /tmp/spire-server/private
|
|
readOnly: false
|
|
- name: spire-config
|
|
mountPath: /run/spire/config
|
|
readOnly: true
|
|
- name: spire-data
|
|
mountPath: /run/spire/data
|
|
readOnly: false
|
|
{{- if eq (.Values.upstreamAuthority.disk.enabled | toString) "true" }}
|
|
- name: upstream-ca
|
|
mountPath: /run/spire/upstream_ca
|
|
readOnly: false
|
|
{{ end }}
|
|
{{- if gt (len .Values.extraVolumeMounts) 0 }}
|
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
{{- end }}
|
|
{{- if eq (.Values.controllerManager.enabled | toString) "true" }}
|
|
- name: spire-controller-manager
|
|
securityContext:
|
|
{{- toYaml .Values.controllerManager.securityContext | nindent 12 }}
|
|
image: {{ template "spire-lib.image" (dict "appVersion" $.Chart.AppVersion "image" .Values.controllerManager.image "global" .Values.global) }}
|
|
imagePullPolicy: {{ .Values.controllerManager.image.pullPolicy }}
|
|
args:
|
|
- --config=controller-manager-config.yaml
|
|
ports:
|
|
- name: https
|
|
containerPort: 9443
|
|
protocol: TCP
|
|
- containerPort: 8083
|
|
name: healthz
|
|
{{- if (dig "telemetry" "prometheus" "enabled" .Values.telemetry.prometheus.enabled .Values.global) }}
|
|
- containerPort: 8082
|
|
name: prom2
|
|
{{- end }}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /healthz
|
|
port: healthz
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /readyz
|
|
port: healthz
|
|
resources:
|
|
{{- toYaml .Values.controllerManager.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: spire-server-socket
|
|
mountPath: /tmp/spire-server/private
|
|
readOnly: true
|
|
- name: controller-manager-config
|
|
mountPath: /controller-manager-config.yaml
|
|
subPath: controller-manager-config.yaml
|
|
readOnly: true
|
|
- name: spire-controller-manager-tmp
|
|
mountPath: /tmp
|
|
readOnly: false
|
|
{{- end }}
|
|
|
|
{{- if eq (.Values.tornjak.enabled | toString) "true" }}
|
|
- name: tornjak
|
|
securityContext:
|
|
{{- toYaml .Values.controllerManager.securityContext | nindent 12 }}
|
|
image: {{ template "spire-lib.image" (dict "appVersion" $.Chart.AppVersion "image" .Values.tornjak.image "global" .Values.global) }}
|
|
imagePullPolicy: {{ .Values.tornjak.image.pullPolicy }}
|
|
startupProbe:
|
|
httpGet:
|
|
scheme: HTTP
|
|
port: 10000
|
|
failureThreshold: 3
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
timeoutSeconds: 5
|
|
args:
|
|
- -c
|
|
- /run/spire/config/server.conf
|
|
- -t
|
|
- /run/spire/tornjak-config/server.conf
|
|
ports:
|
|
- name: tornjak
|
|
containerPort: 10000
|
|
protocol: TCP
|
|
resources:
|
|
{{- toYaml .Values.tornjak.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: {{ include "spire-tornjak.config" . }}
|
|
mountPath: /run/spire/tornjak-config
|
|
- name: spire-server-socket
|
|
mountPath: /tmp/spire-server/private
|
|
readOnly: true
|
|
- name: spire-config
|
|
mountPath: /run/spire/config
|
|
readOnly: true
|
|
- name: spire-data
|
|
mountPath: /run/spire/data
|
|
readOnly: false
|
|
{{- end }}
|
|
|
|
{{- if gt (len .Values.extraContainers) 0 }}
|
|
{{- toYaml .Values.extraContainers | nindent 8 }}
|
|
{{- 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 }}
|
|
{{- with .Values.topologySpreadConstraints }}
|
|
topologySpreadConstraints:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: spire-config
|
|
configMap:
|
|
name: {{ include "spire-server.fullname" . }}
|
|
- name: spire-server-socket
|
|
emptyDir: {}
|
|
- name: spire-controller-manager-tmp
|
|
emptyDir: {}
|
|
{{- if eq (.Values.upstreamAuthority.disk.enabled | toString) "true" }}
|
|
- name: upstream-ca
|
|
secret:
|
|
secretName: {{ include "spire-server.upstream-ca-secret" . }}
|
|
{{- end }}
|
|
{{- if eq (.Values.controllerManager.enabled | toString) "true" }}
|
|
- name: controller-manager-config
|
|
configMap:
|
|
name: {{ include "spire-controller-manager.fullname" . }}
|
|
{{- end }}
|
|
{{- if eq (.Values.tornjak.enabled | toString) "true" }}
|
|
{{- if .Values.tornjak.config }}
|
|
- name: {{ include "spire-tornjak.config" . }}
|
|
configMap:
|
|
defaultMode: 420
|
|
name: {{ include "spire-tornjak.config" . }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if gt (len .Values.extraVolumes) 0 }}
|
|
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
|
{{- end }}
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: spire-data
|
|
spec:
|
|
accessModes:
|
|
- {{ .Values.persistence.accessMode | default "ReadWriteOnce" }}
|
|
resources:
|
|
requests:
|
|
storage: {{ .Values.persistence.size }}
|
|
{{- if .Values.persistence.storageClass }}
|
|
storageClassName: {{ .Values.persistence.storageClass }}
|
|
{{- end }}
|