Skip to content

Commit

Permalink
add support for pdb resource for gateway component
Browse files Browse the repository at this point in the history
  • Loading branch information
rakkhin committed Oct 20, 2023
1 parent 41f16e3 commit 2a94252
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
24 changes: 24 additions & 0 deletions components/tyk-gateway/templates/pdb-gw.yaml
Original file line number Diff line number Diff line change
@@ -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}}
6 changes: 6 additions & 0 deletions components/tyk-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tyk-mdcb-data-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tyk-oss/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tyk-single-dc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down

0 comments on commit 2a94252

Please sign in to comment.