Playing with Kubernetes

Fuji:~ randalkamradt$ ssh rkamradt@192.168.0.104
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-76-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Sat Feb 1 19:32:17 UTC 2020System load: 0.93 Processes: 112
Usage of /: 2.9% of 145.71GB Users logged in: 1
Memory usage: 34% IP address for enp0s7: 192.168.0.104
Swap usage: 0%
62 packages can be updated.
0 updates are security updates.
Last login: Sat Feb 1 19:30:11 2020 from 192.168.0.224
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
rkamradt@kubernetes:~$
sudo apt-get update
sudo apt-get upgrade
sudo reboot
rkamradt@kubernetes:~$ cat /proc/swapsFilename    Type  Size Used Priority/swap.img                               file  2097148 0 -2rkamradt@kubernetes:~$ sudo swapoff /swap.img
sudo usermod -a -G microk8s rkamradt
rkamradt@kubernetes:~$ microk8s.status
microk8s is running
addons:
cilium: disabled
dashboard: disabled
dns: disabled
fluentd: disabled
gpu: disabled
helm3: disabled
helm: disabled
ingress: disabled
istio: disabled
jaeger: disabled
juju: disabled
knative: disabled
kubeflow: disabled
linkerd: disabled
metallb: disabled
metrics-server: disabled
prometheus: disabled
rbac: disabled
registry: disabled
storage: disabled
rkamradt@kubernetes:~$
microk8s.enable dns cilium registry storage
microk8s.enable metallb 192.168.0.250-192.168.0.254
rkamradt@kubernetes:~$ microk8s.kubectl get all --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
container-registry pod/registry-d7d7c8bc9-sd5xx 1/1 Running 1 103m
kube-system pod/cilium-operator-55658fb5c4-7cb8c 1/1 Running 1 25m
kube-system pod/cilium-rf6xc 1/1 Running 2 25m
kube-system pod/coredns-7b67f9f8c-v2b5w 1/1 Running 0 25m
kube-system pod/hostpath-provisioner-7b9cb5cdb4-wv2j4 1/1 Running 1 103m
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
container-registry service/registry NodePort 10.152.183.197 <none> 5000:32000/TCP 103m
default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 128m
kube-system service/kube-dns ClusterIP 10.152.183.10 <none> 53/UDP,53/TCP,9153/TCP 104m
NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
kube-system daemonset.apps/cilium 1 1 1 1 1 <none> 26m
NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
container-registry deployment.apps/registry 1/1 1 1 103m
kube-system deployment.apps/cilium-operator 1/1 1 1 26m
kube-system deployment.apps/coredns 1/1 1 1 104m
kube-system deployment.apps/hostpath-provisioner 1/1 1 1 103m
NAMESPACE NAME DESIRED CURRENT READY AGE
container-registry replicaset.apps/registry-d7d7c8bc9 1 1 1 103m
kube-system replicaset.apps/cilium-operator-55658fb5c4 1 1 1 25m
kube-system replicaset.apps/coredns-7b67f9f8c 1 1 1 104m
kube-system replicaset.apps/hostpath-provisioner-7b9cb5cdb4 1 1 1 103m
rkamradt@kubernetes:~$
Fuji:~ randalkamradt$ kubectl version
Client Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.11-dispatcher", GitCommit:"2e298c7e992f83f47af60cf4830b11c7370f6668", GitTreeState:"clean", BuildDate:"2019-09-19T22:26:40Z", GoVersion:"go1.11.13", Compiler:"gc", Platform:"darwin/amd64"}
Fuji:~ randalkamradt$
Fuji:~ randalkamradt$ kubectl get all --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
container-registry pod/registry-d7d7c8bc9-sd5xx 1/1 Running 1 18h
kube-system pod/cilium-operator-55658fb5c4-7cb8c 1/1 Running 1 16h
kube-system pod/cilium-rf6xc 1/1 Running 2 16h
kube-system pod/coredns-7b67f9f8c-v2b5w 1/1 Running 0 16h
kube-system pod/hostpath-provisioner-7b9cb5cdb4-wv2j4 1/1 Running 1 18h
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
container-registry service/registry NodePort 10.152.183.197 <none> 5000:32000/TCP 18h
default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 18h
kube-system service/kube-dns ClusterIP 10.152.183.10 <none> 53/UDP,53/TCP,9153/TCP 18h
NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
kube-system daemonset.apps/cilium 1 1 1 1 1 <none> 16h
NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
container-registry deployment.apps/registry 1/1 1 1 18h
kube-system deployment.apps/cilium-operator 1/1 1 1 16h
kube-system deployment.apps/coredns 1/1 1 1 18h
kube-system deployment.apps/hostpath-provisioner 1/1 1 1 18h
NAMESPACE NAME DESIRED CURRENT READY AGE
container-registry replicaset.apps/registry-d7d7c8bc9 1 1 1 18h
kube-system replicaset.apps/cilium-operator-55658fb5c4 1 1 1 16h
kube-system replicaset.apps/coredns-7b67f9f8c 1 1 1 18h
kube-system replicaset.apps/hostpath-provisioner-7b9cb5cdb4 1 1 1 18h
Fuji:~ randalkamradt$
kubectl run echotest --image=k8s.gcr.io/echoserver:1.4
NAME                            READY   STATUS    RESTARTS   AGE
pod/echotest-584bcb54fc-bqp7c 1/1 Running 0 2m45s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 22h
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/echotest 1/1 1 1 2m45s
NAME DESIRED CURRENT READY AGE
replicaset.apps/echotest-584bcb54fc 1 1 1 2m45s
kubectl expose deployment echotest --name=loadbalancer --port=80 --target-port=8080 --type=LoadBalancer
Fuji:~ randalkamradt$ kubectl get all
NAME READY STATUS RESTARTS AGE
pod/echotest-584bcb54fc-bqp7c 1/1 Running 0 8m31s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 22h
service/loadbalancer LoadBalancer 10.152.183.75 192.168.0.250 80:31032/TCP 59s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/echotest 1/1 1 1 8m31s
NAME DESIRED CURRENT READY AGE
replicaset.apps/echotest-584bcb54fc 1 1 1 8m31s
Fuji:~ randalkamradt$
Fuji:~ randalkamradt$ curl http://192.168.0.250
CLIENT VALUES:
client_address=192.168.0.104
command=GET
real path=/
query=nil
request_version=1.1
request_uri=http://192.168.0.250:8080/
SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001
HEADERS RECEIVED:
accept=*/*
host=192.168.0.250
user-agent=curl/7.54.0
BODY:
-no body in request-Fuji:~ randalkamradt$
Fuji:~ randalkamradt$ kubectl delete deployment echotest
deployment.apps "echotest" deleted
Fuji:~ randalkamradt$ kubectl delete service loadbalancer
service "loadbalancer" deleted
Fuji:~ randalkamradt$ kubectl get all
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 23h
Fuji:~ randalkamradt$

--

--

--

Java software engineer for Coinme Inc. Artist and musician. https://rkamradt.github.io/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Good news guys🎉

Difference in behavior for copying contents in primitive and non primitive type

COVID-19 Lockdown is the PERFECT time to map out your processes

Self-Healing: How to Keep Your Systems Live

On the Genealogy of Serverless

How I built my own speed camera and proved my street has dangerous drivers.

A look into RealTime, WebSockets, and Warp Cable

https://t.co/oMIB1RE68W

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Randal Kamradt Sr

Randal Kamradt Sr

Java software engineer for Coinme Inc. Artist and musician. https://rkamradt.github.io/

More from Medium

A Kubernetes cluster from Virtualbox

Kubernetes: Ordered cleanup with OwnerReference

Accessing Pods Outside Of The Cluster In Kubernetes

Environment Variables in Kubernetes