add scale down as well and remove debug
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 55s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 55s
This commit is contained in:
Binary file not shown.
@@ -24,6 +24,16 @@ def scale_up(request,namespace_name,deploy_name):
|
||||
name=deploy_name, namespace=namespace_name, body=deployment);
|
||||
return HttpResponse('<h1>Scaled up !</h1>')
|
||||
|
||||
|
||||
def scale_down(request,namespace_name,deploy_name):
|
||||
config.load_kube_config(config_file='/code/kubeconfig')
|
||||
api = client.AppsV1Api()
|
||||
deployment = api.read_namespaced_deployment(name=deploy_name, namespace=namespace_name)
|
||||
deployment.spec.replicas = 0
|
||||
resp = api.patch_namespaced_deployment(
|
||||
name=deploy_name, namespace=namespace_name, body=deployment);
|
||||
return HttpResponse('<h1>Scaled down !</h1>')
|
||||
|
||||
def nodes(request):
|
||||
config.load_kube_config(config_file='/code/kubeconfig')
|
||||
v1 = client.CoreV1Api()
|
||||
|
||||
Reference in New Issue
Block a user