charts icon indicating copy to clipboard operation
charts copied to clipboard

[bitnami/kafka] bug: provisioning job will fail when startup kafka with ssl

Open chenraoCR opened this issue 6 months ago • 7 comments

Name and Version

bitnami/kafka:32.2.2

What architecture are you using?

None

What steps will reproduce the bug?

  1. deploy bitnami/kafka:32.2.2 helm chart, kafka-controller can startup, but kafka-provisioning job will fail

Image

Image

Are you using any custom parameters or values?

listeners:
  client:
    protocol: SSL
tls:
  type: pem
  existingSecret: kafka-tls-secret
provisioning:
  enabled: true
  topics:
    - name: test
  auth:
    tls:
      type: pem
      certificatesSecret: kafka-tls-secret

What is the expected behavior?

kafka-controller pod should startup and also kafka-provisioning job should succeed and topic test should be created

What do you see instead?

kafka-provisioning job failed

Additional information

the initContainer wait-for-available-kafka will failed as in the container, it will use kafka client properties file, if kafka startup with ssl, means we set .Values.listeners.client.protocol to SSL, then in client.properties file, we make ssl related settings, but we did not mount the certs into this initContainer

we should also set as followings in wait-for-available-kafka https://github.com/bitnami/charts/blob/32d8701105619dced44cb5a8cf981c7d8a91c98b/bitnami/kafka/templates/provisioning/job.yaml#L291-L297

chenraoCR avatar May 02 '25 04:05 chenraoCR

Hi!

Thank you so much for spotting the issue. I will forward it to the team but we cannot guarantee an ETA. If you want to speed up the process, you can submit a PR updating the init container so it takes into account the ssl settings.

javsalgar avatar May 05 '25 08:05 javsalgar

Hello, I found the same issue. I have tried autogenerating TLS certificates with helm engine, autogenerating with cert-manager and last but not least, issuing a certificate and attaching it manually via tls.existingSecret. Provisioning was working fine while using PLAINTEXT.

@javsalgar , troubleshooting the error on provisioning I found that first initContainer prepare-config is failing:

kubectl logs -n kafka kafka-provisioning-1234k -c prepare-config
environment: line 11: /certs/tls.key: No such file or directory
environment: line 11: /certs/tls.crt: No such file or directory
environment: line 11: /certs/ca.crt: No such file or directory

In provisioning-job.yaml I see that main provisioning container does have this block, but not the initContainer.

        {{- if (regexFind "SSL" (upper .Values.listeners.client.protocol)) }}
        {{- if not (empty .Values.provisioning.auth.tls.certificatesSecret) }}
        - name: kafka-client-certs
          secret:
            secretName: {{ .Values.provisioning.auth.tls.certificatesSecret }}
            defaultMode: 256

since initContainer is not mounting /certs, it never finds the files tls.key, tls.crt and ca.crt.

I'm going to test this on a personal environment, should I missing something else while attaching the volume?

aparedero avatar May 14 '25 14:05 aparedero

Hi,

It could be that the init container is missing the volumeMount. What you are showing is the volumes section. Could you check if the init container has the volumeMount set?

javsalgar avatar May 15 '25 05:05 javsalgar

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] avatar May 31 '25 01:05 github-actions[bot]

@javsalgar The initcontainer is missing the volumeMount for kafka-client-certs. When I peaked in the wait-for-kafka initcontainer, it only shows shared, as it found the config file, but the /certs directory was missing and I could not navigate to it.

michaelvwu avatar Jun 04 '25 21:06 michaelvwu

Hi, so it seems that the only missing item would be to add that volume mount to that init container, is that correct?

javsalgar avatar Jun 05 '25 07:06 javsalgar

Hi, so it seems that the only missing item would be to add that volume mount to that init container, is that correct?

ya, correct

chenraoCR avatar Jun 16 '25 06:06 chenraoCR

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] avatar Jul 02 '25 01:07 github-actions[bot]

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.

github-actions[bot] avatar Jul 08 '25 01:07 github-actions[bot]