Hello! I am trying to run a job with the followin...
# deployment-kubernetes
j
Hello! I am trying to run a job with the following custom k8s configuration.
Copy code
{    "dagster-k8s/config": {
        'job_config': {
            "volumes": [
                {"name": "volume1", "secret": {"secret_name": "volume1"}},
                {"name": "volume2", "secret": {"secret_name": "volume2"}},
                {"name": "volume3", "secret": {"secret_name": "volume3"}},
            ],
            "volumes_mounts": [
                {"name": "volume1", "mountPath": "volumemount1"},
                {"name": "volume2", "mountPath": "volumemount2"},
                {"name": "volume3", "mountPath": "volumemount3"},
        ],}
        }

}
I am not able to mount volume even though apparently in the source code it is possible to mount volumes
d
Hi Javier - I see a “volumes_mounts” key there - should that be “volume_mounts”?
j
yeah sorry I correct this bit and I still have the same error
d
what is the error?
j
it returns the following
Python Error: "volumes" key not found
or
"volume_mounts" key not found
I am triggering the pipeline from the python graphql sdk
d
Yeah, so this gets a bit confusing, but in a k8s job the volumes go on the pod spec and the volume mounts go on the container (neither of them go on the k8s job, which is what job_config affects). I think what you want is something like:
Copy code
{    "dagster-k8s/config": {
        'pod_spec_config': {
            "volumes": [
                {"name": "volume1", "secret": {"secretName": "volume1"}},
                {"name": "volume2", "secret": {"secretName": "volume2"}},
                {"name": "volume3", "secret": {"secretName": "volume3"}},
            ],
        },
        "container_config": {
            "volume_mounts": [
                {"name": "volume1", "mountPath": "volumemount1"},
                {"name": "volume2", "mountPath": "volumemount2"},
                {"name": "volume3", "mountPath": "volumemount3"},
        ],}
        }

}
(I also changed secret_name to secretName)
@Dagster Bot docs add example of setting volumes via dagster-k8s/config tag
d
j
I like this bot Daniel
👌 1
I can work on this issue
🙏 1
It was a bit confusing because in the source code seems that inherits was the job_config
d