redpanda-data / redpanda-operator

39 stars 10 forks source link

🫐 🐛 Disabling the external service doesn't seem to work #145

Open c4milo opened 6 months ago

c4milo commented 6 months ago

If operators wish to manage the nodeport service themselves after having a cluster running, they would have to do extra work to remove the service managed by the operator/helm safely.

What happened?

diff --git a/redpanda/redpanda_cluster/helm_charts/redpanda-cluster/templates/redpanda-cluster.yml b/redpanda/redpanda_cluster/helm_charts/redpanda-cluster/templates/redpanda-cluster.yml
index 98cb1e3..9b6b8b6 100644
--- a/redpanda/redpanda_cluster/helm_charts/redpanda-cluster/templates/redpanda-cluster.yml
+++ b/redpanda/redpanda_cluster/helm_charts/redpanda-cluster/templates/redpanda-cluster.yml
@@ -39,15 +39,17 @@ spec:
         {{- toYaml .Values.nodeConfig | nindent 8 }}
     image:
       {{- toYaml .Values.containerImage | nindent 6 }}
-    # K8s NodePort service
+    # We disable the operator provided nodeport service becuase we need
+    # more flexiblity than the operator abstraction provides, for Private Links.
     external:
-      enabled: true
+      # Only disables the NodePort service, prefixTemplate is still used and active.
+      enabled: false
       service:
-        enabled: true
+        enabled: false
       domain: {{ .Values.baseDNSName }}
       type: NodePort
       externalDns:
-        enabled: true
+        enabled: false # no-op with NodePort service
       addresses:
         - $PREFIX_TEMPLATE
       # We have to use pod ordinal first because that's what external-dns-helper is doing.
Screenshot 2024-05-22 at 2 32 58 PM

What did you expect to happen?

I was expecting the nodeport redpanda-broker-external service to be removed.

How can we reproduce it (as minimally and precisely as possible)?. Please include values file.

  1. Deploy a cluster with external service enabled
  2. Wait for it to be healthy
  3. Disable nodeport service

Anything else we need to know?

No response

Which are the affected charts?

Redpanda, Operator

Chart Version(s)

5.8.5

Cloud provider

Azure

JIRA Link: K8S-233

JIRA Link: K8S-234

chrisseto commented 6 months ago

Camilo shared the helmrelease values from this cluster and we found that externalDns is being marshaled to {}. This is because enabled is a bool and not a *bool.

This is another point on the "bugs caused due to CRDs and values being out of sync". I'll make a tracking ticket and link back to this one.

For now this can be worked around by setting enabled to true or omitting the ExternalDns stanza all together.