diff --git a/docs/examples/workflows/misc/user_container.md b/docs/examples/workflows/misc/user_container.md index 7884f0c1..e2af4bfa 100644 --- a/docs/examples/workflows/misc/user_container.md +++ b/docs/examples/workflows/misc/user_container.md @@ -26,7 +26,19 @@ This example showcases the user of a user container with a volume mount. print("hi") - with Workflow(generate_name="sidecar-volume-mount-", entrypoint="d") as w: + with Workflow( + generate_name="sidecar-volume-mount-", + entrypoint="d", + volume_claim_templates=[ + m.PersistentVolumeClaim( + metadata=m.ObjectMeta(name="something"), + spec=m.PersistentVolumeClaimSpec( + access_modes=["ReadWriteOnce"], + resources=m.ResourceRequirements(requests={"storage": "64Mi"}), + ), + ) + ], + ) as w: with DAG(name="d"): foo() ``` @@ -61,5 +73,14 @@ This example showcases the user of a user container with a volume mount. volumeMounts: - mountPath: /whatever name: something + volumeClaimTemplates: + - metadata: + name: something + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 64Mi ``` diff --git a/examples/workflows/misc/user-container.yaml b/examples/workflows/misc/user-container.yaml index e3330cee..dafcc02e 100644 --- a/examples/workflows/misc/user-container.yaml +++ b/examples/workflows/misc/user-container.yaml @@ -25,3 +25,12 @@ spec: volumeMounts: - mountPath: /whatever name: something + volumeClaimTemplates: + - metadata: + name: something + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 64Mi diff --git a/examples/workflows/misc/user_container.py b/examples/workflows/misc/user_container.py index 39c9e6d1..c587ad9a 100644 --- a/examples/workflows/misc/user_container.py +++ b/examples/workflows/misc/user_container.py @@ -18,6 +18,18 @@ def foo(): print("hi") -with Workflow(generate_name="sidecar-volume-mount-", entrypoint="d") as w: +with Workflow( + generate_name="sidecar-volume-mount-", + entrypoint="d", + volume_claim_templates=[ + m.PersistentVolumeClaim( + metadata=m.ObjectMeta(name="something"), + spec=m.PersistentVolumeClaimSpec( + access_modes=["ReadWriteOnce"], + resources=m.ResourceRequirements(requests={"storage": "64Mi"}), + ), + ) + ], +) as w: with DAG(name="d"): foo()