I am following this tutorial .
A Kubernetes cluster consists of two types of resources:
Each node has a Kubelet, which is an agent for managing the node and communicating with the Kubernetes control plane.
A Kubernetes cluster that handles production traffic should have a minimum of three nodes to maintain high availability.
sudo apt update sudo apt install curl docker.io -y sudo usermod -aG docker debian newgrp docker
Note: if you are running Debian Linux on Apple silicon, replace "amd64" with "arm64" in the commands below.
Your cluster starts, showing several messages, ending with "Done! kubectl is now configured...", as shown below.curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube rm minikube-linux-amd64 minikube start
You see your pods, as shown below.minikube kubectl -- get pods -A
Right now, all you have are system pods, to run Kubernetes, because you haven't deployed any applications.
After preparing the dashboard, it tries to open the dashboard page in your default browser, as shown below.minikube dashboard
If you are using a headless server, it can't open a browser. Press Ctrl+C to cancel that operation, as shown below.
A message says "Starting to serve...", as shown below.minikube kubectl -- proxy --address 0.0.0.0 --disable-filter=true &
Press Enter to get a fresh $ prompt. The proxy process continues running in the background.
The dashboard page opens.http://172.16.123.129:8001/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/
Flag H 140.1: Cluster (10 pts)
In the Dashboard, on the lower left, click Cluster.The flag is covered by a green rectangle in the image below.
Now there are two new pods, providing the dashboard, as shown below.minikube kubectl -- get pods -A
The Pod in this tutorial has only one Container.
A Kubernetes Deployment checks on the health of your Pod and restarts the Pod's Container if it terminates.
Deployments are the recommended way to manage the creation and scaling of Pods.
The echo server contains a Web server that simply echoes every request back to the client making it.
On your Linux server, execute these commands:
You see a deployment named "hello-minikube" and a pod with a name beginning with "hello-minikube-" as shown below.minikube kubectl -- create deployment hello-minikube --image=kicbase/echo-server:1.0 minikube kubectl -- get deployments minikube kubectl -- get pods minikube kubectl -- get events
The events show the creation of the container and its assignment to the deployment.
In the Dashboard, at the top left, click Workloads.
You now have one Deployment, one Pod, and one Replica Set, as shown below.
To make the hello-node Container accessible from outside the Kubernetes virtual network, you have to expose the Pod as a Kubernetes Service.
On your Linux server, execute these commands:
Press Enter after the last command to get a fresh $ prompt, as shown below.minikube kubectl -- expose deployment hello-minikube --type=NodePort --port=8080 minikube kubectl -- get services hello-minikube minikube kubectl -- port-forward service/hello-minikube 7080:8080 --address=0.0.0.0 &
In a Web browser, open this URL, replacing the IP address with the IP address of your Debian machine:
The echo page opens, showing the HTTP GET request that loaded it, as shown below.http://172.16.123.129:7080
On your Linux server, execute these commands:
You see the "Forwarding..." message, as shown below.minikube kubectl -- create deployment balanced --image=kicbase/echo-server:1.0 minikube kubectl -- expose deployment balanced --type=LoadBalancer --port=8080 minikube tunnel & minikube kubectl -- get services balanced minikube kubectl -- port-forward service/balanced 6080:8080 --address=0.0.0.0 &
Flag H 140.2: Cluster (20 pts)
In a Web browser, open this URL, replacing the IP address with the IP address of your Debian machine:http://172.16.123.129:6080The flag is covered by a green rectangle in the image below.
You see the two services "hello-minikube" and "balanced", and after deleting them, they are gone, as shown below.minikube kubectl -- get services minikube kubectl -- delete service hello-minikube minikube kubectl -- delete service balanced minikube kubectl -- get services
You see the "Forwarding..." message, as shown below.minikube kubectl -- get deployments minikube kubectl -- delete deployment hello-minikube minikube kubectl -- delete deployment balanced minikube kubectl -- get deployments
On your Linux server, execute this command:
There are no more non-system pods, as shown below.minikube kubectl -- get pods
minikube stop
Posted 3-10-25
Video added 3-11-25