ashb commented on a change in pull request #6230: [AIRFLOW-5413] Allow K8S
worker pod to be configured from JSON/YAML file
URL: https://github.com/apache/airflow/pull/6230#discussion_r357558554
##########
File path: airflow/kubernetes/worker_configuration.py
##########
@@ -389,11 +386,14 @@ def make_pod(self, namespace, worker_uuid, pod_id,
dag_id, task_id, execution_da
envs=self._get_environment(),
node_selectors=self.kube_config.kube_node_selectors,
service_account_name=self.kube_config.worker_service_account_name,
- )
+ pod_template_file_or_string=self.kube_config.pod_template_file
+ ).gen_pod()
- pod = pod_generator.gen_pod()
- pod.spec.containers[0].env_from = pod.spec.containers[0].env_from or []
- pod.spec.containers[0].env_from.extend(self._get_env_from())
- pod.spec.security_context = self._get_security_context()
+ if self.kube_config.pod_template_file:
Review comment:
The behavoir I was wanting to guard against is when `pod_template_file` is
set in the config, and then someone comes along and sets, say
`AIRFLOW__KUBERNETES__WORKER_CONTAINER_TAG` thinking "I know, I just want to
test this one tag, that's easier than editing the file".
I'd like that either to work (where pod template file is base, and then any
config option set takes precenedece over the file), or for it to error. The
thing I don't want to happen is the setting to be ignored silently causing
hard-to-debug "why isn't that config option working!" rage.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services