diff --git a/components/tyk-gateway/templates/pdb-gw.yaml b/components/tyk-gateway/templates/pdb-gw.yaml new file mode 100644 index 000000000..aadde78ad --- /dev/null +++ b/components/tyk-gateway/templates/pdb-gw.yaml @@ -0,0 +1,24 @@ +{{- if and .Values.gateway.minAvailable .Values.gateway.maxUnavailable }} +{{- print "If gateway.minAvailable and gateway.maxUnavailable are set at the same time, minAvailable takes precedence." }} +{{- end }} +{{- if or .Values.gateway.minAvailable .Values.gateway.maxUnavailable }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: gateway-{{ include "tyk-gateway.fullname" . }} + labels: + app: gateway-{{ include "tyk-gateway.fullname" . }} + chart: {{ include "tyk-gateway.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + {{- if .Values.gateway.minAvailable }} + minAvailable: {{ .Values.gateway.minAvailable }} + {{- else if .Values.gateway.maxUnavailable }} + maxUnavailable: {{ .Values.gateway.maxUnavailable }} + {{- end }} + selector: + matchLabels: + app: gateway-{{ include "tyk-gateway.fullname" . }} + release: {{ .Release.Name }} +{{- end}} diff --git a/components/tyk-gateway/values.yaml b/components/tyk-gateway/values.yaml index ac1265b79..44fad877d 100644 --- a/components/tyk-gateway/values.yaml +++ b/components/tyk-gateway/values.yaml @@ -149,6 +149,12 @@ gateway: # replicaCount specifies number of replicas to be created if kind is Deployment. replicaCount: 1 + # minAvailable and maxUnavailable configure thresholds for PodDisruptionBudget resource + # per PodDisruptionBudget spec they are mutually exclusive, but this chart allows + # setting them both, in which case minAvailable will take precedence + minAvailable: "" + maxUnavailable: "" + image: # image repository for Tyk Gateway repository: docker.tyk.io/tyk-gateway/tyk-gateway diff --git a/tyk-mdcb-data-plane/values.yaml b/tyk-mdcb-data-plane/values.yaml index 53bce06d6..7363b0e41 100644 --- a/tyk-mdcb-data-plane/values.yaml +++ b/tyk-mdcb-data-plane/values.yaml @@ -161,6 +161,12 @@ tyk-gateway: # replicaCount specifies number of replicas to be created if kind is Deployment. replicaCount: 1 + # minAvailable and maxUnavailable configure thresholds for PodDisruptionBudget resource + # per PodDisruptionBudget spec they are mutually exclusive, but this chart allows + # setting them both, in which case minAvailable will take precedence + minAvailable: "" + maxUnavailable: "" + image: # image repository for Tyk Gateway repository: tykio/tyk-gateway diff --git a/tyk-oss/values.yaml b/tyk-oss/values.yaml index 6988fcd7d..465b48bd3 100644 --- a/tyk-oss/values.yaml +++ b/tyk-oss/values.yaml @@ -133,6 +133,12 @@ tyk-gateway: # replicaCount specifies number of replicas to be created if kind is Deployment. replicaCount: 1 + # minAvailable and maxUnavailable configure thresholds for PodDisruptionBudget resource + # per PodDisruptionBudget spec they are mutually exclusive, but this chart allows + # setting them both, in which case minAvailable will take precedence + minAvailable: "" + maxUnavailable: "" + image: # image repository for Tyk Gateway repository: docker.tyk.io/tyk-gateway/tyk-gateway diff --git a/tyk-single-dc/values.yaml b/tyk-single-dc/values.yaml index 78c8cc4e1..ac39145eb 100644 --- a/tyk-single-dc/values.yaml +++ b/tyk-single-dc/values.yaml @@ -232,6 +232,12 @@ tyk-gateway: # replicaCount specifies number of replicas to be created if kind is Deployment. replicaCount: 1 + # minAvailable and maxUnavailable configure thresholds for PodDisruptionBudget resource + # per PodDisruptionBudget spec they are mutually exclusive, but this chart allows + # setting them both, in which case minAvailable will take precedence + minAvailable: "" + maxUnavailable: "" + # analyticsEnabled property is used to enable/disable analytics. # If set to empty or nil, analytics will be enabled/disabled based on `global.components.pump`. analyticsEnabled: ""