bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
9.62k stars 9.52k forks source link

[binami/kafka] nodePort field explicitly set to null if not provided in the values #33037

Closed alexgenon closed 6 days ago

alexgenon commented 1 month ago

Name and Version

bitnami/kafka 32.2.0

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Deploy Kafka using the Helm values below, kustomize and ArgoCD
  2. In ArgoCD, you can see in the Desired Manifest for the external service that the nodePort value is set to null.
  3. Sync in ArgoCD
  4. The external service is marked as out of sync in ArgoCD since a NodePort has been allocated to it.

Are you using any custom parameters or values?

sasl:
  client:
    users:
      - kafka
  existingSecret: kafka-credentials

controller: 
  automountServiceAccountToken: true # required by LB auto-discovery
  heapOpts: -Xmx512m -Xms512m
  replicaCount: 1

externalAccess:
  enabled: true

defaultInitContainers:
  autoDiscovery:
    enabled: true

rbac: # required by LB auto-discovery
  create: true

What is the expected behavior?

If the externalAccess.broker.service.nodePorts field is not specified in the values file, it should not be set in the inflated manifest

What do you see instead?

Field /spec/ports/*/nodePort in external service is set to null, causing ArgoCD to flag the service as out of sync.

apiVersion: v1
kind: Service
metadata:
  labels:
    app.kubernetes.io/component: kafka
    app.kubernetes.io/instance: kafka
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: kafka
    app.kubernetes.io/version: 4.0.0
    helm.sh/chart: kafka-32.2.0
    pod: kafka-controller-0
  name: kafka-controller-0-external
  namespace: monitoring
spec:
  allocateLoadBalancerNodePorts: true
  ports:
  - name: tcp-kafka
    nodePort: null
    port: 9094
    targetPort: external
  publishNotReadyAddresses: false
  selector:
    app.kubernetes.io/component: controller-eligible
    app.kubernetes.io/instance: kafka
    app.kubernetes.io/name: kafka
    app.kubernetes.io/part-of: kafka
    statefulset.kubernetes.io/pod-name: kafka-controller-0
  type: LoadBalancer

Additional information

Using the values below, Helm will create a service of type LoadBalancer using the template svc-external-access.yaml.

This template will use the values of externalAccess.broker.service.nodePorts to set the nodePort values in /spec/ports/*/nodePort.

But if this array is not set, then it explicitly sets the nodePort field to null. See svc-external-access.yaml#L50-L53.

carrodher commented 4 weeks ago

Thank you for bringing this issue to our attention. We appreciate your involvement! If you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.

alexgenon commented 3 weeks ago

Thank you @carrodher, I created https://github.com/bitnami/charts/pull/33134. I hope I did not miss anything (that's my first PR on a Helm charts git repo)!

carrodher commented 3 weeks ago

Thank you for opening this issue and submitting the associated Pull Request. Our team will review and provide feedback. Once the PR is merged, the issue will automatically close.

Your contribution is greatly appreciated!

github-actions[bot] commented 1 week ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 6 days ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.