Skip to content

Commit

Permalink
don't create persistent volume manually
Browse files Browse the repository at this point in the history
  • Loading branch information
keegansmith21 committed Jul 4, 2024
1 parent a4fa9b3 commit 0b45c25
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions observatory_platform/google/gke.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ def gke_create_volume(*, kubernetes_conn_id: str, volume_name: str, size_gi: int

# Create the PersistentVolume
capacity = {"storage": f"{size_gi}Gi"}
pv = client.V1PersistentVolume(
api_version="v1",
kind="PersistentVolume",
metadata=client.V1ObjectMeta(
name=volume_name,
# TODO: supposed to use this user for the persistent volume but doesn't seem to do anything
# annotations={"pv.beta.kubernetes.io/uid": f"{uid}", "pv.beta.kubernetes.io/gid": f"{uid}"}
),
spec=client.V1PersistentVolumeSpec(
capacity=capacity,
access_modes=["ReadWriteOnce"],
persistent_volume_reclaim_policy="Retain",
storage_class_name="standard",
gce_persistent_disk=client.V1GCEPersistentDiskVolumeSource(pd_name=volume_name),
),
)
v1.create_persistent_volume(body=pv)
# pv = client.V1PersistentVolume(
# api_version="v1",
# kind="PersistentVolume",
# metadata=client.V1ObjectMeta(
# name=volume_name,
# # TODO: supposed to use this user for the persistent volume but doesn't seem to do anything
# # annotations={"pv.beta.kubernetes.io/uid": f"{uid}", "pv.beta.kubernetes.io/gid": f"{uid}"}
# ),
# spec=client.V1PersistentVolumeSpec(
# capacity=capacity,
# access_modes=["ReadWriteOnce"],
# persistent_volume_reclaim_policy="Retain",
# storage_class_name="standard",
# gce_persistent_disk=client.V1GCEPersistentDiskVolumeSource(pd_name=volume_name),
# ),
# )
# v1.create_persistent_volume(body=pv)

# Create PersistentVolumeClaim
namespace = hook.get_namespace()
Expand Down

0 comments on commit 0b45c25

Please sign in to comment.