Skip to content

Commit

Permalink
debugging volume claims
Browse files Browse the repository at this point in the history
  • Loading branch information
keegansmith21 committed Jul 5, 2024
1 parent e07f73b commit 8af435e
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions observatory_platform/google/gke.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,11 @@ 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)

# Create PersistentVolumeClaim
namespace = hook.get_namespace()
namespace = "coki-astro"
print("HOOK: {hook}")
print(f"HOOK: {hook}")
pvc = client.V1PersistentVolumeClaim(
api_version="v1",
kind="PersistentVolumeClaim",
Expand All @@ -67,7 +50,8 @@ def gke_create_volume(*, kubernetes_conn_id: str, volume_name: str, size_gi: int
storage_class_name="standard",
),
)
v1.create_namespaced_persistent_volume_claim(namespace=namespace, body=pvc)
r = v1.create_namespaced_persistent_volume_claim(namespace=namespace, body=pvc)
print(r)


def gke_delete_volume(*, kubernetes_conn_id: str, volume_name: str):
Expand Down

0 comments on commit 8af435e

Please sign in to comment.