-
Notifications
You must be signed in to change notification settings - Fork 40k
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
add Description and validation properties to EnvVar in the REST API so that environment variables can have better tooling #4210
Comments
@jstrachan I understand why you'd want this, but we don't have a suitable object in the Kubernetes API on which to hang this information. Our objects are fully concrete. What you want is a parameterized template. This info more properly belongs here: |
How'd swagger be aware of pod-specific environment variable names, types and validation? I still don't grok why a couple more optional properties on the existing EnvVar type isn't an option. The next best thing would be optional annotations on the Pod I guess? |
Sorry, updated wrong issue. Deleted comment. I don't understand how you'd use the properties at this level of the API. The values of the environment variables would need to be set already when the pod, pod template, or replication controller were created. Isn't that too late for validation? |
Example template object:
I think the parameter block would be the right place to put additional information about application-level parameters. |
Some additional parameterization examples
I would like to use a different substitution mechanism than |
My initial motivation for this issue was the idea of tooling so that folks could configure an app/chart/package that was installed in kubernetes (and so editing the RC / DC / pod) using automated tooling which grokked the shape of the configuration (mostly env vars really). Particularly with the idea of consuming OOTB apps (e.g. with things like Helm) or moving apps between environments and making configuration changes along the way and so forth. Since the emergence of the Config Resource proposal: #6477 - I'm wondering if its maybe simpler for this kind of use case for the Config Resource to be editable via tools; by it having an optional, say, JSON Schema annotation which a tool could use to let users edit the configuration. So these parameters could be defined by the Config Resource and the Config Resource can then either contain or reference a schema file? |
Going to close this due to age and a general unwillingness (:)) to grow this particular API more. I think Helm, Templates, or other higher level tools can take on more of the burden now. I think experimentation could be done via a swagger schema link on a config map annotation? |
@smarterclayton Is this along the lines of what you were thinking?
|
Environment variables are one of the main configuration mechanisms in docker & kubernetes. It would be nice if we could export a little more metadata about the environment variables so that its easier for folks working across all kubernetes pods to be able to understand the configuration and for tools to be able to better visualise the configuration and allow editing in nicer forms with richer controls and validation. e.g. a description could be used in a web UI or CLI tool to describe the environment variables.
It might be nice to add JSON Schema validation properties too (e.g. Type field (for things line integer, number, uri, date-time, email etc), MinLength, MaxLength, Pattern etc) so that tools can generate an automatic editor of the environment variables.
e.g. if folks want to allow a pod definition to be visually edited by a tool, it'd be nice to be able from the Pod JSON to be able to generate a nice validating form with tooltips.
Then folks generating a Pod JSON/YAML file who have deeper knowledge about the internals of a docker container image could then export richer metadata about the environment variables so that generic kubernetes tooling would provide a richer experience.
The text was updated successfully, but these errors were encountered: