From the course: Docker for Developers: Create and Manage Docker Containers

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Scaling in Kubernetes

Scaling in Kubernetes

- [Instructor] One of Kubernetes' best features is how it scales. Scaling in Kubernetes is the process of adjusting how many copies or replicas of your application are running. It helps your app stay fast and available, even under heavy load. Let's take a look at how this works. Over in VS Code, in a terminal, type kubectl scale deployment, then the name of the deployment, which is app. Then, add the replicas flag and set it to 3, followed by the n flag and our namespace, myapp. You should see a confirmation that the app deployment has been scaled. To verify this, we can get a list of our pods. Type kubectl get pods, then the n flag and the myapp namespace. Here, there are three pods running the app service. Another way to scale is in the deployment file directly. Open the app-deployment.yaml file in the k8s folder. You should see a section called spec, and underneath that is replicas. Let's set this to 5. Now we…

Contents