flink-on-k8s-operator
flink-on-k8s-operator copied to clipboard
Add flinkPropertiesSecret for supporting secret properties
Background
Add possibilities for mounting secret properties from Secret.
Resolves #383
Implementation strategy
As @shashken described at https://github.com/GoogleCloudPlatform/flink-on-k8s-operator/issues/383#issuecomment-747453395,
Use flinkPropertiesSecret option in CRD and mount the entire properties into a Secret like @functicons suggested.
- If
flinkPropertiesSecretset,- Create the config directory to be an emptyDir with a memory medium.
- Create an init container that copies config files in
ConfigMapto config directory since mounting specific file fromemptyDiris not possible. - Write secrets to
/opt/flink/conf/flink-conf.yaml - Config directory will be
readonlymounted to main containers as same as currentConfigMapimplementation.
- Or not, mount
ConfigMapas config volume like as-is.
Limitations
- Config keys can be duplicated
- As @chrispatmore mentioned (https://github.com/GoogleCloudPlatform/flink-on-k8s-operator/issues/383#issuecomment-747643831), we cannot react to
ConfigMapupdates without restarting the pod