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_r355999940
##########
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:
Is there any reason why we couldn't have both file and config options work?
Do you just think it would be to confusing?
If both aren't supported then I would feel happier if we validated the
config at `airflow` start time so and raised an error then if conflicting
config options are given.
----------------------------------------------------------------
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