iwilltry42 edited a comment on issue #4589: [AIRFLOW-3766] Add support for kubernetes annotations URL: https://github.com/apache/airflow/pull/4589#issuecomment-468574296 @feng-tao this is definitely a good thing, but it won't help in that case. Let me expand on this a little bit: I am using the [sidecar-injector](https://github.com/tumblr/k8s-sidecar-injector/), which requests an injection config using an annotation on pods like this: `"injector.tumblr.com/request": "sidecar-test"`. That way, I can inject e.g. a kerberos sidecar into each pod that's being created by the KubernetesExecutor. So I put this into the `airflow.cfg` under the `[kubernetes_annotations]` section: `injector.tumblr.com/request = sidecar-test`. This works just fine. Now if I want to define this in an environment variable like all the other config options, then it will fail, as `AIRFLOW__KUBERNETES_ANNOTATIONS__INJECTOR.TUMBLR.COM/REQUEST: sidecar-test` is not a valid environment variable (and also not a valid ConfigMap key) because of the `/` it contains. The error message for the Kubernetes deployment (using stable/airflow helm chart) when putting it into the ConfigMap: > Invalid value: "AIRFLOW__KUBERNETES_ANNOTATIONS__INJECTOR.TUMBLR.COM/REQUEST": a valid config key must consist of alphanumeric characters, '-', '_' or '.' (e.g. 'key.name', or 'KEY_NAME', or 'key-name', regex used for validation is '[-._a-zA-Z0-9]+') And when putting it directly into an env var: > Invalid value: "AIRFLOW__KUBERNETES_ANNOTATIONS__INJECTOR.TUMBLR.COM/REQUEST": a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*') Maybe there's room for a char-sequence substitution? As the `/` in annotations is a very common thing?
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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
