Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing volume claim to user-container example #1242

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion docs/examples/workflows/misc/user_container.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
```
Expand Down Expand Up @@ -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
```

9 changes: 9 additions & 0 deletions examples/workflows/misc/user-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,12 @@ spec:
volumeMounts:
- mountPath: /whatever
name: something
volumeClaimTemplates:
- metadata:
name: something
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 64Mi
14 changes: 13 additions & 1 deletion examples/workflows/misc/user_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Loading