chore(argo-cd): Improve PDB implementation and documentation (#1544)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>
This commit is contained in:
Petr Drastil 2022-10-12 14:55:33 +02:00 committed by GitHub
parent d75f8e615a
commit 9743219ace
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 327 additions and 133 deletions

View file

@ -2,23 +2,23 @@
apiVersion: {{ include "argo-cd.apiVersion.pdb" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "argo-cd.controller.fullname" . }}
name: {{ include "argo-cd.controller.fullname" . }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
{{- with .Values.controller.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.controller.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.controller.pdb.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.controller.pdb.minAvailable }}
minAvailable: {{ .Values.controller.pdb.minAvailable }}
{{- else if .Values.controller.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.controller.pdb.maxUnavailable }}
{{- with .Values.controller.pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- else }}
minAvailable: 0
minAvailable: {{ .Values.controller.pdb.minAvailable | default 0 }}
{{- end }}
selector:
matchLabels:

View file

@ -0,0 +1,26 @@
{{- if and .Values.applicationSet.enabled .Values.applicationSet.pdb.enabled }}
apiVersion: {{ include "argo-cd.apiVersion.pdb" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "argo-cd.applicationSet.fullname" . }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.applicationSet.name "name" .Values.applicationSet.name) | nindent 4 }}
{{- with .Values.applicationSet.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.applicationSet.pdb.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- with .Values.applicationSet.pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- else }}
minAvailable: {{ .Values.applicationSet.pdb.minAvailable | default 0 }}
{{- end }}
selector:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.applicationSet.name) | nindent 6 }}
{{- end }}

View file

@ -0,0 +1,26 @@
{{- if and .Values.notifications.enabled .Values.notifications.bots.slack.enabled .Values.notifications.bots.slack.pdb.enabled }}
apiVersion: {{ include "argo-cd.apiVersion.pdb" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "argo-cd.notifications.fullname" . }}-bot
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.bots.slack.name "name" .Values.notifications.bots.slack.name) | nindent 4 }}
{{- with .Values.notifications.bots.slack.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.notifications.bots.slack.pdb.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- with .Values.notifications.bots.slack.pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- else }}
minAvailable: {{ .Values.notifications.bots.slack.pdb.minAvailable | default 0 }}
{{- end }}
selector:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.notifications.bots.slack.name "name" "metrics") | nindent 6 }}
{{- end }}

View file

@ -0,0 +1,26 @@
{{- if and .Values.notifications.enabled .Values.notifications.pdb.enabled }}
apiVersion: {{ include "argo-cd.apiVersion.pdb" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "argo-cd.notifications.fullname" . }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}
{{- with .Values.notifications.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.notifications.pdb.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- with .Values.notifications.pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- else }}
minAvailable: {{ .Values.notifications.pdb.minAvailable | default 0 }}
{{- end }}
selector:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.notifications.name) | nindent 6 }}
{{- end }}

View file

@ -2,23 +2,23 @@
apiVersion: {{ include "argo-cd.apiVersion.pdb" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "argo-cd.repoServer.fullname" . }}
name: {{ include "argo-cd.repoServer.fullname" . }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 4 }}
{{- with .Values.repoServer.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.repoServer.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.repoServer.pdb.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.repoServer.pdb.minAvailable }}
minAvailable: {{ .Values.repoServer.pdb.minAvailable }}
{{- else if .Values.repoServer.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.repoServer.pdb.maxUnavailable }}
{{- with .Values.repoServer.pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- else }}
minAvailable: 0
minAvailable: {{ .Values.repoServer.pdb.minAvailable | default 0 }}
{{- end }}
selector:
matchLabels:

View file

@ -2,23 +2,23 @@
apiVersion: {{ include "argo-cd.apiVersion.pdb" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "argo-cd.server.fullname" . }}
name: {{ include "argo-cd.server.fullname" . }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
{{- with .Values.server.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.server.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.server.pdb.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.server.pdb.minAvailable }}
minAvailable: {{ .Values.server.pdb.minAvailable }}
{{- else if .Values.server.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.server.pdb.maxUnavailable }}
{{- with .Values.server.pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- else }}
minAvailable: 0
minAvailable: {{ .Values.server.pdb.minAvailable | default 0 }}
{{- end }}
selector:
matchLabels:

View file

@ -1,24 +1,24 @@
{{- if .Values.dex.pdb.enabled }}
{{- if and .Values.dex.enabled .Values.dex.pdb.enabled }}
apiVersion: {{ include "argo-cd.apiVersion.pdb" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "argo-cd.dex.fullname" . }}
name: {{ include "argo-cd.dex.fullname" . }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
{{- with .Values.dex.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.dex.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.dex.pdb.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.dex.pdb.minAvailable }}
minAvailable: {{ .Values.dex.pdb.minAvailable }}
{{- else if .Values.dex.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.dex.pdb.maxUnavailable }}
{{- with .Values.dex.pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- else }}
minAvailable: 0
minAvailable: {{ .Values.dex.pdb.minAvailable | default 0 }}
{{- end }}
selector:
matchLabels:

View file

@ -1,24 +1,25 @@
{{- if .Values.redis.pdb.enabled }}
{{- $redisHa := index .Values "redis-ha" -}}
{{- if and .Values.redis.enabled (not $redisHa.enabled) .Values.redis.pdb.enabled }}
apiVersion: {{ include "argo-cd.apiVersion.pdb" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "argo-cd.redis.fullname" . }}
name: {{ include "argo-cd.redis.fullname" . }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}
{{- with .Values.redis.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.redis.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.redis.pdb.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.redis.pdb.minAvailable }}
minAvailable: {{ .Values.redis.pdb.minAvailable }}
{{- else if .Values.redis.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.redis.pdb.maxUnavailable }}
{{- with .Values.dex.pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- else }}
minAvailable: 0
minAvailable: {{ .Values.redis.pdb.minAvailable | default 0 }}
{{- end }}
selector:
matchLabels: