Helm chart passing multiple environment values for single key

user_01_02

I am new to helm charts and I am trying to pass some environment variables to schema-registry

Values.yaml

replicaCount: 1

image:
  repository: confluentinc/cp-schema-registry
  tag: 5.0.0
  pullPolicy: IfNotPresent
  env:
    - name: "SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS"
      value: "PLAINTEXT://xx.xxx.xx.x:9092,PLAINTEXT://xx.xxx.xx.x:9092,PLAINTEXT://xx.xxx.xx.x:9092"
    - name: "SCHEMA_REGISTRY_LISTENERS"
      value: "http://0.0.0.0:8083"

But these environment variables are not passed to the pod.

I tried passing as part of install command, but it failed because I cannot pass multiple values, Can anyone please let me know how you have passed your multiple environment variables

ubuntu@ip-10-xx-x-xx:~/helm-test$ helm install helm-test-0.1.0.tgz --set SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS=PLAINTEXT://xx.xxx.xx.xx:9092,PLAINTEXT://xx.xxx.xx.xx:9092,PLAINTEXT://xx.xxx.xx.xx:9092,SCHEMA_REGISTRY_LISTENERS=http://0.0.0.0:8083
Error: failed parsing --set data: key "97:9092" has no value (cannot end with ,)

After trying to pass the environment values both inside the values.yaml file and also as install command

replicaCount: 1

image:
  repository: confluentinc/cp-schema-registry
  tag: 5.0.0
  pullPolicy: IfNotPresent
  env:
    - name:
       SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: "PLAINTEXT://10.xxx.x.xx:9092,PLAINTEXT://10.xxx.x.xx:9092,PLAINTEXT://10.xxx.x.xx.xxx:9092"
       SCHEMA_REGISTRY_LISTENERS: "http://0.0.0.0:8083"


helm install helm-test-0.1.0.tgz --set env.name.SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS="PLAINTEXT://10.xx.x.xx:9092\,PLAINTEXT://10.xx.x.xx:9092\,PLAINTEXT://10.xx.x.xx:9092", --set env.nameSCHEMA_REGISTRY_LISTENERS="http://0.0.0.0:8083"

I escaped the commas since it was throwing an error Error: failed parsing --set data: key "xxx:9092" has no value (cannot end with ,)

I see that my environment values does not show when i try to describe a deployment.

kubectl describe deployment/crusty-aardwolf-helm-test
Name:                   crusty-aardwolf-helm-test
Namespace:              default
CreationTimestamp:      Wed, 10 Oct 2018 14:23:37 +0000
Labels:                 app.kubernetes.io/instance=crusty-aardwolf
                        app.kubernetes.io/managed-by=Tiller
                        app.kubernetes.io/name=helm-test
                        helm.sh/chart=helm-test-0.1.0
Annotations:            deployment.kubernetes.io/revision=1
Selector:               app.kubernetes.io/instance=crusty-aardwolf,app.kubernetes.io/name=helm-test
Replicas:               1 desired | 1 updated | 1 total | 0 available | 1 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:  app.kubernetes.io/instance=crusty-aardwolf
           app.kubernetes.io/name=helm-test
  Containers:
   helm-test:
    Image:        confluentinc/cp-schema-registry:5.0.0
    Port:         80/TCP
    Host Port:    0/TCP
    Liveness:     http-get http://:http/ delay=0s timeout=1s period=10s #success=1 #failure=3
    Readiness:    http-get http://:http/ delay=0s timeout=1s period=10s #success=1 #failure=3
    Environment:  <none>

Why are my environment values not passed to my container? Can someone please point me in right direction.

Rico

The values.yaml is more for actual values. You can use go template substitutions if you'd like to but it's less common. (These substitutions get used later in a template)

When you specify --set in for example helm install --set foo=bar foo will be overridden by bar in the values.yaml file. What you may really want is something like this:

...
env:
  name:
    SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: "PLAINTEXT://xx.xxx.xx.x:9092,PLAINTEXT://xx.xxx.xx.x:9092,PLAINTEXT://xx.xxx.xx.x:9092"
    SCHEMA_REGISTRY_LISTENERS: "http://0.0.0.0:8083"

and then on the helm install command line:

helm install helm-test-0.1.0.tgz --set env.name.SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS="PLAINTEXT://xx.xxx.xx.xx:9092,PLAINTEXT://xx.xxx.xx.xx:9092,PLAINTEXT://xx.xxx.xx.xx:9092" --set env.nameSCHEMA_REGISTRY_LISTENERS="http://0.0.0.0:8083"

More information on how to set the values here.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Multiple values for single key

Passing multiple values in single parameter

Helm chart: Why environment variable defined in values.yml of helm chart not added to generated manifest?

Helm chart overriding values

Transform multiple values to single key

Multiple Values for a single key in a dictionary

Passing multiple values to a single PowerShell script parameter

Passing multiple values as function in a single function

Modifying Airflow Helm chart values

How to insert multiple values to single key in javascript

how to add multiple values to single key in java

Storing Multiple Values to a Single Key in NSDictionary

Dictionary with single key multiple values in a list

Adding multiple values into a single key in swift?

Single key contains Multiple values in Map in scala

Python dictionary single key with multiple values possible?

spread single key against multiple values

How to add multiple values to a single key

How to store multiple values in single cookie key

How to set java environment variables in a helm chart?

Error when running Helm Chart with environment variables

Aggregating multiple values of single key into a single bucket elasticsearch

passing multiple values to a single column name when filtering records in django

Unittest only passing single value rather than getting multiple values

Variable value as yaml key in helm chart

Helm: Passing array values through --set

Is there a way to use helm to template the values of another helm chart?

Hierarchy of values for dynamic helm chart configuration

How to specify values for parent Helm chart