Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kafka helm fails when provision topics: "can't evaluate field replicationFactor in type interface {}" #31206

Closed
aparedero opened this issue Jan 3, 2025 · 1 comment
Assignees
Labels
solved tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@aparedero
Copy link

Name and Version

bitnami/kafka:3.9.0

What architecture are you using?

amd64

What steps will reproduce the bug?

In my case I'm using an AKS cluster but its a helm templating error.

Create and copy into a file basic configuration with "helm show values bitnami/kafka".

Enable provisionig and attempt to create topics:

provisioning:
  enabled: true
  automountServiceAccountToken: true
  numPartitions: 1
  replicationFactor: 1
  topics: ['topic','test']

Are you using any custom parameters or values?

rbac and autodiscovery set to true enforces to enable *.automountServiceAccountToken to true. Other parameters remains with its default values.

What is the expected behavior?

Helm Chart deployed, basic successful Helm message I see when I do same deployment but with provisioning.enabled=false

What do you see instead?

Error: template: kafka/templates/provisioning/job.yaml:161:50: executing "kafka/templates/provisioning/job.yaml" at <$topic.replicationFactor>: can't evaluate field replicationFactor in type interface {}

Additional information

The goal is to provision a couple of topics while installing and setting up Kafka, but the templating engine shows the error Error: template: kafka/templates/provisioning/job.yaml:161:50: executing "kafka/templates/provisioning/job.yaml" at <$topic.replicationFactor>: can't evaluate field replicationFactor in type interface {}

@aparedero aparedero added the tech-issues The user has a technical issue about an application label Jan 3, 2025
@github-actions github-actions bot added the triage Triage is needed label Jan 3, 2025
@aparedero
Copy link
Author

Closing. I don't see the relationship because Helm Chart templating it's not related to existing resources in k8s but after uninstalling Helm and removing manually PVC (remember that Helm does not delete pvc's), starting from scratch with the following configuration it works.

Leaving this ticket as reference in the future if someone gets similar error: Just remove your pvc's with

kubectl delete pvc data-kafka-controller-0 data-kafka-controller-1 data-kafka-controller-2 -n <namespace>

Attaching basic configuration with "topic" and "test" topics.

#[...]
provisioning:
  enabled: true
  automountServiceAccountToken: true
  numPartitions: 1
  replicationFactor: 1
  topics: []
  nodeSelector: {}
  tolerations: []
  extraProvisioningCommands: ["topic","test"]
  parallel: 1
  preScript: ""
  postScript: ""
#[...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

2 participants