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
623 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,467 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,060 points
2,755 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,060 points
13,849 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,350 points
504 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
15,477 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 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
2,190 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,372 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