[FLINK-34565] Enhance flink kubernetes configMap to accommodate additional configuration files #24428
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
The purpose of this change is to empower users to effortlessly add additional files to the Flink ConfigMap, essential for running jobs in app mode on Kubernetes. Currently, the Flink Kubernetes client supports only a fixed set of files (flink-conf.yaml, logback-console.xml, log4j-console.properties) in the ConfigMap for JobManager and TaskManager Pods. However, in certain scenarios, users may need to include extra configuration files, such as user-defined job properties. Without this change, users are forced to employ workarounds, like manually creating and mounting ConfigMaps or Secrets, to incorporate dynamic configuration files into the JobManager and TaskManager Pods.
In my case, I aim to include log4j-cli.properties (for running specific Flink commands on each pod) and hive-site.xml (for metastore). A similar use case was discussed on the user mailing list: link to the mailing list thread
Brief change log
The method FlinkConfMountDecorator#getLocalLogConfFiles() provides a fixed set of files that need to be included in the ConfigMap. I have modified this method to incorporate an additional set of files, which is configured through the new property 'kubernetes.flink.configmap.additional.resources'. This property allows users to specify a semicolon-separated list of local files in the client Flink config directory that should be included in the Flink ConfigMap.
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation