rancher-partner-charts/charts/hashicorp/consul/templates/connect-injector-disruption...

31 lines
1.2 KiB
YAML

{{- if (and .Values.connectInject.disruptionBudget.enabled (or (and (ne (.Values.connectInject.enabled | toString) "-") .Values.connectInject.enabled) (and (eq (.Values.connectInject.enabled | toString) "-") .Values.global.enabled))) }}
# PodDisruptionBudget to prevent degrading the connectInject cluster through
# voluntary cluster changes.
{{- if .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ template "consul.fullname" . }}-connect-injector
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "consul.name" . }}
chart: {{ template "consul.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
component: connect-injector
spec:
{{- if .Values.connectInject.disruptionBudget.minAvailable }}
minAvailable: {{ .Values.connectInject.disruptionBudget.minAvailable }}
{{- else }}
maxUnavailable: {{ template "consul.pdb.connectInject.maxUnavailable" . }}
{{- end }}
selector:
matchLabels:
app: {{ template "consul.name" . }}
release: "{{ .Release.Name }}"
component: connect-injector
{{- end }}