Jump to content

Kubernetes/Kubernetes Workshop/Autoscaling in Kubernetes

From Wikitech

Overview

At the end of this module, you should be able to:

  • Define Autoscaling.
  • Set up Horizontal Pod Autoscaling (HPA)

Hands-on Demo: Horizontal Pod Autoscaling (HPA)

Kubernetes has basic autoscaling built-in with the Horizontal Pod Autoscaling capability. Using the official docs you will run a demo where you scale a sample application using HPA.

Checking YAML There are several ways to validate the syntax of the K8s YAML files. The kubeval program contains the basic K8s syntax, and kube-score offers a more opinionated take. Other options, such as Polaris, have a base set of rules but can be easily extended with custom rules (you want to limit repository usage to only approved repositories).

minikube Dashboard and Lens

minikube dashboard is a web-based Kubernetes user interface. While Lens provides you with an opportunity to gain insight into clusters.

Shutdown all services and deployments and stop minikube at the end of this workshop module. <syntaxhighlight lang="bash"> $ minikube stop <syntaxhighlight>

Next Module

Module 5: Refactoring code using Kubernetes features

Previous Module