Skip to content

Room 01

KIND CLUSTER SETUP


⚠️ sudo Access

  • You might need sudo access for some commands.
  • The sudo password is: escape.
  • Write it down, you will need it later.

The Gateway to Kubernetes

  • You’ve discovered a portal to the world of container orchestration.
  • Before you can explore, you need to build your own Kubernetes cluster using Kind (Kubernetes in Docker).
  • Kind lets you run full K8s clusters in Docker containers - perfect for learning and testing.

📜 Your Mission

  1. Install Kind if not already available.

    Kind runs Kubernetes clusters as Docker containers

  2. Create a Kind cluster named escape-room using the provided config file kind-config.yaml.
  3. Verify the cluster is running with kubectl get nodes.
  4. List all pods in the kube-system namespace.
  5. Count the total number of running pods in kube-system - the password is kind followed by that count (no space).

    Example: if there are 8 running pods → password is kind8


Key Commands
Command Purpose
kind create cluster Create a default Kind cluster
kind create cluster --name NAME Create a named cluster
kind create cluster --config FILE Create cluster from config
kind get clusters List all Kind clusters
kind delete cluster --name NAME Delete a cluster
kubectl get nodes List cluster nodes
kubectl get pods -n kube-system List system pods
kubectl get pods -A List pods in all namespaces
kubectl cluster-info Show cluster endpoint info
kubectl version Show client and server versions

What is Kind?

Kind (Kubernetes in Docker) creates K8s clusters by running each node as a Docker container. It’s the fastest way to get a local multi-node cluster.

# Install Kind (Linux/macOS)
curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-$(uname)-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind

# Create a basic single-node cluster
kind create cluster --name my-cluster

# Create a cluster with a config file
cat <<EOF > kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
  - role: worker
  - role: worker
EOF
kind create cluster --config kind-config.yaml --name multi-node

# Verify the cluster
kubectl cluster-info --context kind-multi-node
kubectl get nodes
Kind Cluster Configuration
# kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
    kubeadmConfigPatches:
      - |
        kind: InitConfiguration
        nodeRegistration:
          kubeletExtraArgs:
            node-labels: "ingress-ready=true"
    extraPortMappings:
      - containerPort: 80
        hostPort: 80
        protocol: TCP
      - containerPort: 443
        hostPort: 443
        protocol: TCP
  - role: worker
  - role: worker
kubectl Basics
# Check cluster connectivity
kubectl cluster-info

# List nodes
kubectl get nodes
kubectl get nodes -o wide    # Extended output with IP, OS, etc.

# List pods in a specific namespace
kubectl get pods -n kube-system

# List all pods across all namespaces
kubectl get pods -A
kubectl get pods --all-namespaces

# Filter by status
kubectl get pods -n kube-system --field-selector=status.phase=Running

Hints

Hint 1

The Kind config file kind-config.yaml is already in the room directory. Use:

kind create cluster --config kind-config.yaml --name escape-room

Hint 2

To count only Running pods in kube-system:

kubectl get pods -n kube-system --field-selector=status.phase=Running --no-headers | wc -l

Hint 3

The password format is kind + the count number (no space). If you count 7 running pods, the password is kind7.


🔓 Unlock Room 02

Once you have the password, decrypt the next room’s README:

openssl enc -aes-256-cbc -d -a -pbkdf2 \
        -in ../room_02/README             \
        -out ../room_02/README.txt        \
        -pass pass:PASSWORD

cat ../room_02/README.txt