openbao-helm/templates/server-statefulset.yaml

95 lines
3.2 KiB
YAML
Raw Permalink Normal View History

# StatefulSet to run the actual vault server cluster.
{{ template "vault.mode" . }}
{{- if and (ne .mode "") (eq (.Values.global.enabled | toString) "true") }}
2018-08-18 05:08:03 +00:00
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "vault.fullname" . }}
labels:
2019-08-07 18:55:32 +00:00
helm.sh/chart: {{ include "vault.chart" . }}
app.kubernetes.io/name: {{ include "vault.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/version: {{ .Chart.Version | quote }}
2018-08-18 05:08:03 +00:00
spec:
serviceName: {{ template "vault.fullname" . }}
2018-08-18 05:08:03 +00:00
podManagementPolicy: Parallel
replicas: {{ template "vault.replicas" . }}
updateStrategy:
type: OnDelete
selector:
matchLabels:
2019-08-07 18:55:32 +00:00
helm.sh/chart: {{ template "vault.chart" . }}
app.kubernetes.io/name: {{ template "vault.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
component: server
2018-08-18 05:08:03 +00:00
template:
metadata:
labels:
2019-08-07 18:55:32 +00:00
helm.sh/chart: {{ template "vault.chart" . }}
app.kubernetes.io/name: {{ template "vault.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
component: server
{{ template "vault.annotations" . }}
2018-08-18 05:08:03 +00:00
spec:
{{ template "vault.affinity" . }}
{{ template "vault.tolerations" . }}
{{ template "vault.nodeselector" . }}
2018-08-18 05:08:03 +00:00
terminationGracePeriodSeconds: 10
serviceAccountName: {{ template "vault.fullname" . }}
2018-08-18 05:08:03 +00:00
securityContext:
fsGroup: {{ template "vault.fsgroup" . }}
2018-08-18 05:08:03 +00:00
volumes:
{{ template "vault.volumes" . }}
2018-08-18 05:08:03 +00:00
containers:
- name: vault
{{ template "vault.resources" . }}
securityContext:
privileged: true
image: "{{ .Values.global.image }}"
command: {{ template "vault.command" . }}
args: {{ template "vault.args" . }}
2018-08-18 05:08:03 +00:00
env:
- name: HOST_IP
2018-08-18 05:08:03 +00:00
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: POD_IP
2018-08-18 05:08:03 +00:00
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: VAULT_ADDR
value: "http://localhost:8200"
- name: SKIP_CHOWN
value: "true"
{{ template "vault.envs" . }}
{{- include "vault.extraEnvironmentVars" .Values.server | nindent 12 }}
2018-08-18 05:08:03 +00:00
volumeMounts:
{{ template "vault.mounts" . }}
2018-08-18 05:08:03 +00:00
lifecycle:
preStop:
exec:
command: ["vault", "step-down"]
2018-08-18 05:08:03 +00:00
ports:
- containerPort: 8200
2018-08-18 05:08:03 +00:00
name: http
- containerPort: 8201
name: internal
- containerPort: 8202
name: replication
readinessProbe:
# Check status; unsealed vault servers return 0
# The exit code reflects the seal status:
# 0 - unsealed
# 1 - error
# 2 - sealed
exec:
command: ["/bin/sh", "-ec", "vault status"]
failureThreshold: 2
initialDelaySeconds: 5
periodSeconds: 3
successThreshold: 1
timeoutSeconds: 5
{{ template "vault.volumeclaims" . }}
{{ end }}