4
votes

I am trying to create a Helm chart for kafka-connect. For the testing purpose and to find out where I am exactly wrong I am not using the secrets for my access key and secret access key.

My helm chart is failing with the error:

helm install helm-kafka-0.1.0.tgz --namespace prod -f helm-kafka/values.yaml
Error: release loping-grizzly failed: Deployment.apps "kafka-connect" is invalid: spec.template.spec.containers[0].env[15].name: Required value

Based on issue: https://github.com/kubernetes/kubernetes/issues/46861

I changed my number to be a string. But still, the issue persists.

Can someone point me on how to troubleshoot/solve this?

My template/deployment.yaml

    spec:
      containers:
        - name: kafka-connect
          image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
          env:

           - name: "CONNECT_LOG4J_LOGGERS"
             value: "org.apache.zookeeper=ERROR,org.I0Itec.zkclient=ERROR,org.reflections=ERROR"

           - name: "CONNECT_OFFSET_STORAGE_TOPIC"
             value: "connect-offsets"

           - name: "CONNECT_PLUGIN_PATH"
             value: "/usr/share/java"

           - name: "CONNECT_PRODUCER_ACKS"
             value: "all"

           - name: "CONNECT_PRODUCER_COMPRESSION_TYPE"
             value: "snappy"

           - nane: "CONNECT_STATUS_STORAGE_TOPIC"
             value: "connect-status"
2
check you yaml syntax , after image , the env list doe not seem to be properIjaz Ahmad Khan
I checked that , if you replace the image to test:123 it returned me vaild yaml!user_01_02
looks like the typo was the problem. Was there any issue with the image line?Rico
No, there was no issue with the image line. It was the typo.user_01_02

2 Answers

6
votes

In:

- nane: "CONNECT_STATUS_STORAGE_TOPIC"
  value: "connect-status"

nane: should have an "m".

When the error message says spec.template.spec.containers[0].env[15].name you can find the first (zero-indexed) container definition, and within that the sixteenth (zero-indexed) environment variable, which has this typo.

3
votes

There's something wrong with the substitution of:

image: {{ .Values.image.repository }}:{{ .Values.image.tag }}

One or both the values don't exist in your Values.yaml. Or one or both have extra characters, possibly newlines.

If you look at the upstream chart, you see that it has image and imageTag, so in your template, you would have to have something like this:

image: {{ .Values.image }}:{{ .Values.imageTag }}