Skip to content

Commit

Permalink
fix: add podinfo volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeAeich committed Sep 5, 2024
1 parent 06602d1 commit 3fa2eca
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion tesk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
from foca import Foca
from kubernetes.client.models import (
V1Container,
V1DownwardAPIVolumeFile,
V1DownwardAPIVolumeSource,
V1EnvVar,
V1EnvVarSource,
V1Job,
V1JobSpec,
V1ObjectFieldSelector,
V1ObjectMeta,
V1PodSpec,
V1PodTemplateSpec,
V1SecretKeySelector,
V1Volume,
V1VolumeMount,
)

Expand Down Expand Up @@ -118,7 +122,27 @@ def get_taskmaster_template() -> V1Job:
],
)
],
volumes=[],
volumes=[
V1Volume(
name="podinfo",
downward_api=V1DownwardAPIVolumeSource(
items=[
V1DownwardAPIVolumeFile(
path="labels",
field_ref=V1ObjectFieldSelector(
field_path="metadata.labels"
),
),
V1DownwardAPIVolumeFile(
path="annotations",
field_ref=V1ObjectFieldSelector(
field_path="metadata.annotations"
),
),
]
),
),
],
restart_policy=TeskK8sConstants.k8s_constants.JOB_RESTART_POLICY,
),
)
Expand Down

0 comments on commit 3fa2eca

Please sign in to comment.