Skip to content

mesutozsoytraining/kubernetes-cka

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes-cka

Kind Cluster Setup Guide

Prerequisite: Ensure you are running PowerShell as Administrator for all installation commands.

1. Installation

First, install the necessary CLI tools using Chocolatey.

Install Kind

Kind (Kubernetes in Docker) is the tool used to run local Kubernetes clusters using Docker containers as "nodes."

choco install kind

Install Kubectl

The command line tool for communicating with the Kubernetes cluster.

choco install kubernetes-cli

2. Cluster Configuration

Create a multi-node cluster configuration file. This example sets up 1 Control Plane node and 2 Worker nodes.

File: config.yaml

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
    extraPortMappings:
      - containerPort: 30001
        hostPort: 30001
      - containerPort: 30002
        hostPort: 30002
  - role: worker
  - role: worker

3. Create Cluster

Run the following command to spin up the cluster using the configuration file created above.

kind create cluster --name cka-cluster1 --config config.yaml --image kindest/node:v1.33.4@sha256:25a6018e48dfcaee478f4a59af81157a437f15e6e140bf103f85a2e7cd0cbbf2

Command Breakdown:

  • --name: Sets the name of the cluster (e.g., cka-cluster1).
  • --config: Points to your multi-node setup file.
  • --image: Specifies the exact Kubernetes version to use (useful for certification practice like CKA).

4. Verification & Context

Once the cluster is running, verify the status and ensure kubectl is pointing to the right place.

Get Cluster Info

Checks if the control plane is running and CoreDNS is active.

kubectl cluster-info --context kind-cka-cluster1

Manage Contexts

If you have multiple clusters (e.g., Docker Desktop, Minikube, and Kind), you need to manage which one kubectl talks to.

List all available contexts:

kubectl config get-contexts

Switch to a specific cluster:

kubectl config use-context <cluster-name>
# Example:
# kubectl config use-context kind-cka-cluster1

5. Cleanup

When you are finished with your lab, you can delete the cluster to free up resources.

kind delete cluster --name cka-cluster1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors