Add a "Resize" button to the deploy board
Problem to solve
A user may want to scaled up/down. It would be nice to allow this from the deploy board where he/she are following the deployments and can take action according to what they see on the board.
Intended users
Further details
A use case for scaling Below example shows how you should scale up/down your "pods/resource/deployments".
k8smaster@k8smaster:~/debashish$ more createdeb_deployment1.yaml
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: debdeploy-webserver
spec:
replicas: 1
selector:
matchLabels:
app: debdeploy1webserver
template:
metadata:
labels:
app: debdeploy1webserver
spec:
containers:
-
image: "docker.io/debu3645/debapachewebserver:v1"
name: deb-deploy1-container
ports:
-
containerPort: 6060
deployment created -->
**kubectl -n debns1 create -f createdeb_deployment1.yaml**
k8smaster@k8smaster:~/debashish$
kubectl scale --replicas=5 deployment/debdeploy-webserver -n debns1``
(Scale up 5 deployments)
k8smaster@k8smaster:~/debashish$ kubectl get pods -n debns1
NAME READY STATUS RESTARTS AGE
debdeploy-webserver-7cf4fb74c5-8wvzx 1/1 Running 0 16s
debdeploy-webserver-7cf4fb74c5-jrf6v 1/1 Running 0 16s
debdeploy-webserver-7cf4fb74c5-m9fpw 1/1 Running 0 16s
debdeploy-webserver-7cf4fb74c5-q9n7r 1/1 Running 0 16s
debdeploy-webserver-7cf4fb74c5-ttw6p 1/1 Running 1 19h
resourcepod-deb1 1/1 Running 5 6d18h
k8smaster@k8smaster:~/debashish$ **kubectl get ep -n debns1**
NAME ENDPOINTS AGE
frontend-svc-deb 192.168.1.10:80,192.168.1.11:80,192.168.1.12:80 + 2 more... 18h
frontend-svc1-deb 192.168.1.8:80 14d
frontend-svc2-deb 192.168.1.8:80 5d19h
k8smaster@k8smaster:~/debashish$ **kubectl scale --replicas=2** deployment/debdeploy-webserver -n debns1
(Scale down from 5 to 2)
deployment.extensions/debdeploy-webserver scaled
k8smaster@k8smaster:~/debashish$ **kubectl get pods -n debns1**
NAME READY STATUS RESTARTS AGE
debdeploy-webserver-7cf4fb74c5-8wvzx 1/1 Terminating 0 35m
debdeploy-webserver-7cf4fb74c5-jrf6v 1/1 Terminating 0 35m
debdeploy-webserver-7cf4fb74c5-m9fpw 1/1 Terminating 0 35m
debdeploy-webserver-7cf4fb74c5-q9n7r 1/1 Running 0 35m
debdeploy-webserver-7cf4fb74c5-ttw6p 1/1 Running 1 19h
resourcepod-deb1 1/1 Running 5 6d19h
k8smaster@k8smaster:~/debashish$ **kubectl get pods -n debns1**
NAME READY STATUS RESTARTS AGE
debdeploy-webserver-7cf4fb74c5-q9n7r 1/1 Running 0 37m
debdeploy-webserver-7cf4fb74c5-ttw6p 1/1 Running 1 19h
resourcepod-deb1 1/1 Running 5 6d19h
k8smaster@k8smaster:~/debashish$ kubectl **scale --current-replicas=4 --replicas=2** deployment/debdeploy-webserver -n debns1
(Check the current no. of deployments. If current replication is 4, then bring it down to 2, else dont do anything)
error: Expected replicas to be 4, was 2
k8smaster@k8smaster:~/debashish$ **kubectl scale --current-replicas=3 --replicas=10 deployment/debdeploy-webserver -n debns1**
error: Expected replicas to be 3, was 2
k8smaster@k8smaster:~/debashish$ **kubectl scale --current-replicas=2 --replicas=10 deployment/debdeploy-webserver -n debns1**
deployment.extensions/debdeploy-webserver scaled
k8smaster@k8smaster:~/debashish$ **kubectl get pods -n debns1**
NAME READY STATUS RESTARTS AGE
debdeploy-webserver-7cf4fb74c5-46bxg 1/1 Running 0 6s
debdeploy-webserver-7cf4fb74c5-d6qsx 0/1 ContainerCreating 0 6s
debdeploy-webserver-7cf4fb74c5-fdq6v 1/1 Running 0 6s
debdeploy-webserver-7cf4fb74c5-gd87t 1/1 Running 0 6s
debdeploy-webserver-7cf4fb74c5-kqdbj 0/1 ContainerCreating 0 6s
debdeploy-webserver-7cf4fb74c5-q9n7r 1/1 Running 0 47m
debdeploy-webserver-7cf4fb74c5-qjvm6 1/1 Running 0 6s
debdeploy-webserver-7cf4fb74c5-skxq4 0/1 ContainerCreating 0 6s
debdeploy-webserver-7cf4fb74c5-ttw6p 1/1 Running 1 19h
debdeploy-webserver-7cf4fb74c5-wlc7q 0/1 ContainerCreating 0 6s
resourcepod-deb1 1/1 Running 5 6d1
Proposal
Allow the user to manually resize the pod scaling directly from the deploy board
What it will actually do is:
kubectl scale --replicas=<expected_replica_num> deployment <deployment_label_name>
Example
# kubectl scale --replicas=3 deployment xyz
Permissions and Security
Documentation
Availability & Testing
What does success look like, and how can we measure that?
What is the type of buyer?
Links / references
https://stackoverflow.com/questions/38344896/kubernetes-how-to-scale-my-pods
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.