eladkal commented on PR #33680: URL: https://github.com/apache/airflow/pull/33680#issuecomment-1692387871
> > Yes my idea was a bit different. > > I was after: > > k = KubernetesPodOperator( > > namespace="default", > > image="ubuntu:16.04", > > cmds=["bash", "-cx"], > > arguments=["echo", "10"], > > connection_secrets=['postgres_default'], > > task_id="task", > > ) > > That is what I do in my custom KPO operator, where it takes a list of (connection_id, env_var_prefix) as argument, and it creates a single secret in runtime and mounts the secret using `deploy_type=env`, for the secrets names, I use `<env_var_prefix>_LOGIN`, `<env_var_prefix>_PASSWORD`, ... and all these fields are available in my pod as environment variables. At the end of the execution this secret is deleted using the cleanup or on_kill method. Almost exactly like me. I did have issues with cleanup but I guess because I deployed on celery. If worker died the cleanup code was never executed so I had to do manual cleanup from time to time. So if we both do the same we never talked about this before.. i guess that is a good approach :) -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
