Skip to content

Commit

Permalink
GKE storage class optional
Browse files Browse the repository at this point in the history
  • Loading branch information
keegansmith21 committed Oct 2, 2024
1 parent 3178ed5 commit 63757ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions observatory_platform/google/gke.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ def gke_make_container_resources(default: dict, override: Optional[dict]) -> V1R
return V1ResourceRequirements(requests=resource, limits=resource)


def gke_create_volume(*, kubernetes_conn_id: str, volume_name: str, size_gi: int) -> None:
def gke_create_volume(
*, kubernetes_conn_id: str, volume_name: str, size_gi: int, storage_class: str = "standard"
) -> None:
"""Creates a GKE volume
:param kubernetes_conn_id:
Expand All @@ -149,7 +151,7 @@ def gke_create_volume(*, kubernetes_conn_id: str, volume_name: str, size_gi: int
spec=client.V1PersistentVolumeClaimSpec(
access_modes=["ReadWriteOnce"],
resources=client.V1ResourceRequirements(requests=capacity),
storage_class_name="standard",
storage_class_name=storage_class,
),
)
v1.create_namespaced_persistent_volume_claim(namespace=namespace, body=pvc)
Expand Down

0 comments on commit 63757ed

Please sign in to comment.