Get startedGet started for free

Scaling and Monitoring an Application

1. Scaling and Monitoring an Application

In this video, we will learn how to scale and monitor stateless applications using Kubernetes. Let's dive in.

2. Scaling on Kubernetes

Scaling means to add or remove resources. Adding resources is called scaling up and removing them is called scaling down. We scale up to react to more demand, e.g., due to increasing load on our application, or because more storage is needed. We scale down to save on resources, e.g., when load on our application goes back to normal. Now, how do we scale the number of Pods in Kubernetes? This is very easy: either we change the number of `replicas` in the Manifest and re-apply it, or use the command `kubectl scale deployment ...` with the command line argument "--replicas".

3. Scalability and Cloud Nativeness

To be clear, applications need to be designed for scalability in the first place. In fact, many legacy applications, or - in particular - monoliths, are typically not scalable in the way shown here. We cannot just add pods to a monolith and expect such an application to handle the load better. That is why we recapped software design previously: we need modern and cloud-native applications for scalability. These applications have to be designed accordingly, so that they can be scaled with ease.

4. Monitoring an Application

Monitoring is a crucial, real-time process for observing applications. Monitoring enables us to react to all kinds of problems and challenges like outages, load spikes, or storage that may be exhausted. There are many modern monitoring applications for Kubernetes. Examples include Prometheus and Grafana, but several other open-source and proprietary solutions exist. Here, we will use 'kubectl' to perform basic monitoring tasks. Specifically, we will use the command 'kubectl get', followed by the objects we want to monitor. In the first example, we use 'kubectl get pods' to observe all pods and their current status. In the second example, we use 'kubectl get services' to monitor all our services.

5. Let's practice!

Now, let's practice scaling and monitoring our Deployments!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.