Suraj Narwade
08/17/2021, 2:55 PMdagster-infra
namespace and I installed user deployment & configured job namespace in the dagster-user
namespace.
Along with this, I populated Postgresql credentials secret in both the namespace as required.
my pipeline example reads environment variable which comes from the secret.
for example name of k8s secret my pipeline example needs is topsecret
which is present in the dagster-user
namespace & also updated in dagster-instance configmap as env_secrets
in the dagster-user namespace itself.
now with this setup ideally my job pod should get the secret injected but it is not.
though it works when I update the dagster-instance configmap from the dagster-infra
namespace which is consumed by daemon with the same env_secrets
after doing that I've noticed these secrets gets appended into user deployments as well as jobs.
based on this, I've the following questions:
• Why does the daemon need to know about secrets?
• Why does user deployment gets the secrets injected?
• is there any other way to tell daemon that my pipeline needs the given secret?daniel
08/17/2021, 3:07 PMrunLauncher:
config:
k8sRunLauncher:
envSecrets:
- name: your-secret-name-here
If you set that config, are you still not seeing your secret available in the pod for the launched run?Suraj Narwade
08/17/2021, 3:11 PMyour-secret-name-here
name of the envSecrets that job pod needsdaniel
08/17/2021, 3:12 PMSuraj Narwade
08/17/2021, 3:14 PMenvSecrets
I can't achieve thatdaniel
08/17/2021, 3:16 PMSuraj Narwade
08/17/2021, 3:20 PMenvSecrets:
- secretA
- secretB
daniel
08/17/2021, 3:24 PMSuraj Narwade
08/17/2021, 3:28 PMdaniel
08/17/2021, 3:49 PMSuraj Narwade
08/18/2021, 7:49 AMdaniel
08/18/2021, 1:11 PMSuraj Narwade
08/18/2021, 1:22 PMdaniel
08/18/2021, 1:30 PMSuraj Narwade
08/18/2021, 1:31 PM@pipeline(
tags = {
'dagster-k8s/config': {
'container_config': {
'envFrom': [{ 'secretRef': 'test-user-deployment-env-secret' }],
},
},
},
)
def hello_pipeline():
hello(get_name())
TypeError: __init__() got an unexpected keyword argument 'envFrom'
File "/usr/local/lib/python3.7/site-packages/dagster_graphql/implementation/utils.py", line 27, in _fn
return fn(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 16, in launch_pipeline_execution
return _launch_pipeline_execution(graphene_info, execution_params)
File "/usr/local/lib/python3.7/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 49, in _launch_pipeline_execution
run = do_launch(graphene_info, execution_params, is_reexecuted)
File "/usr/local/lib/python3.7/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 37, in do_launch
pipeline_run.run_id, external_pipeline=external_pipeline
File "/usr/local/lib/python3.7/site-packages/dagster/core/instance/__init__.py", line 1265, in submit_run
run, external_pipeline=external_pipeline
File "/usr/local/lib/python3.7/site-packages/dagster/core/run_coordinator/default_run_coordinator.py", line 34, in submit_run
return self._instance.launch_run(pipeline_run.run_id, external_pipeline)
File "/usr/local/lib/python3.7/site-packages/dagster/core/instance/__init__.py", line 1322, in launch_run
self._run_launcher.launch_run(run, external_pipeline=external_pipeline)
File "/usr/local/lib/python3.7/site-packages/dagster_k8s/launcher.py", line 254, in launch_run
user_defined_k8s_config=user_defined_k8s_config,
File "/usr/local/lib/python3.7/site-packages/dagster_k8s/job.py", line 471, in construct_dagster_k8s_job
**user_defined_k8s_config.container_config,
daniel
08/18/2021, 2:39 PMSuraj Narwade
08/18/2021, 2:40 PM@pipeline(
tags = {
'dagster-k8s/config': {
'container_config': {
'env_from': [{ 'secret_ref': 'test-user-deployment-env-secret' }],
},
},
},
)
def hello_pipeline():
hello(get_name())
KeyError: 'env_from'
File "/usr/local/lib/python3.7/site-packages/dagster_graphql/implementation/utils.py", line 27, in _fn
return fn(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 16, in launch_pipeline_execution
return _launch_pipeline_execution(graphene_info, execution_params)
File "/usr/local/lib/python3.7/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 49, in _launch_pipeline_execution
run = do_launch(graphene_info, execution_params, is_reexecuted)
File "/usr/local/lib/python3.7/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 37, in do_launch
pipeline_run.run_id, external_pipeline=external_pipeline
File "/usr/local/lib/python3.7/site-packages/dagster/core/instance/__init__.py", line 1265, in submit_run
run, external_pipeline=external_pipeline
File "/usr/local/lib/python3.7/site-packages/dagster/core/run_coordinator/default_run_coordinator.py", line 34, in submit_run
return self._instance.launch_run(pipeline_run.run_id, external_pipeline)
File "/usr/local/lib/python3.7/site-packages/dagster/core/instance/__init__.py", line 1322, in launch_run
self._run_launcher.launch_run(run, external_pipeline=external_pipeline)
File "/usr/local/lib/python3.7/site-packages/dagster_k8s/launcher.py", line 254, in launch_run
user_defined_k8s_config=user_defined_k8s_config,
File "/usr/local/lib/python3.7/site-packages/dagster_k8s/job.py", line 471, in construct_dagster_k8s_job
**user_defined_k8s_config.container_config,
daniel
08/18/2021, 3:05 PMSuraj Narwade
08/18/2021, 3:11 PMdaniel
08/18/2021, 3:13 PMSuraj Narwade
08/18/2021, 3:14 PMdaniel
08/18/2021, 4:18 PMSuraj Narwade
08/20/2021, 7:37 AM