Skip to content

Commit

Permalink
feat(kgo): add affinity and tolerations fields (#1111)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Jul 25, 2024
1 parent 44d3a9c commit d1fa4c9
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 1 deletion.
6 changes: 6 additions & 0 deletions charts/gateway-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.1.10

### Changes

- Added `tolerations` and `affinity` fields support to specify on operator's Pods

## 0.1.9

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion charts/gateway-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ maintainers:
name: gateway-operator
sources:
- https://github.com/Kong/charts/tree/main/charts/gateway-operator
version: 0.1.9
version: 0.1.10
appVersion: "1.2"
annotations:
artifacthub.io/prerelease: "false"
Expand Down
24 changes: 24 additions & 0 deletions charts/gateway-operator/ci/affinity-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: component
operator: NotIn
values:
- dummy
topologyKey: kubernetes.io/hostname

livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 1
periodSeconds: 1

readinessProbe:
initialDelaySeconds: 1
periodSeconds: 1

env:
anonymous_reports: "false"
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
env:
# gateway controller
enable_gateway_controller: false
anonymous_reports: "false"
11 changes: 11 additions & 0 deletions charts/gateway-operator/ci/env-and-args-values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 1
periodSeconds: 1

readinessProbe:
initialDelaySeconds: 1
periodSeconds: 1

env:
# gateway controller
enable_controller_gateway: false
Expand Down
12 changes: 12 additions & 0 deletions charts/gateway-operator/ci/env-and-customenv-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 1
periodSeconds: 1

readinessProbe:
initialDelaySeconds: 1
periodSeconds: 1

env:
# gateway controller
enable_controller_gateway: false
anonymous_reports: "false"

customEnv:
TZ: "Europe/Berlin"
3 changes: 3 additions & 0 deletions charts/gateway-operator/ci/extra-labels-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ livenessProbe:
readinessProbe:
initialDelaySeconds: 1
periodSeconds: 1

env:
anonymous_reports: "false"
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ readinessProbe:

args:
- --zap-log-level=debug

env:
anonymous_reports: "false"
18 changes: 18 additions & 0 deletions charts/gateway-operator/ci/tolerations-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
tolerations:
- key: "example-key"
operator: "Exists"
effect: "NoSchedule"

livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 1
periodSeconds: 1

readinessProbe:
initialDelaySeconds: 1
periodSeconds: 1

env:
anonymous_reports: "false"
8 changes: 8 additions & 0 deletions charts/gateway-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ spec:
{{ include "kong.renderTpl" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
{{- end }}
spec:
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | nindent 8 }}
{{- end }}
containers:
- name: manager
{{ with .Values.args -}}
Expand Down
4 changes: 4 additions & 0 deletions charts/gateway-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ gwapi-standard-crds:
gwapi-experimental-crds:
enabled: false

affinity: {}

tolerations: []

# Customize gateway-operator livenessProbe.
livenessProbe:
httpGet:
Expand Down

0 comments on commit d1fa4c9

Please sign in to comment.