Pod naming ignores dashes and underscores
See original GitHub issueApache Airflow version: 2.0.2
Kubernetes version (if you are using Kubernetes) (use kubectl version
):
Client Version: version.Info{Major:“1”, Minor:“19”, GitVersion:“v1.19.11”, GitCommit:“c6a2f08fc4378c5381dd948d9ad9d1080e3e6b33”, GitTreeState:“clean”, BuildDate:“2021-05-12T12:27:07Z”, GoVersion:“go1.15.12”, Compiler:“gc”, Platform:“darwin/amd64”}
Server Version: version.Info{Major:“1”, Minor:“19+”, GitVersion:“v1.19.10-gke.1600”, GitCommit:“7b8e568a7fb4c9d199c2ba29a5f7d76f6b4341c2”, GitTreeState:“clean”, BuildDate:“2021-05-07T09:18:53Z”, GoVersion:“go1.15.10b5”, Compiler:“gc”, Platform:“linux/amd64”}
What happened:
I am running Airflow within GKE, one pod, a git-sync container for dags, two containers (same image) for the webserver and scheduler. I utilize Kubernetes Executor and Kubernetes Pod Operators. When I run task I see pod with the name matching the pattern dag_idtask_id.hash
. But this naming ignores dashes and underscores. Example, dag_id='inititializer_prefix'
, and task_id='job_prefix'
. In kubectl get pods
I see initializerprefixjobprefix.6d5191b91782409082d46dd3b0ea97f9
What you expected to happen:
I expect executor pod to have name like initializer_prefixjob_prefix.6d5191b91782409082d46dd3b0ea97f9
at least, or initializer_prefix_job_prefix.6d5191b91782409082d46dd3b0ea97f9
(autoseparation of dag_id
and task_id
by underscore)
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Pod names need to be valid DNS labels, and so can’t have underscores in them anyway https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names.
We could make it more legabile by having
_
->-
, and then also separating as OP suggestesThe docstring seems to suggest the original author knew, but didn’t want to deal with edge cases in the rules, and just took the simplest route by removing everything.