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.
|
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.
|
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" -}}
|
{{- 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 -}}
|
{{ .Values.serverHA.disruptionBudget.maxUnavailable -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- ceil (sub (div (int .Values.serverHA.replicas) 2) 1) -}}
|
{{- ceil (sub (div (int .Values.serverHA.replicas) 2) 1) -}}
|
||||||
|
|
|
@ -34,7 +34,10 @@ spec:
|
||||||
release: {{ .Release.Name }}
|
release: {{ .Release.Name }}
|
||||||
component: server
|
component: server
|
||||||
spec:
|
spec:
|
||||||
#TODO: look at how Consul exposes affinity
|
{{- if .Values.server.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{ tpl .Values.server.affinity . | nindent 8 | trim }}
|
||||||
|
{{- end }}
|
||||||
terminationGracePeriodSeconds: 10
|
terminationGracePeriodSeconds: 10
|
||||||
volumes:
|
volumes:
|
||||||
- name: config
|
- name: config
|
||||||
|
|
14
values.yaml
14
values.yaml
|
@ -136,6 +136,20 @@ serverHA:
|
||||||
# replicas. If you'd like a custom value, you can specify an override here.
|
# replicas. If you'd like a custom value, you can specify an override here.
|
||||||
maxUnavailable: null
|
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.
|
# Configuration for DNS configuration within the Kubernetes cluster.
|
||||||
# This creates a service that routes to all agents (client or server)
|
# This creates a service that routes to all agents (client or server)
|
||||||
# for serving DNS requests. This DOES NOT automatically configure kube-dns
|
# for serving DNS requests. This DOES NOT automatically configure kube-dns
|
||||||
|
|
Loading…
Reference in a new issue