Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- systemuser@microk8snode:~$ sudo snap install microk8s --classic --channel=1.21
- [sudo] password for systemuser:
- Download snap "microk8s" (2407) from channel "1.21" 13% 156kB/s 17.9merror: cannot perform the following tasks:
- - Download snap "microk8s" (2407) from channel "1.21" (the download has been cancelled: context canceled)
- systemuser@microk8snode:~$ sudo snap install microk8s --classic --channel=1.21
- microk8s (1.21/stable) v1.21.4 from Canonical✓ installed
- systemuser@microk8snode:~$ sudo usermod -a -G microk8s $USER
- [sudo] password for systemuser:
- systemuser@microk8snode:~$ sudo chown -f -R $USER ~/.kube
- systemuser@microk8snode:~$ su - $USER
- Password:
- systemuser@microk8snode:~$ microk8s status
- microk8s is running
- high-availability: no
- datastore master nodes: 127.0.0.1:19001
- datastore standby nodes: none
- addons:
- enabled:
- ha-cluster # Configure high availability on the current node
- disabled:
- ambassador # Ambassador API Gateway and Ingress
- cilium # SDN, fast with full network policy
- dashboard # The Kubernetes dashboard
- dns # CoreDNS
- fluentd # Elasticsearch-Fluentd-Kibana logging and monitoring
- gpu # Automatic enablement of Nvidia CUDA
- helm # Helm 2 - the package manager for Kubernetes
- helm3 # Helm 3 - Kubernetes package manager
- host-access # Allow Pods connecting to Host services smoothly
- ingress # Ingress controller for external access
- istio # Core Istio service mesh services
- jaeger # Kubernetes Jaeger operator with its simple config
- keda # Kubernetes-based Event Driven Autoscaling
- knative # The Knative framework on Kubernetes.
- kubeflow # Kubeflow for easy ML deployments
- linkerd # Linkerd is a service mesh for Kubernetes and other frameworks
- metallb # Loadbalancer for your Kubernetes cluster
- metrics-server # K8s Metrics Server for API access to service metrics
- multus # Multus CNI enables attaching multiple network interfaces to pods
- openebs # OpenEBS is the open-source storage solution for Kubernetes
- openfaas # openfaas serverless framework
- portainer # Portainer UI for your Kubernetes cluster
- prometheus # Prometheus operator for monitoring and logging
- rbac # Role-Based Access Control for authorisation
- registry # Private image registry exposed on localhost:32000
- storage # Storage class; allocates storage from host directory
- traefik # traefik Ingress controller for external access
- systemuser@microk8snode:~$ microk8s kubectl delete -f /var/snap/microk8s/current/args/cni-network/cni.yaml
- configmap "calico-config" deleted
- Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
- customresourcedefinition.apiextensions.k8s.io "bgpconfigurations.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "bgppeers.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "blockaffinities.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "clusterinformations.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "felixconfigurations.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "globalnetworkpolicies.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "globalnetworksets.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "hostendpoints.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "ipamblocks.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "ipamconfigs.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "ipamhandles.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "ippools.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "networkpolicies.crd.projectcalico.org" deleted
- customresourcedefinition.apiextensions.k8s.io "networksets.crd.projectcalico.org" deleted
- clusterrole.rbac.authorization.k8s.io "calico-kube-controllers" deleted
- clusterrolebinding.rbac.authorization.k8s.io "calico-kube-controllers" deleted
- clusterrole.rbac.authorization.k8s.io "calico-node" deleted
- clusterrolebinding.rbac.authorization.k8s.io "calico-node" deleted
- daemonset.apps "calico-node" deleted
- serviceaccount "calico-node" deleted
- deployment.apps "calico-kube-controllers" deleted
- serviceaccount "calico-kube-controllers" deleted
- systemuser@microk8snode:~$ vim /var/snap/microk8s/current/args/kube-proxy
- systemuser@microk8snode:~$ microk8s stop
- Stopped.
- systemuser@microk8snode:~$ microk8s start
- Started.
- systemuser@microk8snode:~$ microk8s status
- microk8s is running
- high-availability: no
- datastore master nodes: 127.0.0.1:19001
- datastore standby nodes: none
- addons:
- enabled:
- ha-cluster # Configure high availability on the current node
- disabled:
- ambassador # Ambassador API Gateway and Ingress
- cilium # SDN, fast with full network policy
- dashboard # The Kubernetes dashboard
- dns # CoreDNS
- fluentd # Elasticsearch-Fluentd-Kibana logging and monitoring
- gpu # Automatic enablement of Nvidia CUDA
- helm # Helm 2 - the package manager for Kubernetes
- helm3 # Helm 3 - Kubernetes package manager
- host-access # Allow Pods connecting to Host services smoothly
- ingress # Ingress controller for external access
- istio # Core Istio service mesh services
- jaeger # Kubernetes Jaeger operator with its simple config
- keda # Kubernetes-based Event Driven Autoscaling
- knative # The Knative framework on Kubernetes.
- kubeflow # Kubeflow for easy ML deployments
- linkerd # Linkerd is a service mesh for Kubernetes and other frameworks
- metallb # Loadbalancer for your Kubernetes cluster
- metrics-server # K8s Metrics Server for API access to service metrics
- multus # Multus CNI enables attaching multiple network interfaces to pods
- openebs # OpenEBS is the open-source storage solution for Kubernetes
- openfaas # openfaas serverless framework
- portainer # Portainer UI for your Kubernetes cluster
- prometheus # Prometheus operator for monitoring and logging
- rbac # Role-Based Access Control for authorisation
- registry # Private image registry exposed on localhost:32000
- storage # Storage class; allocates storage from host directory
- traefik # traefik Ingress controller for external access
- systemuser@microk8snode:~$ vim /var/snap/microk8s/current/args/cni-network/cni.yaml
- systemuser@microk8snode:~$ microk8s kubectl apply -f /var/snap/microk8s/current/args/cni-network/cni.yaml
- configmap/calico-config created
- Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
- customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org created
- customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org created
- clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created
- clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created
- clusterrole.rbac.authorization.k8s.io/calico-node created
- clusterrolebinding.rbac.authorization.k8s.io/calico-node created
- daemonset.apps/calico-node created
- serviceaccount/calico-node created
- deployment.apps/calico-kube-controllers created
- serviceaccount/calico-kube-controllers created
- systemuser@microk8snode:~$ microk8s enable dns dashboard
- Enabling DNS
- Applying manifest
- serviceaccount/coredns created
- configmap/coredns created
- deployment.apps/coredns created
- service/kube-dns created
- clusterrole.rbac.authorization.k8s.io/coredns created
- clusterrolebinding.rbac.authorization.k8s.io/coredns created
- Restarting kubelet
- DNS is enabled
- Enabling Kubernetes Dashboard
- Enabling Metrics-Server
- clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics-reader created
- clusterrolebinding.rbac.authorization.k8s.io/metrics-server:system:auth-delegator created
- rolebinding.rbac.authorization.k8s.io/metrics-server-auth-reader created
- Warning: apiregistration.k8s.io/v1beta1 APIService is deprecated in v1.19+, unavailable in v1.22+; use apiregistration.k8s.io/v1 APIService
- apiservice.apiregistration.k8s.io/v1beta1.metrics.k8s.io created
- serviceaccount/metrics-server created
- deployment.apps/metrics-server created
- service/metrics-server created
- clusterrole.rbac.authorization.k8s.io/system:metrics-server created
- clusterrolebinding.rbac.authorization.k8s.io/system:metrics-server created
- clusterrolebinding.rbac.authorization.k8s.io/microk8s-admin created
- Metrics-Server is enabled
- Applying manifest
- serviceaccount/kubernetes-dashboard created
- service/kubernetes-dashboard created
- secret/kubernetes-dashboard-certs created
- secret/kubernetes-dashboard-csrf created
- secret/kubernetes-dashboard-key-holder created
- configmap/kubernetes-dashboard-settings created
- role.rbac.authorization.k8s.io/kubernetes-dashboard created
- clusterrole.rbac.authorization.k8s.io/kubernetes-dashboard created
- rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
- clusterrolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
- deployment.apps/kubernetes-dashboard created
- service/dashboard-metrics-scraper created
- deployment.apps/dashboard-metrics-scraper created
- If RBAC is not enabled access the dashboard using the default token retrieved with:
- token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
- microk8s kubectl -n kube-system describe secret $token
- In an RBAC enabled setup (microk8s enable RBAC) you need to create a user with restricted
- permissions as shown in:
- https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md
- systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
- NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
- kube-system calico-kube-controllers-f7868dd95-hq2df 0/1 ContainerCreating 0 42s <none> microk8snode <none> <none>
- kube-system coredns-7f9c69c78c-xn6nf 0/1 ContainerCreating 0 37s <none> microk8snode <none> <none>
- kube-system calico-node-h96rb 0/1 Error 1 42s 10.225.225.7 microk8snode <none> <none>
- systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
- NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
- kube-system calico-kube-controllers-f7868dd95-hq2df 0/1 ContainerCreating 0 57s <none> microk8snode <none> <none>
- kube-system coredns-7f9c69c78c-xn6nf 0/1 ContainerCreating 0 52s <none> microk8snode <none> <none>
- kube-system calico-node-h96rb 0/1 CrashLoopBackOff 2 57s 10.225.225.7 microk8snode <none> <none>
- systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
- NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
- kube-system calico-kube-controllers-f7868dd95-hq2df 0/1 ContainerCreating 0 92s <none> microk8snode <none> <none>
- kube-system coredns-7f9c69c78c-xn6nf 0/1 ContainerCreating 0 87s <none> microk8snode <none> <none>
- kube-system calico-node-h96rb 0/1 CrashLoopBackOff 4 92s 10.225.225.7 microk8snode <none> <none>
- systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
- NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
- kube-system calico-kube-controllers-f7868dd95-hq2df 0/1 ContainerCreating 0 2m8s <none> microk8snode <none> <none>
- kube-system coredns-7f9c69c78c-xn6nf 0/1 ContainerCreating 0 2m3s <none> microk8snode <none> <none>
- kube-system kubernetes-dashboard-85fd7f45cb-77d25 0/1 ContainerCreating 0 27s <none> microk8snode <none> <none>
- kube-system metrics-server-8bbfb4bdb-xsqdv 0/1 ContainerCreating 0 27s <none> microk8snode <none> <none>
- kube-system dashboard-metrics-scraper-78d7698477-nvjmb 0/1 ContainerCreating 0 27s <none> microk8snode <none> <none>
- kube-system calico-node-h96rb 0/1 Running 5 2m8s 10.225.225.7 microk8snode <none> <none>
- systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
- NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
- kube-system calico-kube-controllers-f7868dd95-hq2df 0/1 ContainerCreating 0 3m25s <none> microk8snode <none> <none>
- kube-system coredns-7f9c69c78c-xn6nf 0/1 ContainerCreating 0 3m20s <none> microk8snode <none> <none>
- kube-system kubernetes-dashboard-85fd7f45cb-77d25 0/1 ContainerCreating 0 104s <none> microk8snode <none> <none>
- kube-system metrics-server-8bbfb4bdb-xsqdv 0/1 ContainerCreating 0 104s <none> microk8snode <none> <none>
- kube-system dashboard-metrics-scraper-78d7698477-nvjmb 0/1 ContainerCreating 0 104s <none> microk8snode <none> <none>
- kube-system calico-node-h96rb 0/1 CrashLoopBackOff 5 3m25s 10.225.225.7 microk8snode <none> <none>
- systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
- NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
- kube-system calico-kube-controllers-f7868dd95-hq2df 0/1 ContainerCreating 0 4m4s <none> microk8snode <none> <none>
- kube-system coredns-7f9c69c78c-xn6nf 0/1 ContainerCreating 0 3m59s <none> microk8snode <none> <none>
- kube-system kubernetes-dashboard-85fd7f45cb-77d25 0/1 ContainerCreating 0 2m23s <none> microk8snode <none> <none>
- kube-system metrics-server-8bbfb4bdb-xsqdv 0/1 ContainerCreating 0 2m23s <none> microk8snode <none> <none>
- kube-system dashboard-metrics-scraper-78d7698477-nvjmb 0/1 ContainerCreating 0 2m23s <none> microk8snode <none> <none>
- kube-system calico-node-h96rb 0/1 CrashLoopBackOff 6 4m4s 10.225.225.7 microk8snode <none> <none>
- systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
- NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
- kube-system calico-kube-controllers-f7868dd95-hq2df 0/1 ContainerCreating 0 8m24s <none> microk8snode <none> <none>
- kube-system coredns-7f9c69c78c-xn6nf 0/1 ContainerCreating 0 8m19s <none> microk8snode <none> <none>
- kube-system kubernetes-dashboard-85fd7f45cb-77d25 0/1 ContainerCreating 0 6m43s <none> microk8snode <none> <none>
- kube-system metrics-server-8bbfb4bdb-xsqdv 0/1 ContainerCreating 0 6m43s <none> microk8snode <none> <none>
- kube-system dashboard-metrics-scraper-78d7698477-nvjmb 0/1 ContainerCreating 0 6m43s <none> microk8snode <none> <none>
- kube-system calico-node-h96rb 0/1 CrashLoopBackOff 7 8m24s 10.225.225.7 microk8snode <none> <none>
- systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
- NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
- kube-system calico-kube-controllers-f7868dd95-hq2df 0/1 ContainerCreating 0 34m <none> microk8snode <none> <none>
- kube-system coredns-7f9c69c78c-xn6nf 0/1 ContainerCreating 0 34m <none> microk8snode <none> <none>
- kube-system kubernetes-dashboard-85fd7f45cb-77d25 0/1 ContainerCreating 0 32m <none> microk8snode <none> <none>
- kube-system metrics-server-8bbfb4bdb-xsqdv 0/1 ContainerCreating 0 32m <none> microk8snode <none> <none>
- kube-system dashboard-metrics-scraper-78d7698477-nvjmb 0/1 ContainerCreating 0 32m <none> microk8snode <none> <none>
- kube-system calico-node-h96rb 0/1 CrashLoopBackOff 12 34m 10.225.225.7 microk8snode <none> <none>
- systemuser@microk8snode:~$
Advertisement
Add Comment
Please, Sign In to add comment