2

For the needs of a project i have created 2 Kubernetes clusters on GKE.

Cluster 1: 10 containers in one Pod

Cluster 2: 10 containers in 10 different Pods

All containers are connected and constitute an application.

What i would like to do is to generate some load and observe how the vpa will autoscale the containers..

Until now, using the "Auto" mode i have noticed that VPA changes values only once, at the begin and not while i generate load and that the Upper Bound is soo high, so it doesn't need any change!

Would you suggest me:

1) to use Auto or Recommendation mode?

and

2) to create 1 or 2 replicas of my application?

Also i would like to say that 2 of 10 containers is mysql and mongoDB . So if i have to create 2 replicas, i should use statefulsets or operators, right?

Thank you very much!!

sofi
  • 71
  • 5

1 Answers1

1

Not sure you mean it when you say this

Cluster 1: 10 containers in one Pod

Cluster 2: 10 containers in different Pods

At very first you are not following best practice, ideally, you should be keeping the single container in a single POD

Running 10 containers in one pod that too much, if there is interdependency your code should be using the K8s service name to connect to each other.

to create 1 or 2 replicas of my application?

Yes, that would be always better to run multiple replicas of the application so if due to anything even node goes down your POD on another node would be running.

Also i would like to say that 2 of 10 containers is mysql and mongoDB . So if i have to create 2 replicas, i should use statefulsets or operators, right?

You can use the operators and stateful sets both no in it, it's possible operator idally create the stateful sets.

Implementing the replication of MySQL across the replicas would be hard manually unless you have good experience as DBA and you are aware.

While with operator you will get the benefit both auto backup, replication auto management and other such things.

Operators indirectly creates the stateful set or deployment but you won't have to manage much and worry about the replication and failover planning and DB strategy.

Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
  • Thank you for your answer!! I know that it's not the best practise, but it's just to check this case and yes, all containers are connected with services. Would you suggest me to use "Auto" or "Recommendation" update mode? – sofi Oct 10 '21 at 18:09
  • 1
    ideally, you should be using the HPA for increasing the sudden traffic when you are generating the load. VPA is for of stable setup when your cluster is scaling down and you have over-committed memory and all. To run ideal VPA and HPA config also you need you need multiple replicas any how. – Harsh Manvar Oct 10 '21 at 18:13
  • 1
    you can set mode based on your requirement how you want actually to work. you should read limitation also at very first : https://cloud.google.com/kubernetes-engine/docs/concepts/verticalpodautoscaler#limitations – Harsh Manvar Oct 10 '21 at 18:13
  • hmm i see!! The next step is to use HPA and check it too.. But first i have to test VPA.. Maybe the result is that it is not the appropriate for this job.. Somehow or other, Upper Bound is so high, there is no case to scale up my pod more than once time.. Thank you very much!! – sofi Oct 10 '21 at 18:20