Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

How to scale a Kubernetes app

Sumit Rawal answered on May 14, 2023 Popularity 8/10 Helpfulness 1/10

Contents


More Related Answers

  • kubectl scale --replicas to 0
  • kubectl scale deployment
  • kubernetes auto complete
  • kubernetes command line to scale down pods
  • kubernetes clusterip service template
  • kubectl get pods wide
  • kubernetes resources limits
  • kubernetes get deployments
  • kubernetes limits and resources
  • change cluster kubectl
  • Metrics server in kubernetes
  • kubernetes get persistent volumes
  • change pv from released to available kubernetes
  • kubernetes get persistent volume claims
  • get kubernetes cluster name
  • Creating a kubernetes service cluster
  • change kuber cluster
  • rescale kubectl
  • kubernetes kustomize kubectl
  • How to deploy a Kubernetes app
  • kubectl deployment get image
  • What is Kubernetes Autoscaling?
  • how to chnage kubectl to k
  • kubernetes check pod resource limits
  • kubernetes kustomize
  • What do you know about clusters in Kubernetes?
  • kubernetes copy files to persistent volume
  • kubernetes clusterip
  • extracting kubernetes podname from java
  • kubernetes get cluster

  • How to scale a Kubernetes app

    0

    While our app now works fully and is reachable by external sources, what happens if our pod fails? Or what happens if the number of requests reaching our program suddenly spikes?

    To protect against these cases, we need to scale up our app; creating more instances of our hello-node pod to delineate requests to or to step in if a pod fails. The best part is, with Kubernetes this takes but a single command to create and will do the above jobs automatically from then on!

    To scale up our app, enter:

    kubectl scale --replicas=3 deployment/hello-node

    This will set our program to maintain a state of three running instances of the hello-node pod rather than just one.

    To check this, enter:

    kubectl get deployment hello-node

    This should print a screen like so:

    NAME READY UP-TO-DATE AVAILABLE AGE

    hello-node 3/3 3 3 135m

    Notice the three pods under this deployment listed in the ready column.

    Or to see the pods independently you can enter:

    kubectl get pods

    NAME READY STATUS RESTARTS AGE

    hello-node-55b49fb9f8-fxjnj 1/1 Running 0 2m34s

    hello-node-55b49fb9f8-jlfwq 1/1 Running 0 2m34s

    hello-node-55b49fb9f8-zhf9f 1/1 Running 0 136m

    This once again shows us that where there was once only a single pod, we now have three separate but identical instances of the hello-node pod.

    Popularity 8/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 14 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.