Skip to content

Commit

Permalink
feat(kgo): Allow users to modify startup parameters and env vars (#1027)
Browse files Browse the repository at this point in the history
* feat(kgo): Allow users to modify startup parameters.

Signed-off-by: Jintao Zhang <[email protected]>

* feat(kgo): allow users to provide env vars

Signed-off-by: Jintao Zhang <[email protected]>

* Apply suggestions from code review

Co-authored-by: Patryk Małek <[email protected]>

* rename featureFlags to controllers

Signed-off-by: Jintao Zhang <[email protected]>

* kgo: update version so that it has --enable-controller-aigateway flag

---------

Signed-off-by: Jintao Zhang <[email protected]>
Co-authored-by: Patryk Małek <[email protected]>
  • Loading branch information
tao12345666333 and pmalek committed Mar 9, 2024
1 parent cb0328c commit 9ffc6a1
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
12 changes: 12 additions & 0 deletions charts/gateway-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,15 @@ app.kubernetes.io/name: {{ template "kong.name" . }}
app.kubernetes.io/component: kgo
app.kubernetes.io/instance: "{{ .Release.Name }}"
{{- end -}}

{{- define "kong.env" -}}
{{- $userEnv := dict -}}
{{- range $key, $val := .Values.env }}
{{- $upper := upper $key -}}
{{- $_ := set $userEnv $upper $val -}}
{{- end -}}
{{- range $key, $val := $userEnv }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end -}}
{{- end -}}
18 changes: 18 additions & 0 deletions charts/gateway-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,25 @@ spec:
- args:
- --health-probe-bind-address=:8081
- --metrics-bind-address=127.0.0.1:8080
{{- if .Values.controllers }}
{{- if .Values.controllers.controlplaneController }}
- --enable-controller-controlplane={{ .Values.controllers.controlplaneController.enabled }}
{{- end }}
{{- if .Values.controllers.gatewayController }}
- --enable-controller-gateway={{ .Values.controllers.gatewayController.enabled }}
{{- end }}
{{- if .Values.controllers.dataplaneController }}
- --enable-controller-dataplane={{ .Values.controllers.dataplaneController.enabled }}
{{- end }}
{{- if .Values.controllers.dataplaneBlueGreenController }}
- --enable-controller-dataplane-bluegreen={{ .Values.controllers.dataplaneBlueGreenController.enabled }}
{{- end }}
{{- if .Values.controllers.aiGatewayController }}
- --enable-controller-aigateway={{ .Values.controllers.aiGatewayController.enabled }}
{{- end }}
{{- end }}
env:
{{- include "kong.env" . | nindent 8 }}
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down
23 changes: 22 additions & 1 deletion charts/gateway-operator/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image:
repository: docker.io/kong/gateway-operator
tag: sha-f792452-amd64
tag: sha-79a6453

# Override namepsace for gateway-operator chart resources. By default, the chart creates resources in the release namespace.
# namespace: kong-system
Expand Down Expand Up @@ -43,3 +43,24 @@ resources:
requests:
cpu: 10m
memory: 128Mi

# use this section to enable or disable the controllers
controllers:
# controlPlane controller
controlplaneController:
enabled: true
# gateway controller
gatewayController:
enabled: true
# dataplane controller. mutually exclusive with dataplane bluegreen controller
dataplaneController:
enabled: false
# dataplane bluegreen controller. mutually exclusive with dataplane controller
dataplaneBlueGreenController:
enabled: true
# aigateway controller. (experimental)
aiGatewayController:
enabled: false

# Use this section to add environment variables to operator's container
env: {}

0 comments on commit 9ffc6a1

Please sign in to comment.