ankaios
ankaios copied to clipboard
Add workload config object to the desired state
Description
Currently the only way to configure workloads is to add configuration parameters to the runtime. This enhancement shall allow to decouple configuration from workload such that the same workload can be used with different configurations. For that a new object config
shall be created that also resides in Ankaios manifests parallel to workload
.
A config shall contain key-value pairs that can be used as environment variables, command-line arguments or as read-only configuration files to be provide to the workload.
To limit resource usage (probably the config map will be part of the complete state and thus consume RAM) we should limit the size of a config to a maximum value (e.g. 1MB).
For the values, text and binary (base-64 encoded) data shall be allowed.
When providing a config value as file then owner and mode shall also be configurable.
Maybe we reuse the same format as the Kubernetes ConfigMap, for example:
configs:
myconfig:
binaryData:
mykey1: <base64 encoded data>
data:
mykey2: bla
mykey3: |
foo=bar
name=alice
It should be possible that one workload uses several configs. It should also be possible that all key/value pairs of one config are expanded to environment variables.
Goals
Separate config and workload such that the same workload can be used with different configurations. That allows also updating the config separately from the workload.
Final result
Summary
To be filled when the final solution is sketched.
Tasks
- [x] Add configuration object to DesiredState
- [ ] Use template engine when starting a workload
- [ ] Update workload if an update of the configuration object changes the workload