From 05e138aafe72314eb7d21ee46411be39d350e794 Mon Sep 17 00:00:00 2001 From: Colt McNealy Date: Wed, 5 Jun 2024 10:36:40 -0700 Subject: [PATCH 1/2] feat: optionally enable/disable gateway api --- charts/lh-operator/templates/deployment.yaml | 2 ++ charts/lh-operator/templates/role.yaml | 2 ++ charts/lh-operator/values.yaml | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/charts/lh-operator/templates/deployment.yaml b/charts/lh-operator/templates/deployment.yaml index 9e92718..96190ec 100644 --- a/charts/lh-operator/templates/deployment.yaml +++ b/charts/lh-operator/templates/deployment.yaml @@ -51,6 +51,8 @@ spec: value: "{{ .Values.certManager.enabled }}" - name: LHO_PROMETHEUS_ENABLED value: "{{ .Values.prometheus.enabled }}" + - name: LHO_GATEWAY_API_ENABLED + value: "{{ .Values.gatewayApi.enabled }}" - name: LOG_LEVEL value: "{{ .Values.logLevel }}" {{- with .Values.nodeSelector }} diff --git a/charts/lh-operator/templates/role.yaml b/charts/lh-operator/templates/role.yaml index 2f5ebf2..d1c818f 100644 --- a/charts/lh-operator/templates/role.yaml +++ b/charts/lh-operator/templates/role.yaml @@ -22,9 +22,11 @@ rules: - apiGroups: ["littlehorse.io"] resources: ["*"] verbs: ["*"] +{{- if .Values.strimzi.enabled }} - apiGroups: ["gateway.networking.k8s.io"] resources: ["tlsroutes"] verbs: ["get", "list", "watch", "create", "delete", "patch", "update"] +{{- end -}} {{- if .Values.strimzi.enabled }} - apiGroups: ["kafka.strimzi.io"] resources: ["kafkausers", "kafkatopics", "kafkas", "kafkanodepools", "kafkarebalances"] diff --git a/charts/lh-operator/values.yaml b/charts/lh-operator/values.yaml index 24f9eb7..059a1e9 100644 --- a/charts/lh-operator/values.yaml +++ b/charts/lh-operator/values.yaml @@ -41,6 +41,10 @@ certManager: # pecifies if CertManager is intalled enabled: false +gatewayApi: + # Specifies if the Operator can create Gateway API resources. + enabled: false + podAnnotations: {} podSecurityContext: {} From 976c2b2b97112cb1136e9c2c98718c61e60554ce Mon Sep 17 00:00:00 2001 From: Mateo Rojas Date: Wed, 5 Jun 2024 13:31:19 -0500 Subject: [PATCH 2/2] Replaces strimzi for gatewayApi on role.yaml --- charts/lh-operator/templates/role.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/lh-operator/templates/role.yaml b/charts/lh-operator/templates/role.yaml index d1c818f..27ccea9 100644 --- a/charts/lh-operator/templates/role.yaml +++ b/charts/lh-operator/templates/role.yaml @@ -22,7 +22,7 @@ rules: - apiGroups: ["littlehorse.io"] resources: ["*"] verbs: ["*"] -{{- if .Values.strimzi.enabled }} +{{- if .Values.gatewayApi.enabled }} - apiGroups: ["gateway.networking.k8s.io"] resources: ["tlsroutes"] verbs: ["get", "list", "watch", "create", "delete", "patch", "update"]