Saturday, March 20, 2021

k8s minikube addons

 HOWTO

 

Get addons list
[dave@dave ~]$ minikube addons list
|-----------------------------|----------|--------------|
|         ADDON NAME          | PROFILE  |    STATUS    |
|-----------------------------|----------|--------------|
| ambassador                  | minikube | disabled     |
| auto-pause                  | minikube | disabled     |
| csi-hostpath-driver         | minikube | disabled     |
| dashboard                   | minikube | enabled ✅   |
| default-storageclass        | minikube | enabled ✅   |
| efk                         | minikube | disabled     |
| freshpod                    | minikube | disabled     |
| gcp-auth                    | minikube | disabled     |
| gvisor                      | minikube | disabled     |
| helm-tiller                 | minikube | disabled     |
| ingress                     | minikube | enabled ✅   |
| ingress-dns                 | minikube | disabled     |
| istio                       | minikube | disabled     |
| istio-provisioner           | minikube | disabled     |
| kubevirt                    | minikube | disabled     |
| logviewer                   | minikube | disabled     |
| metallb                     | minikube | disabled     |
| metrics-server              | minikube | disabled     |
| nvidia-driver-installer     | minikube | disabled     |
| nvidia-gpu-device-plugin    | minikube | disabled     |
| olm                         | minikube | disabled     |
| pod-security-policy         | minikube | disabled     |
| registry                    | minikube | disabled     |
| registry-aliases            | minikube | disabled     |
| registry-creds              | minikube | disabled     |
| storage-provisioner         | minikube | enabled ✅   |
| storage-provisioner-gluster | minikube | disabled     |
| volumesnapshots             | minikube | disabled     |
|-----------------------------|----------|--------------|

enable metrics
[dave@dave ~]$ minikube addons enable metrics-server
    ▪ Using image k8s.gcr.io/metrics-server-amd64:v0.2.1
🌟  The 'metrics-server' addon is enabled


get metrics
[dave@dave ~]$ kubectl get pod,svc -n kube-system
NAME                                            READY   STATUS      RESTARTS   AGE
pod/coredns-74ff55c5b-vkbhb                     1/1     Running     3          6d18h
pod/etcd-minikube                               1/1     Running     2          5d21h
pod/ingress-nginx-admission-create-mqrgx        0/1     Completed   0          5d12h
pod/ingress-nginx-admission-patch-5hsm2         0/1     Completed   0          5d12h
pod/ingress-nginx-controller-65cf89dc4f-64d9n   1/1     Running     4          5d12h
pod/kube-apiserver-minikube                     1/1     Running     2          5d21h
pod/kube-controller-manager-minikube            1/1     Running     3          6d18h
pod/kube-proxy-jfktf                            1/1     Running     3          6d18h
pod/kube-scheduler-minikube                     1/1     Running     3          6d18h
pod/metrics-server-56c4f8c9d6-q86vt             1/1     Running     0          10s
pod/storage-provisioner                         1/1     Running     7          6d18h

NAME                                         TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                  AGE
service/ingress-nginx-controller-admission   ClusterIP   10.108.226.190   <none>        443/TCP                  5d12h
service/kube-dns                             ClusterIP   10.96.0.10       <none>        53/UDP,53/TCP,9153/TCP   6d18h
service/metrics-server                       ClusterIP   10.103.175.49    <none>        443/TCP                  10s

 

Saturday, March 13, 2021

Upgrade minikube on Fedora 33

 Upgrade Docker, kubectl, minikube to latest version

Remove previous versions and start minikube

Installed versions 

 

[dave@dave ~]$ kubectl version
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", BuildDate:"2021-02-18T16:12:00Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.2", GitCommit:"faecb196815e248d3ecfb03c680a4507229c2a56", GitTreeState:"clean", BuildDate:"2021-01-13T13:20:00Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
[dave@dave ~]$ docker version
Client: Docker Engine - Community
 Version:           20.10.5
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        55c4c88
 Built:             Tue Mar  2 20:19:16 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.5
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       363e9a8
  Built:            Tue Mar  2 20:16:56 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.4
  GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
 runc:
  Version:          1.0.0-rc93
  GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
[dave@dave ~]$ which kubectl
/usr/local/bin/kubectl
[dave@dave ~]$ minikube version
minikube version: v1.18.1
commit: 09ee84d530de4a92f00f1c5dbc34cead092b95bc


 

Delete all previous versions to avoid errors on start

Exiting due to GUEST_START: wait 6m0s for node: wait for healthy API server: controlPlane never updated to v1.20.2



[dave@dave ~]$ rm -rf ~/.minikube/

dave@dave ~]$ minikube delete
🙄  "minikube" profile does not exist, trying anyways.
💀  Removed all traces of the "minikube" cluster.
[dave@dave ~]$ minikube start --driver=docker
😄  minikube v1.18.1 on Fedora 33
✨  Using the docker driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
💾  Downloading Kubernetes v1.20.2 preload ...
    > preloaded-images-k8s-v9-v1....: 491.22 MiB / 491.22 MiB  100.00% 10.37 Mi
🔥  Creating docker container (CPUs=2, Memory=3900MB) ...
❗  Unable to create dedicated network, this might result in cluster IP change after restart: failed to create network after 20 attempts
🐳  Preparing Kubernetes v1.20.2 on Docker 20.10.3 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔎  Verifying Kubernetes components...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v4
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default




Check minikube cluster

[dave@dave Downloads]$ kubectl cluster-info
Kubernetes master is running at https://172.17.0.3:8443
KubeDNS is running at https://172.17.0.3:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.