-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Container environment variables key name restriction #447
Comments
This is actually a restriction on env vars in bash afaik that Kubernetes inherits & validates against. See https:/kubernetes/kubernetes/blob/f2ddd60eb9e7e9e29f7a105a9a8fa020042e8e52/pkg/api/v1/types.go#L923-L924 & https:/kubernetes/kubernetes/blob/f2ddd60eb9e7e9e29f7a105a9a8fa020042e8e52/pkg/api/v1/types.go#L42-L46. |
@jimmidyson Kubernetes was relax restrictions on environment variable names. env:
- name: "cluster.name"
value: "elasticsearch-cluster-1550544058281"
- name: "bootstrap.memory_lock"
value: "true"
- name: "discovery.zen.ping.unicast.hosts"
value: "elasticsearch-discovery-1550544058281"
- name: "node.master"
value: "false"
- name: "node.data"
value: "true"
- name: "ES_JAVA_OPTS"
value: "-Xms8192m -Xmx8192m" Error message:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to add environment variables for containers , looks like there is restriction for key names
[a-zA-Z0-9_]
Sample code
List<EnvVar> envValues = new ArrayList<>(); for (Map.Entry<String, String> env : envProps.entrySet()) { EnvVar envVar = new EnvVar(); envVar.setName(env.getKey()); envVar.setValue(env.getValue()); envValues.add(envVar); } container.setEnv(envValues);
I try to use key like
myprop.db.name
it barfs . Is this client library limitation or k8s itself ?The text was updated successfully, but these errors were encountered: