Skip to content

Commit

Permalink
Trying the kube python lib
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasHerve committed Mar 28, 2024
1 parent ea93dba commit 79d7373
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/app/handlers/core.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import hug
from kubernetes import client, config

@hug.post('/create-room')
def create_room():
return ""
config.load_kube_config(config_file='./kubernetes-config')
v1 = client.CoreV1Api()
print("Listing pods with their IPs:")
ret = v1.list_pod_for_all_namespaces(watch=False)
for i in ret.items:
print("%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name))
return ret.items[0].metadata.name

@hug.post('/delete-room')
def delete_room(body):
Expand Down

0 comments on commit 79d7373

Please sign in to comment.