add/update how disruption budget works
This commit is contained in:
parent
51ffe193f8
commit
0e61f4f581
3 changed files with 23 additions and 3 deletions
|
@ -34,9 +34,12 @@ Expand the name of the chart.
|
|||
{{/*
|
||||
Compute the maximum number of unavailable replicas for the PodDisruptionBudget.
|
||||
This defaults to (n/2)-1 where n is the number of members of the server cluster.
|
||||
Add a special case for replicas=1, where it should default to 0 as well.
|
||||
*/}}
|
||||
{{- define "vault.pdb.maxUnavailable" -}}
|
||||
{{- if .Values.serverHA.disruptionBudget.maxUnavailable -}}
|
||||
{{- if eq (int .Values.serverHA.replicas) 1 -}}
|
||||
{{ 0 }}
|
||||
{{- else if .Values.serverHA.disruptionBudget.maxUnavailable -}}
|
||||
{{ .Values.serverHA.disruptionBudget.maxUnavailable -}}
|
||||
{{- else -}}
|
||||
{{- ceil (sub (div (int .Values.serverHA.replicas) 2) 1) -}}
|
||||
|
|
|
@ -34,7 +34,10 @@ spec:
|
|||
release: {{ .Release.Name }}
|
||||
component: server
|
||||
spec:
|
||||
#TODO: look at how Consul exposes affinity
|
||||
{{- if .Values.server.affinity }}
|
||||
affinity:
|
||||
{{ tpl .Values.server.affinity . | nindent 8 | trim }}
|
||||
{{- end }}
|
||||
terminationGracePeriodSeconds: 10
|
||||
volumes:
|
||||
- name: config
|
||||
|
|
16
values.yaml
16
values.yaml
|
@ -128,7 +128,7 @@ serverHA:
|
|||
# - type: secret (or "configMap")
|
||||
# name: my-secret
|
||||
# load: false # if true, will add to `-config` to load by Vault
|
||||
|
||||
|
||||
disruptionBudget:
|
||||
enabled: true
|
||||
|
||||
|
@ -136,6 +136,20 @@ serverHA:
|
|||
# replicas. If you'd like a custom value, you can specify an override here.
|
||||
maxUnavailable: null
|
||||
|
||||
# Affinity Settings
|
||||
# Commenting out or setting as empty the affinity variable, will allow
|
||||
# deployment to single node services such as Minikube
|
||||
affinity: |
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- labelSelector:
|
||||
matchLabels:
|
||||
app: {{ template "vault.name" . }}
|
||||
release: "{{ .Release.Name }}"
|
||||
component: server
|
||||
topologyKey: kubernetes.io/hostname
|
||||
|
||||
|
||||
# Configuration for DNS configuration within the Kubernetes cluster.
|
||||
# This creates a service that routes to all agents (client or server)
|
||||
# for serving DNS requests. This DOES NOT automatically configure kube-dns
|
||||
|
|
Loading…
Reference in a new issue