From 1c04605dc757ea63fac2c1dc1bc333e79eab6879 Mon Sep 17 00:00:00 2001 From: pierregeeraert Date: Thu, 11 Jun 2026 11:51:12 +0100 Subject: [PATCH] prototype fo namespace import --- django_code/kubernetes_connection/apps.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/django_code/kubernetes_connection/apps.py b/django_code/kubernetes_connection/apps.py index d196c88..776eda0 100644 --- a/django_code/kubernetes_connection/apps.py +++ b/django_code/kubernetes_connection/apps.py @@ -43,6 +43,15 @@ def scale_down(request,namespace_name,deploy_name): return render(request, 'shutdown.html', {'namespace': namespace_name, 'deployment': deploy_name, 'url': 'https://namespace.com'}) +def Import_Deployments(): + config.load_kube_config(config_file='/kubeconfig/config') + deployment = api.list_namespaced_deployment('servarr') + len(deployment.items) #list all deployment inside the namespace + test.items[0].spec.template.spec.containers[0].name # name the first deploy within the namespace + test.items[2].spec.template.spec.containers[0].name # name the third deploy within the namespace + return 0 + + def nodes(request): config.load_kube_config(config_file='/code/kubeconfig') v1 = client.CoreV1Api()