jerrac

failedcidrchange

Sep 14th, 2021
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 19.46 KB | None | 0 0
  1. systemuser@microk8snode:~$ sudo snap install microk8s --classic --channel=1.21
  2. [sudo] password for systemuser:
  3. Download snap "microk8s" (2407) from channel "1.21"                        13%  156kB/s 17.9merror: cannot perform the following tasks:
  4. - Download snap "microk8s" (2407) from channel "1.21" (the download has been cancelled: context canceled)
  5. systemuser@microk8snode:~$ sudo snap install microk8s --classic --channel=1.21
  6. microk8s (1.21/stable) v1.21.4 from Canonical✓ installed
  7. systemuser@microk8snode:~$ sudo usermod -a -G microk8s $USER
  8. [sudo] password for systemuser:
  9. systemuser@microk8snode:~$ sudo chown -f -R $USER ~/.kube
  10. systemuser@microk8snode:~$ su - $USER
  11. Password:
  12. systemuser@microk8snode:~$ microk8s status
  13. microk8s is running
  14. high-availability: no
  15.   datastore master nodes: 127.0.0.1:19001
  16.   datastore standby nodes: none
  17. addons:
  18.   enabled:
  19.     ha-cluster           # Configure high availability on the current node
  20.   disabled:
  21.     ambassador           # Ambassador API Gateway and Ingress
  22.     cilium               # SDN, fast with full network policy
  23.     dashboard            # The Kubernetes dashboard
  24.     dns                  # CoreDNS
  25.     fluentd              # Elasticsearch-Fluentd-Kibana logging and monitoring
  26.     gpu                  # Automatic enablement of Nvidia CUDA
  27.     helm                 # Helm 2 - the package manager for Kubernetes
  28.     helm3                # Helm 3 - Kubernetes package manager
  29.     host-access          # Allow Pods connecting to Host services smoothly
  30.     ingress              # Ingress controller for external access
  31.     istio                # Core Istio service mesh services
  32.     jaeger               # Kubernetes Jaeger operator with its simple config
  33.     keda                 # Kubernetes-based Event Driven Autoscaling
  34.     knative              # The Knative framework on Kubernetes.
  35.     kubeflow             # Kubeflow for easy ML deployments
  36.     linkerd              # Linkerd is a service mesh for Kubernetes and other frameworks
  37.     metallb              # Loadbalancer for your Kubernetes cluster
  38.     metrics-server       # K8s Metrics Server for API access to service metrics
  39.     multus               # Multus CNI enables attaching multiple network interfaces to pods
  40.     openebs              # OpenEBS is the open-source storage solution for Kubernetes
  41.     openfaas             # openfaas serverless framework
  42.     portainer            # Portainer UI for your Kubernetes cluster
  43.     prometheus           # Prometheus operator for monitoring and logging
  44.     rbac                 # Role-Based Access Control for authorisation
  45.     registry             # Private image registry exposed on localhost:32000
  46.     storage              # Storage class; allocates storage from host directory
  47.     traefik              # traefik Ingress controller for external access
  48. systemuser@microk8snode:~$ microk8s kubectl delete -f /var/snap/microk8s/current/args/cni-network/cni.yaml
  49. configmap "calico-config" deleted
  50. Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
  51. customresourcedefinition.apiextensions.k8s.io "bgpconfigurations.crd.projectcalico.org" deleted
  52. customresourcedefinition.apiextensions.k8s.io "bgppeers.crd.projectcalico.org" deleted
  53. customresourcedefinition.apiextensions.k8s.io "blockaffinities.crd.projectcalico.org" deleted
  54. customresourcedefinition.apiextensions.k8s.io "clusterinformations.crd.projectcalico.org" deleted
  55. customresourcedefinition.apiextensions.k8s.io "felixconfigurations.crd.projectcalico.org" deleted
  56. customresourcedefinition.apiextensions.k8s.io "globalnetworkpolicies.crd.projectcalico.org" deleted
  57. customresourcedefinition.apiextensions.k8s.io "globalnetworksets.crd.projectcalico.org" deleted
  58. customresourcedefinition.apiextensions.k8s.io "hostendpoints.crd.projectcalico.org" deleted
  59. customresourcedefinition.apiextensions.k8s.io "ipamblocks.crd.projectcalico.org" deleted
  60. customresourcedefinition.apiextensions.k8s.io "ipamconfigs.crd.projectcalico.org" deleted
  61. customresourcedefinition.apiextensions.k8s.io "ipamhandles.crd.projectcalico.org" deleted
  62. customresourcedefinition.apiextensions.k8s.io "ippools.crd.projectcalico.org" deleted
  63. customresourcedefinition.apiextensions.k8s.io "networkpolicies.crd.projectcalico.org" deleted
  64. customresourcedefinition.apiextensions.k8s.io "networksets.crd.projectcalico.org" deleted
  65. clusterrole.rbac.authorization.k8s.io "calico-kube-controllers" deleted
  66. clusterrolebinding.rbac.authorization.k8s.io "calico-kube-controllers" deleted
  67. clusterrole.rbac.authorization.k8s.io "calico-node" deleted
  68. clusterrolebinding.rbac.authorization.k8s.io "calico-node" deleted
  69. daemonset.apps "calico-node" deleted
  70. serviceaccount "calico-node" deleted
  71. deployment.apps "calico-kube-controllers" deleted
  72. serviceaccount "calico-kube-controllers" deleted
  73. systemuser@microk8snode:~$ vim /var/snap/microk8s/current/args/kube-proxy
  74. systemuser@microk8snode:~$ microk8s stop
  75. Stopped.
  76. systemuser@microk8snode:~$ microk8s start
  77. Started.
  78. systemuser@microk8snode:~$ microk8s status
  79. microk8s is running
  80. high-availability: no
  81.   datastore master nodes: 127.0.0.1:19001
  82.   datastore standby nodes: none
  83. addons:
  84.   enabled:
  85.     ha-cluster           # Configure high availability on the current node
  86.   disabled:
  87.     ambassador           # Ambassador API Gateway and Ingress
  88.     cilium               # SDN, fast with full network policy
  89.     dashboard            # The Kubernetes dashboard
  90.     dns                  # CoreDNS
  91.     fluentd              # Elasticsearch-Fluentd-Kibana logging and monitoring
  92.     gpu                  # Automatic enablement of Nvidia CUDA
  93.     helm                 # Helm 2 - the package manager for Kubernetes
  94.     helm3                # Helm 3 - Kubernetes package manager
  95.     host-access          # Allow Pods connecting to Host services smoothly
  96.     ingress              # Ingress controller for external access
  97.     istio                # Core Istio service mesh services
  98.     jaeger               # Kubernetes Jaeger operator with its simple config
  99.     keda                 # Kubernetes-based Event Driven Autoscaling
  100.     knative              # The Knative framework on Kubernetes.
  101.     kubeflow             # Kubeflow for easy ML deployments
  102.     linkerd              # Linkerd is a service mesh for Kubernetes and other frameworks
  103.     metallb              # Loadbalancer for your Kubernetes cluster
  104.     metrics-server       # K8s Metrics Server for API access to service metrics
  105.     multus               # Multus CNI enables attaching multiple network interfaces to pods
  106.     openebs              # OpenEBS is the open-source storage solution for Kubernetes
  107.     openfaas             # openfaas serverless framework
  108.     portainer            # Portainer UI for your Kubernetes cluster
  109.     prometheus           # Prometheus operator for monitoring and logging
  110.     rbac                 # Role-Based Access Control for authorisation
  111.     registry             # Private image registry exposed on localhost:32000
  112.     storage              # Storage class; allocates storage from host directory
  113.     traefik              # traefik Ingress controller for external access
  114. systemuser@microk8snode:~$ vim /var/snap/microk8s/current/args/cni-network/cni.yaml
  115. systemuser@microk8snode:~$ microk8s kubectl apply -f /var/snap/microk8s/current/args/cni-network/cni.yaml
  116. configmap/calico-config created
  117. Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
  118. customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org created
  119. customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org created
  120. customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org created
  121. customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org created
  122. customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org created
  123. customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org created
  124. customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org created
  125. customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org created
  126. customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org created
  127. customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org created
  128. customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org created
  129. customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org created
  130. customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org created
  131. customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org created
  132. clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created
  133. clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created
  134. clusterrole.rbac.authorization.k8s.io/calico-node created
  135. clusterrolebinding.rbac.authorization.k8s.io/calico-node created
  136. daemonset.apps/calico-node created
  137. serviceaccount/calico-node created
  138. deployment.apps/calico-kube-controllers created
  139. serviceaccount/calico-kube-controllers created
  140. systemuser@microk8snode:~$ microk8s enable dns dashboard
  141. Enabling DNS
  142. Applying manifest
  143. serviceaccount/coredns created
  144. configmap/coredns created
  145. deployment.apps/coredns created
  146. service/kube-dns created
  147. clusterrole.rbac.authorization.k8s.io/coredns created
  148. clusterrolebinding.rbac.authorization.k8s.io/coredns created
  149. Restarting kubelet
  150. DNS is enabled
  151. Enabling Kubernetes Dashboard
  152. Enabling Metrics-Server
  153. clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics-reader created
  154. clusterrolebinding.rbac.authorization.k8s.io/metrics-server:system:auth-delegator created
  155. rolebinding.rbac.authorization.k8s.io/metrics-server-auth-reader created
  156. Warning: apiregistration.k8s.io/v1beta1 APIService is deprecated in v1.19+, unavailable in v1.22+; use apiregistration.k8s.io/v1 APIService
  157. apiservice.apiregistration.k8s.io/v1beta1.metrics.k8s.io created
  158. serviceaccount/metrics-server created
  159. deployment.apps/metrics-server created
  160. service/metrics-server created
  161. clusterrole.rbac.authorization.k8s.io/system:metrics-server created
  162. clusterrolebinding.rbac.authorization.k8s.io/system:metrics-server created
  163. clusterrolebinding.rbac.authorization.k8s.io/microk8s-admin created
  164. Metrics-Server is enabled
  165. Applying manifest
  166. serviceaccount/kubernetes-dashboard created
  167. service/kubernetes-dashboard created
  168. secret/kubernetes-dashboard-certs created
  169. secret/kubernetes-dashboard-csrf created
  170. secret/kubernetes-dashboard-key-holder created
  171. configmap/kubernetes-dashboard-settings created
  172. role.rbac.authorization.k8s.io/kubernetes-dashboard created
  173. clusterrole.rbac.authorization.k8s.io/kubernetes-dashboard created
  174. rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
  175. clusterrolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
  176. deployment.apps/kubernetes-dashboard created
  177. service/dashboard-metrics-scraper created
  178. deployment.apps/dashboard-metrics-scraper created
  179.  
  180. If RBAC is not enabled access the dashboard using the default token retrieved with:
  181.  
  182. token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
  183. microk8s kubectl -n kube-system describe secret $token
  184.  
  185. In an RBAC enabled setup (microk8s enable RBAC) you need to create a user with restricted
  186. permissions as shown in:
  187. https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md
  188.  
  189. systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
  190. NAMESPACE     NAME                                      READY   STATUS              RESTARTS   AGE   IP             NODE              NOMINATED NODE   READINESS GATES
  191. kube-system   calico-kube-controllers-f7868dd95-hq2df   0/1     ContainerCreating   0          42s   <none>         microk8snode   <none>           <none>
  192. kube-system   coredns-7f9c69c78c-xn6nf                  0/1     ContainerCreating   0          37s   <none>         microk8snode   <none>           <none>
  193. kube-system   calico-node-h96rb                         0/1     Error               1          42s   10.225.225.7   microk8snode   <none>           <none>
  194. systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
  195. NAMESPACE     NAME                                      READY   STATUS              RESTARTS   AGE   IP             NODE              NOMINATED NODE   READINESS GATES
  196. kube-system   calico-kube-controllers-f7868dd95-hq2df   0/1     ContainerCreating   0          57s   <none>         microk8snode   <none>           <none>
  197. kube-system   coredns-7f9c69c78c-xn6nf                  0/1     ContainerCreating   0          52s   <none>         microk8snode   <none>           <none>
  198. kube-system   calico-node-h96rb                         0/1     CrashLoopBackOff    2          57s   10.225.225.7   microk8snode   <none>           <none>
  199. systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
  200. NAMESPACE     NAME                                      READY   STATUS              RESTARTS   AGE   IP             NODE              NOMINATED NODE   READINESS GATES
  201. kube-system   calico-kube-controllers-f7868dd95-hq2df   0/1     ContainerCreating   0          92s   <none>         microk8snode   <none>           <none>
  202. kube-system   coredns-7f9c69c78c-xn6nf                  0/1     ContainerCreating   0          87s   <none>         microk8snode   <none>           <none>
  203. kube-system   calico-node-h96rb                         0/1     CrashLoopBackOff    4          92s   10.225.225.7   microk8snode   <none>           <none>
  204. systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
  205. NAMESPACE     NAME                                         READY   STATUS              RESTARTS   AGE    IP             NODE              NOMINATED NODE   READINESS GATES
  206. kube-system   calico-kube-controllers-f7868dd95-hq2df      0/1     ContainerCreating   0          2m8s   <none>         microk8snode   <none>           <none>
  207. kube-system   coredns-7f9c69c78c-xn6nf                     0/1     ContainerCreating   0          2m3s   <none>         microk8snode   <none>           <none>
  208. kube-system   kubernetes-dashboard-85fd7f45cb-77d25        0/1     ContainerCreating   0          27s    <none>         microk8snode   <none>           <none>
  209. kube-system   metrics-server-8bbfb4bdb-xsqdv               0/1     ContainerCreating   0          27s    <none>         microk8snode   <none>           <none>
  210. kube-system   dashboard-metrics-scraper-78d7698477-nvjmb   0/1     ContainerCreating   0          27s    <none>         microk8snode   <none>           <none>
  211. kube-system   calico-node-h96rb                            0/1     Running             5          2m8s   10.225.225.7   microk8snode   <none>           <none>
  212. systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
  213. NAMESPACE     NAME                                         READY   STATUS              RESTARTS   AGE     IP             NODE              NOMINATED NODE   READINESS GATES
  214. kube-system   calico-kube-controllers-f7868dd95-hq2df      0/1     ContainerCreating   0          3m25s   <none>         microk8snode   <none>           <none>
  215. kube-system   coredns-7f9c69c78c-xn6nf                     0/1     ContainerCreating   0          3m20s   <none>         microk8snode   <none>           <none>
  216. kube-system   kubernetes-dashboard-85fd7f45cb-77d25        0/1     ContainerCreating   0          104s    <none>         microk8snode   <none>           <none>
  217. kube-system   metrics-server-8bbfb4bdb-xsqdv               0/1     ContainerCreating   0          104s    <none>         microk8snode   <none>           <none>
  218. kube-system   dashboard-metrics-scraper-78d7698477-nvjmb   0/1     ContainerCreating   0          104s    <none>         microk8snode   <none>           <none>
  219. kube-system   calico-node-h96rb                            0/1     CrashLoopBackOff    5          3m25s   10.225.225.7   microk8snode   <none>           <none>
  220. systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
  221. NAMESPACE     NAME                                         READY   STATUS              RESTARTS   AGE     IP             NODE              NOMINATED NODE   READINESS GATES
  222. kube-system   calico-kube-controllers-f7868dd95-hq2df      0/1     ContainerCreating   0          4m4s    <none>         microk8snode   <none>           <none>
  223. kube-system   coredns-7f9c69c78c-xn6nf                     0/1     ContainerCreating   0          3m59s   <none>         microk8snode   <none>           <none>
  224. kube-system   kubernetes-dashboard-85fd7f45cb-77d25        0/1     ContainerCreating   0          2m23s   <none>         microk8snode   <none>           <none>
  225. kube-system   metrics-server-8bbfb4bdb-xsqdv               0/1     ContainerCreating   0          2m23s   <none>         microk8snode   <none>           <none>
  226. kube-system   dashboard-metrics-scraper-78d7698477-nvjmb   0/1     ContainerCreating   0          2m23s   <none>         microk8snode   <none>           <none>
  227. kube-system   calico-node-h96rb                            0/1     CrashLoopBackOff    6          4m4s    10.225.225.7   microk8snode   <none>           <none>
  228. systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
  229. NAMESPACE     NAME                                         READY   STATUS              RESTARTS   AGE     IP             NODE              NOMINATED NODE   READINESS GATES
  230. kube-system   calico-kube-controllers-f7868dd95-hq2df      0/1     ContainerCreating   0          8m24s   <none>         microk8snode   <none>           <none>
  231. kube-system   coredns-7f9c69c78c-xn6nf                     0/1     ContainerCreating   0          8m19s   <none>         microk8snode   <none>           <none>
  232. kube-system   kubernetes-dashboard-85fd7f45cb-77d25        0/1     ContainerCreating   0          6m43s   <none>         microk8snode   <none>           <none>
  233. kube-system   metrics-server-8bbfb4bdb-xsqdv               0/1     ContainerCreating   0          6m43s   <none>         microk8snode   <none>           <none>
  234. kube-system   dashboard-metrics-scraper-78d7698477-nvjmb   0/1     ContainerCreating   0          6m43s   <none>         microk8snode   <none>           <none>
  235. kube-system   calico-node-h96rb                            0/1     CrashLoopBackOff    7          8m24s   10.225.225.7   microk8snode   <none>           <none>
  236. systemuser@microk8snode:~$ microk8s kubectl get po -A -o wide
  237. NAMESPACE     NAME                                         READY   STATUS              RESTARTS   AGE   IP             NODE              NOMINATED NODE   READINESS GATES
  238. kube-system   calico-kube-controllers-f7868dd95-hq2df      0/1     ContainerCreating   0          34m   <none>         microk8snode   <none>           <none>
  239. kube-system   coredns-7f9c69c78c-xn6nf                     0/1     ContainerCreating   0          34m   <none>         microk8snode   <none>           <none>
  240. kube-system   kubernetes-dashboard-85fd7f45cb-77d25        0/1     ContainerCreating   0          32m   <none>         microk8snode   <none>           <none>
  241. kube-system   metrics-server-8bbfb4bdb-xsqdv               0/1     ContainerCreating   0          32m   <none>         microk8snode   <none>           <none>
  242. kube-system   dashboard-metrics-scraper-78d7698477-nvjmb   0/1     ContainerCreating   0          32m   <none>         microk8snode   <none>           <none>
  243. kube-system   calico-node-h96rb                            0/1     CrashLoopBackOff    12         34m   10.225.225.7   microk8snode   <none>           <none>
  244. systemuser@microk8snode:~$
  245.  
Advertisement
Add Comment
Please, Sign In to add comment