prototype fo namespace import
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s

This commit is contained in:
2026-06-11 11:51:12 +01:00
parent 2b8a4ed46f
commit 1c04605dc7
@@ -43,6 +43,15 @@ def scale_down(request,namespace_name,deploy_name):
return render(request, 'shutdown.html', return render(request, 'shutdown.html',
{'namespace': namespace_name, 'deployment': deploy_name, 'url': 'https://namespace.com'}) {'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): def nodes(request):
config.load_kube_config(config_file='/code/kubeconfig') config.load_kube_config(config_file='/code/kubeconfig')
v1 = client.CoreV1Api() v1 = client.CoreV1Api()