First steps Kubernetes

First steps in K8S land

Like all new things in life you just have to start somewhere. So what I did when I started with kubernetes is the following. I googled a bit for things I knew and liked “vagrant+kubernetes+ubuntu+github” found a repo I liked and cloned it and gave it a spin-up.

git clone https://[email protected]/exxsyseng/k8s_ubuntu.git
cd k8s_ubuntu
vagrant up

And you know what before I knew it (actualy took still quite a few minutes) I had a whole cluster up and running:

vagrant ssh kmaster
vagrant@kmaster:~$ kubectl get all --all-namespaces
NAMESPACE     NAME                                           READY   STATUS    RESTARTS   AGE
kube-system   pod/calico-kube-controllers-6b9d4c8765-sptkm   1/1     Running   0          12m
kube-system   pod/calico-node-g7tpb                          1/1     Running   0          8m5s
kube-system   pod/calico-node-gw48l                          1/1     Running   0          12m
kube-system   pod/calico-node-j7cr6                          1/1     Running   0          3m44s
kube-system   pod/coredns-6955765f44-ld2j4                   1/1     Running   0          12m
kube-system   pod/coredns-6955765f44-wgc5d                   1/1     Running   0          12m
kube-system   pod/etcd-kmaster                               1/1     Running   0          12m
kube-system   pod/kube-apiserver-kmaster                     1/1     Running   0          12m
kube-system   pod/kube-controller-manager-kmaster            1/1     Running   0          12m
kube-system   pod/kube-proxy-k4jc5                           1/1     Running   0          12m
kube-system   pod/kube-proxy-mfcpk                           1/1     Running   0          8m5s
kube-system   pod/kube-proxy-xmqxm                           1/1     Running   0          3m44s
kube-system   pod/kube-scheduler-kmaster                     1/1     Running   0          12m
NAMESPACE     NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                  AGE
default       service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP                  12m
kube-system   service/kube-dns     ClusterIP   10.96.0.10   <none>        53/UDP,53/TCP,9153/TCP   12m
NAMESPACE     NAME                         DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                 AGE
kube-system   daemonset.apps/calico-node   3         3         3       3            3           beta.kubernetes.io/os=linux   12m
kube-system   daemonset.apps/kube-proxy    3         3         3       3            3           beta.kubernetes.io/os=linux   12m
NAMESPACE     NAME                                      READY   UP-TO-DATE   AVAILABLE   AGE
kube-system   deployment.apps/calico-kube-controllers   1/1     1            1           12m
kube-system   deployment.apps/coredns                   2/2     2            2           12m
NAMESPACE     NAME                                                 DESIRED   CURRENT   READY   AGE
kube-system   replicaset.apps/calico-kube-controllers-6b9d4c8765   1         1         1       12m
kube-system   replicaset.apps/coredns-6955765f44                   2         2         2       12m

Pretty awsome but of course I had no clue what I just had turned on or what it was doing ;-) So back into the kiddie pool and start learning to swim before I could start scuba diving.

Install a minikube

Install minikube I did this the following way on my windows system:

# Set your PowerShell execution policy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force

# Install Chocolatey
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex

# install minikube
choco install minikube

Install virtualbox form here

minikube start

Starting local Kubernetes cluster...
Running pre-create checks...
Creating machine...
Starting local Kubernetes cluster..

Run a first server called echoserver:

PS>kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10
deployment.apps/hello-minikube created

PS>kubectl expose deployment hello-minikube --type=NodePort --port=8080
service/hello-minikube exposed

PS>kubectl get pod
NAME                              READY   STATUS    RESTARTS   AGE
hello-minikube-797f975945-s5mmb   1/1     Running   0          102s

Find out how to reach the webserver you created:

PS>minikube service hello-minikube --url
http://192.168.99.100:31380

A verrry usefull command minikube dashboard Dashboard

comments powered by Disqus