new version with the scale Up option
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 59s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 59s
This commit is contained in:
@@ -15,6 +15,14 @@ import yaml
|
||||
def hello(request):
|
||||
return HttpResponse('<h1>Hello k8s!</h1>')
|
||||
|
||||
def scale_up(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 = 2
|
||||
resp = api.patch_namespaced_deployment(
|
||||
name=deploy_name, namespace=namespace_name, body=deployment);
|
||||
return HttpResponse('<h1>Scaled up !</h1>')
|
||||
|
||||
def nodes(request):
|
||||
config.load_kube_config(config_file='/code/kubeconfig')
|
||||
|
||||
Reference in New Issue
Block a user