Posts

Showing posts with the label kind

Kubernetes Horizontal Pod Autoscaling

Image
Introduction There are two common scaling methods: Vertical scaling and Horizontal scaling . Vertical scaling involves adding more hardware, such as RAM or CPU , or increasing the number of server nodes. Horizontal scaling , on the other hand, means adding more instances of an app to fully utilize the available resources on a node or server. However, horizontal scaling has its limits. Once a node's resources are maxed out, vertical scaling becomes necessary. This article will focus on horizontal scaling using Kubernetes Horizontal Pod Autoscaling (HPA) , which automatically scales resources up or down based on system demands. Implementation Process 1. Build a Docker image for your application. 2. Deploy the image using a Deployment and LoadBalancer service. 3. Configure HPA to automatically scale resources. To use HPA for auto-scaling based on CPU/Memory , Kubernetes must have the metrics-server installed. If you’re using a cloud provider, the metrics-server is usually instal

Setting Up an EXTERNAL-IP for Local LoadBalancer Service

Image
Introduction If you've used a LoadBalancer service from a Cloud Provider , you'll know how convenient it is to have an EXTERNAL-IP assigned automatically. However, when using local Kubernetes , the default setting doesn't provide an EXTERNAL-IP . Building on our previous discussion, this guide will show you how to use ` cloud-provider-kind ` to assign an EXTERNAL-IP to your local LoadBalancer service . First, make sure you've set up your local Kubernetes using Kind as outlined in my previous guide. This is necessary to proceed with the next steps. Installing cloud-provider-kind Since this is a Go package , you'll need to install Go first. Then, you can install the package with the following steps: go install sigs.k8s.io/cloud-provider-kind@latest Then execute command to use: cloud-provider-kind Keep in mind that you need to keep the terminal running while using Kubernetes to create the EXTERNAL-IP . Testing with local EXTERNAL-IP Create a deployment and e

Setting up Kubernetes Dashboard with Kind

Image
Introduction In a previous article, I guided you through using Helm to deploy on Google Kubernetes Engine . However, if you want to cut down costs by using Kubernetes in your local environment instead of relying on a cloud provider during development, then Kind is your go-to. There are several tools to help set up Kubernetes locally, such as MiniKube , Kind , K3S , KubeAdm , and more. Each tool has its own pros and cons. In this article, I'll walk you through using Kind to quickly set up a Kubernetes cluster on Docker . Kind stands out for its compactness, making Kubernetes start up quickly, being user-friendly, and supporting the latest Kubernetes versions. Working with Kind Firstly, follow the instructions here to install Kind according to your operating system. If you're using Ubuntu , execute the command: [ $( uname -m ) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64 chmod +x ./kind sudo mv ./kind /usr/local/bin/ki