Skip to content

tpaz1/kubernetes-labs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubernetes-labs

Welcome to the Kubernetes Labs folder! This collection contains 8 different hands-on labs designed to enhance your understanding of Kubernetes. Each lab focuses on a specific concept or feature of Kubernetes, offering practical scenarios for learning and experimentation.


Prerequisites

To get started with these labs, ensure the following prerequisites are met:

  • A running Kubernetes cluster (e.g., Minikube, Kind, or a managed cluster).
  • kubectl installed and configured.
  • Basic understanding of Kubernetes concepts.

Setting Up Minikube

For those using Minikube, you can start your cluster with the following command:

minikube start --driver=docker --cni=cilium --kubernetes-version=stable --extra-config=kubelet.authentication-token-webhook=true --extra-config=kubelet.authorization-mode=AlwaysAllow --extra-config=kubelet.cgroup-driver=systemd --extra-config=kubelet.read-only-port=10255 --insecure-registry="registry.k8s.io"

Labs Overview

1. Using ConfigMap to Change Application

  • Objective: Learn how to use a ConfigMap in Kubernetes to manage configuration data for your application.
  • Key Topics: ConfigMap, Deployment
  • Folder: lab1-ConfigMap
  • Detailed Instructions

2. Using ConfigMap, Multiple Deployments, and Ingress

  • Objective: In this lab, you will extend the previous exercise by creating two separate deployments of the same application.
  • Key Topics: ConfigMap, Deployment, Ingress.
  • Folder: lab2-Ingress
  • Detailed Instructions

3. Understanding Persistence with StatefulSets, and Persistent Volumes

  • Objective: Learn about Kubernetes persistence by deploying a PostgreSQL database using both Deployments and StatefulSets.
  • Key Topics: PVC, PV, StorageClass, Statefulset.
  • Folder: lab3-persistence
  • Detailed Instructions

4. Creating a Cluster Using KUBEADM

  • Objective: This lab will guide you through the process of setting up a Kubernetes cluster using Kubeadm.
  • Key Topics: Kubernetes components.
  • Folder: lab4-kubeadm
  • Detailed Instructions

5. Kubernetes Network Policy Lab

  • Objective: Learn how to create and apply Kubernetes Network Policies to control the communication between different applications in your cluster.
  • Key Topics: NetworkPolicy.
  • Folder: lab5-NetworkPolicies
  • Detailed Instructions

6. Kubernetes Horizontal Pod Autoscaler (HPA)

  • Objective: This lab demonstrates how to set up a Kubernetes Horizontal Pod Autoscaler (HPA) for a deployment, stress the CPU, and observe scaling behavior.
  • Key Topics: HPA.
  • Folder: lab6-HPA
  • Detailed Instructions

7. Readiness and Liveness Probes

  • Objective: This lab demonstrates how to use readiness and liveness probes in Kubernetes to ensure proper health checks for containers in your cluster.
  • Key Topics: Liveness probes, Readiness Probes.
  • Folder: lab7-probes
  • Detailed Instructions

8. Scheduling

  • Objective: This lab demonstrates how Kubernetes uses taints, tolerations, node affinity, and pod anti-affinity to control pod scheduling.
  • Key Topics: Taints, Tolerations, Node Affinity, Pod Anti-affinity.
  • Folder: lab8-scheduling
  • Detailed Instructions

How to Use These Labs

  1. Navigate to the folder of the lab you wish to explore.
  2. Follow the instructions in the README.md file of the respective lab.
  3. Experiment with the concepts and extend the labs as needed!

Feedback and Contributions

If you encounter issues or have suggestions for improvement, feel free to contribute by submitting a pull request or opening an issue in the repository.

Enjoy your Kubernetes learning journey!

minikube start --driver=docker --cni=cilium --insecure-registry="registry.k8s.io" --extra-config=apiserver.oidc-ca-file="" --extra-config=apiserver.authorization-mode=AlwaysAllow --extra-config=kubelet.authentication-token-webhook=false

minikube start --driver=docker --cni=cilium --kubernetes-version=stable --extra-config=kubelet.authentication-token-webhook=true --extra-config=kubelet.authorization-mode=AlwaysAllow --extra-config=kubelet.cgroup-driver=systemd --extra-config=kubelet.read-only-port=10255 --insecure-registry="registry.k8s.io"

kubectl -n kube-system patch deployment metrics-server --type='json' -p='[{ "op": "add", "path": "/spec/template/spec/containers/0/args", "value": [ "--kubelet-insecure-tls", "--cert-dir=/tmp", "--secure-port=10250", "--kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname", "--kubelet-use-node-status-port", "--metric-resolution=15s" ] }]'

"--cert-dir=/tmp" "--secure-port=10250" "--kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname" "--kubelet-use-node-status-port" "--metric-resolution=15s"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published