Technical requirements – Managing Advanced Kubernetes Resources

In the previous chapter, we covered Kubernetes and why we need it and then discussed bootstrapping a Kubernetes cluster using MiniKube and KinD. We then looked at the Pod resource and discussed how to create and manage pods, how to troubleshoot them, and how to ensure your application’s reliability using probes, along with multi-container design patterns to appreciate why Kubernetes uses pods in the first place instead of containers. We also looked at Secrets and ConfigMaps.

Now, we will dive deep into the advanced aspects of Kubernetes and Kubernetes command-line best practices.

In this chapter, we’re going to cover the following main topics:

  • The need for advanced Kubernetes resources
  • Kubernetes Deployments
  • Kubernetes Services and Ingresses
  • Horizontal pod autoscaling
  • Managing stateful applications
  • Kubernetes command-line best practices, tips, and tricks

So, let’s dive in!

Technical requirements

For this chapter, we will spin up a cloud-based Kubernetes cluster, Google Kubernetes Engine (GKE), for the exercises. That is because you will not be able to spin up load balancers and PersistentVolumes within your local system, and therefore, we cannot use KinD and MiniKube in this chapter.

Currently, Google Cloud Platform (GCP) provides a free $300 trial for 90 days, so you can go ahead and sign up for one at https://cloud.google.com/free.

Spinning up GKE

Once you’ve signed up and logged in to your console, you can open the Google Cloud Shell CLI to run the commands.

You need to enable the GKE API first using the following command:

$ gcloud services enable container.googleapis.com

To create a three-node GKE cluster, run the following command:

$ gcloud container clusters create cluster-1 –zone us-central1-a

And that’s it! The cluster is up and running.

You will also need to clone the following GitHub repository for some exercises: https://github.

com/PacktPublishing/Modern-DevOps-Practices-2e.

Run the following command to clone the repository into your home directory and cd into the ch6 directory to access the required resources:

$ git clone https://github.com/PacktPublishing/Modern-DevOps-Practices-2e.git \ modern-devops

$ cd modern-devops/ch6

Now, let’s understand why we need advanced Kubernetes resources.

Related Posts

Static provisioning – Managing Advanced Kubernetes Resources-2

As the Service resource is created, we can create a StatefulSet resource that uses the created PersistentVolume and Service resources. The StatefulSet resource manifest, nginx-manual-statefulset.yaml, looks like…

Static provisioning – Managing Advanced Kubernetes Resources-1

Static provisioning is the traditional method of provisioning volumes. It requires someone (typically an administrator) to manually provision a disk and create a PersistentVolume resource using the…

StatefulSet resources – Managing Advanced Kubernetes Resources

StatefulSet resources help manage stateful applications. They are similar to Deployment resources, but unlike a Deployment resource, they also keep track of state and require Volume and…

Managing stateful applications – Managing Advanced Kubernetes Resources

Imagine you’re a librarian in a magical library. You have a bunch of enchanted books that store valuable knowledge. Each book has a unique story and is…

Horizontal Pod autoscaling – Managing Advanced Kubernetes Resources-2

Now, let’s autoscale this deployment. The Deployment resource needs at least 1 pod replica and can have a maximum of 5 pod replicas while maintaining an average…

Horizontal Pod autoscaling – Managing Advanced Kubernetes Resources-1

Imagine you’re the manager of a snack bar at a park. On a sunny day, lots of people come to enjoy the park, and they all want…

Leave a Reply

Your email address will not be published. Required fields are marked *