add/update how disruption budget works

This commit is contained in:
Clint Shryock 2018-12-03 11:30:50 -06:00
parent 51ffe193f8
commit 0e61f4f581
No known key found for this signature in database
GPG key ID: B7C8F9C70EC5CD29
3 changed files with 23 additions and 3 deletions

View file

@ -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) -}}

View file

@ -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

View file

@ -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