Kubernetes container scaling

0 votes
I have multiple containers in a deployment file.could you please explain how do I scale all those containers?
Jul 18, 2019 in Kubernetes by Liana
450 views

1 answer to this question.

0 votes

Hey @ Liana, You could use Horizontal Pod Autoscaler for this purpose.

  • It would scale all of them, internally the deployment creates a replica set (which does the scaling), and then a set number of pods are made by that replica set. 

  • The pod is what actually holds both of those containers. and if you want to scale them independently they should be separate pods (and therefore replica sets, deployments, etc).

  • So for Horizontal Pod Autoscaler to work you need to specify min and max replicas  and the threshold what percentage of cpu and memory you want your pods to autoscale..without having the manually run kubectl autoscale deployment.

  • you can use the below yaml file to do the same.

apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
annotations:
name: app
spec:
maxReplicas: 15
minReplicas: 10
scaleTargetRef:
apiVersion: autoscaling/v1
kind: Deployment
name: app targetCPUUtilizationPercentage: 70

answered Jul 18, 2019 by Sirajul
• 59,230 points

Related Questions In Kubernetes

0 votes
1 answer

How to use gravitational teleport in a container/kubernetes environment?

You can use teleport to augment kubernetes ...READ MORE

answered Jun 28, 2018 in Kubernetes by ajs3033
• 7,300 points
2,226 views
0 votes
2 answers

Access Kubernetes api from within a pod container

wget version: KUBE_TOKEN=$(</var/run/secrets/kubernetes.io/serviceaccount/token) wget -vO- ...READ MORE

answered Aug 29, 2018 in Kubernetes by Nilesh
• 7,050 points
2,402 views
0 votes
2 answers

keep container running on Kubernetes

Try using this CMD in your Dockerfile: CMD exec /bin/bash ...READ MORE

answered Aug 30, 2018 in Kubernetes by Nilesh
• 7,050 points
13,149 views
0 votes
1 answer

kubernetes rollout triggered on scaling

when you update the pod template, the ...READ MORE

answered Sep 4, 2018 in Kubernetes by Kalgi
• 52,360 points
351 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
14,589 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,075 views
0 votes
1 answer

What are the container hooks available in kubernetes?

The hooks enable Containers to be aware ...READ MORE

answered Jul 15, 2019 in Kubernetes by Sirajul
• 59,230 points
1,900 views
0 votes
1 answer

Kubernetes: What are the types of multi-container pod patterns?

Here are the different types of multi-container ...READ MORE

answered Jul 17, 2019 in Kubernetes by Sirajul
• 59,230 points
2,024 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP