First day playing with kubernetes
As a starter exercise I did set myself the following goals:
- Deploy a K8s cluster using kind.
Tackling the first task
The installation of kind went smooth.
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64
chmod +x ./kind
mv ./kind /usr/local/bin/kind
Deployment of my first kind cluste was just as simple.
eduard@Ubuntu:~$ sudo kind create cluster
Creating cluster "kind" ...
β Ensuring node image (kindest/node:v1.19.1) πΌ
β Preparing nodes π¦
β Writing configuration π
β Starting control-plane πΉοΈ
β Installing CNI π
β Installing StorageClass πΎ
Set kubectl context to "kind-kind"
You can now use your cluster with:
kubectl cluster-info --context kind-kind
Have a nice day! π
Trying out the command suggested by kind I had my first observation
the kind
installation doesnβt include kubectl unlike microk8s
.
eduard@Ubuntu:~$ kubectl cluster-info --context kind-kind
kubectl: command not found
In order to fix that I followed the official guide
eduard@Ubuntu:~$ curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 38.3M 100 38.3M 0 0 20.5M 0 0:00:01 0:00:01 --:--:-- 20.5M
eduard@Ubuntu:~$ chmod +x ./kubectl
eduard@Ubuntu:~$ sudo mv ./kubectl /usr/local/bin/kubectl
[sudo] password for edward:
eduard@Ubuntu:~$ kubectl version --client
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.2", GitCommit:"faecb196815e248d3ecfb03c680a4507229c2a56", GitTreeState:"clean", BuildDate:"2021-01-13T13:28:09Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
And now we got the cluster-info
!
eduard@Ubuntu:~$ sudo kubectl cluster-info --context kind-kind
Kubernetes control plane is running at https://127.0.0.1:46651
KubeDNS is running at https://127.0.0.1:46651/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Written on January 19, 2021