My experience learning Kubernetes 1/x

Jose Ferro
4 min readFeb 17, 2023

A friend told me: “You only learn kubernetes by getting your hands dirty, forget about course exercices, install minikube, and put up a jupyterHub in your machine”.

THE GOAL: Understanding the kubernetes infrastructure neccesary to run a jupyter hub environement. So first I need to understand a minimum of Kubernetes.

I have a mac, I start by going to the K8s site:
https://minikube.sigs.k8s.io/docs/start/

I read: Container or virtual machine manager, such as: Docker, QEMU, Hyperkit, Hyper-V, KVM, Parallels, Podman, VirtualBox, or VMware Fusion/Workstation

Lets install Docker Desktop: https://docs.docker.com/desktop/install/mac-install/

I download the dmg file, pass it to applications folder and Docker appears in my applicatons list. Easy right? No. Docker does not start.

I uninstall and install Docker several times. killing all processes with activity monitor, then putting the Docker folder in the bin and also trying to delete anything related to docker in the command line:

  1. Remove the Docker CLI and Docker Compose executables by running the following command in the Terminal:
sudo rm /usr/local/bin/docker /usr/local/bin/docker-compose
  1. Remove any existing Docker data by running the following command in the Terminal:
rm -rf ~/Library/Containers/com.docker.docker

after reinstalling Docker desktop it still does not start when open it in the applications folder.

I only found a weird solution here:

in the application folder right click and show package contents look for MacOS and inside look and run the Docker executable. It worked. Why? who knows.

At this moment I am ready to install minikube with:

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64
sudo install minikube-darwin-amd64 /usr/local/bin/minikube

I cross my fingers, all looks good.

I make sure that virtualbox is not installed in my computer. Somehow I want to stick to docker and kubernetes, nothing else.

minikube star

And the magic looks to happen, no errors.

The kubernetes learning is starting right now.

It took a few uninstalls and installs. but the machine is ready for learning.

My goal is to understand this:

by: https://www.mdpi.com/1424-8220/20/16/4621#

Lets try to follow the minikube website commands.

kubectl get po -A

The kubectl get po -A command retrieves a list of all pods running in all namespaces. The output includes the following columns:

  • NAMESPACE: The namespace of the pod.
  • NAME: The name of the pod.
  • READY: The number of container instances running in the pod, out of the total number of containers defined in the pod specification.
  • STATUS: The current status of the pod, such as Running, Pending, or Error.
  • RESTARTS: The number of times the containers in the pod have been restarted.
  • AGE: The time elapsed since the pod was created.

When you run kubectl get po -A, you will see all the running pods across all the namespaces in your cluster, including the kube-system namespace. The pods running in the kube-system namespace are part of the Kubernetes control plane and are responsible for managing the cluster's operation.

PODS running.

NAMESPACE NAME READY STATUS RESTARTS AGE

kube-system coredns-787d4945fb-6jrbn 1/1 Running 0 35m

kube-system etcd-minikube 1/1 Running 0 35m

kube-system kube-apiserver-minikube 1/1 Running 0 35m

kube-system kube-controller-manager-minikube 1/1 Running 0 35m

kube-system kube-proxy-9n6gp 1/1 Running 0 35m

kube-system kube-scheduler-minikube 1/1 Running 0 35m

kube-system storage-provisioner 1/1 Running 1 (35m ago) 35m

Those PODS contain stuff necessary for kubernetes to operate. I guess I will learn later on what are they for.

Lets see what do I need to install jupyter Hub in a kubernetes environement:

Going to: Zero to JupyterHub with Kubernetes

I see that I need also to install HELM.

Helm is a package manager for Kubernetes, and it is not strictly necessary for all Kubernetes use cases. While Minikube is a tool that enables users to run a single-node Kubernetes cluster locally, it does not come with a package manager like Helm by default. This is because the choice of which package manager to use can be subjective and depend on the specific needs of the user.

In other words, while Helm is a widely used and popular package manager for Kubernetes, it is not strictly necessary for everyone who uses Kubernetes or Minikube. Therefore, users who want to use Helm with their Minikube cluster need to install it separately.

This is the command for the terminal:

curl https://raw.githubusercontent.com/helm/helm/HEAD/scripts/get-helm-3 | bash

You check in the terminal that helm is installed with helm version.

And now it looks like everything is set up to start playing in the playground and trying to install the jupyterhub.

See then the part 2

--

--

Jose Ferro

Python coder. NLP. Pandas. Currently heavily involved with ipywidgets (ipysheet, ipyvuetify, ipycytoscape)