简介
MicroK8s是通过snap快速部署的Kubernetes,适用于搭建开发环境的k8s。
官网
https://microk8s.io/
安装
https://microk8s.io/docs/
常用操作
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# microk8s信息 snap info microk8s # 启动/关闭/状态 microk8s.start/microk8s.stop # 插件信息 microk8s.status # 启用插件 microk8s.enable dashboard dns ingress registry storage # 查看镜像 microk8s.ctr images ls # 查看 cluster microk8s.kubectl cluster-info # 查看 nodes microk8s.kubectl get nodes # 查看 pods microk8s.kubectl get pods # 以yaml方式查看ingress microk8s.kubectl get ingress --all-namespaces -o yaml # 生成yaml kubectl create deployment httpd --image=httpd -o yaml --dry-run > httpd.yaml |
故障排除
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# 查看错误日志 microk8s.kubectl get pods --namespace=kube-system -o json |grep message # 无法下载镜像 使用squid https://microk8s.io/docs/install-proxy vim /var/snap/microk8s/current/args/containerd-env HTTPS_PROXY=http://squid.internal:3128 注意是http 配置完成后 microk8s.stop microk8s.start |
istio无法下载的解决
教你一步一步用 ubuntu / microk8s 安装 istio (国内源)
k8s启动Pod遇到CrashLoopBackOff的解决方法
访问k8s-dashboard
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# 查看dashboard-token 登陆时使用Token登录 microk8s.kubectl get secrets --all-namespaces | grep dashboard-token kubectl describe --namespace kube-system secrets kubernetes-dashboard-token-jzpb7 microk8s.kubectl describe --namespace kube-system secrets kubernetes-dashboard-token-jzpb7 ### 方式1 # 查找dashboard的pod名称 microk8s.kubectl get pods --all-namespaces | grep dashboard # 查看使用的端口 microk8s.kubectl describe --namespace kube-system pod/kubernetes-dashboard-5c848cc544-tv2bk # 端口转发(绕过了service,直接访问pod) microk8s.kubectl port-forward --namespace=kube-system --address=0.0.0.0 pod/kubernetes-dashboard-5c848cc544-tv2bk 9443:8443 浏览器访问 https://ip:9443 ### 方式2 # 通过代理,访问server->pod kubectl proxy --accept-hosts=.* --address=0.0.0.0 & http://ip:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/ |
配置私有镜像仓库
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# Registry开放NodePort为32000 # 可查看仓库镜像列表 http://192.168.xxx.xxx:32000/v2/_catalog # 在制作镜像的机器上配置docker私库 vim /etc/docker/daemon.json { "insecure-registries":["192.168.xxx.xxx:32000"] } sudo systemctl restart docker # 在机器上 vim /var/snap/microk8s/current/args/containerd-template.toml [plugins.cri.registry.mirrors."192.168.xxx.xxx:32000"] endpoint = ["http://192.168.xxx.xxx:32000"] microk8s.stop&µk8s.start apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app: nginx spec: selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: 192.168.xxx.xxx:32000/mynginx:registry ports: - containerPort: 80 |
注意
- 新版k8s默认使用containerd,而不是docker
- 本地安装的k8s版本为1.17/stable
内置插件
dashboard:部署kubernetes仪表板以及grafana和Influxdb
dns:部署kube dns
storage:创建默认存储类,此存储类使用指向主机上目录的hostpath-provisioner,持久卷在${SNAP_COMMON}/default-storage下创建
ingress:创建入口控制器(网关,统一入口,类似于zuul)
istio:部署核心Istio服务,使用microk8s.istioctl命令管理部署
registry:部署映像私有注册表并在localhost:32000上公开它
metrics-server:部署度量服务器
prometheus:部署Prometheus Operator v0.25
fluentd:部署Elasticsearch-Kibana-Fluentd日志和监控解决方案
jaeger:在“最简单”的配置中部署Jaeger Operator v1.8.2
操作记录
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
login as: root root@111.17.169.203's password: Last failed login: Sat Jul 11 21:32:55 CST 2020 from 49.95.252.151 on ssh:notty There was 1 failed login attempt since the last successful login. Last login: Sat Jul 11 21:30:31 2020 from 49.95.252.151 Welcome to Huawei Cloud Service [root@hecs-x-medium-2-linux-20200711102537 ~]# curl https://127.0.0.1:10443 curl: (60) Issuer certificate is invalid. More details here: http://curl.haxx.se/docs/sslcerts.html curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option. [root@hecs-x-medium-2-linux-20200711102537 ~]# microk8s status --wait-ready microk8s is running addons: dashboard: enabled dns: enabled helm: enabled metrics-server: enabled registry: enabled storage: enabled cilium: disabled fluentd: disabled gpu: disabled helm3: disabled host-access: disabled ingress: disabled istio: disabled jaeger: disabled knative: disabled kubeflow: disabled linkerd: disabled metallb: disabled prometheus: disabled rbac: disabled [root@hecs-x-medium-2-linux-20200711102537 ~]# microk8s kubectl get all --all-na mespaces NAMESPACE NAME READY STA TUS RESTARTS AGE container-registry pod/registry-7cf58dcdcc-9x8x8 1/1 Run ning 2 6h19m kube-system pod/coredns-588fd544bf-9qgv6 1/1 Run ning 2 6h19m kube-system pod/dashboard-metrics-scraper-59f5574d4-b7b4b 1/1 Run ning 2 6h19m kube-system pod/hostpath-provisioner-75fdc8fccd-m89wz 1/1 Run ning 2 6h19m kube-system pod/kubernetes-dashboard-6d97855997-8bnsq 1/1 Run ning 2 6h19m kube-system pod/metrics-server-c65c9d66-lkkck 1/1 Run ning 0 6h19m NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE container-registry service/registry NodePort 10.152.183. 130 <none> 5000:32000/TCP 6h19m default service/kubernetes ClusterIP 10.152.183. 1 <none> 443/TCP 6h21m kube-system service/dashboard-metrics-scraper ClusterIP 10.152.183. 173 <none> 8000/TCP 6h19m kube-system service/kube-dns ClusterIP 10.152.183. 10 <none> 53/UDP,53/TCP,9153/TCP 6h19m kube-system service/kubernetes-dashboard ClusterIP 10.152.183. 101 <none> 443/TCP 6h19m kube-system service/metrics-server ClusterIP 10.152.183. 210 <none> 443/TCP 6h19m NAMESPACE NAME READY UP-TO-D ATE AVAILABLE AGE container-registry deployment.apps/registry 1/1 1 1 6h19m kube-system deployment.apps/coredns 1/1 1 1 6h19m kube-system deployment.apps/dashboard-metrics-scraper 1/1 1 1 6h19m kube-system deployment.apps/hostpath-provisioner 1/1 1 1 6h19m kube-system deployment.apps/kubernetes-dashboard 1/1 1 1 6h19m kube-system deployment.apps/metrics-server 1/1 1 1 6h19m NAMESPACE NAME DESIR ED CURRENT READY AGE container-registry replicaset.apps/registry-7cf58dcdcc 1 1 1 6h19m kube-system replicaset.apps/coredns-588fd544bf 1 1 1 6h19m kube-system replicaset.apps/dashboard-metrics-scraper-59f5574d4 1 1 1 6h19m kube-system replicaset.apps/hostpath-provisioner-75fdc8fccd 1 1 1 6h19m kube-system replicaset.apps/kubernetes-dashboard-6d97855997 1 1 1 6h19m kube-system replicaset.apps/metrics-server-c65c9d66 1 1 1 6h19m [root@hecs-x-medium-2-linux-20200711102537 ~]# microk8s kubectl get all --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE container-registry pod/registry-7cf58dcdcc-9x8x8 1/1 Running 2 6h19 m kube-system pod/coredns-588fd544bf-9qgv6 1/1 Running 2 6h20 m kube-system pod/dashboard-metrics-scraper-59f5574d4-b7b4b 1/1 Running 2 6h20 m kube-system pod/hostpath-provisioner-75fdc8fccd-m89wz 1/1 Running 2 6h19 m kube-system pod/kubernetes-dashboard-6d97855997-8bnsq 1/1 Running 2 6h20 m kube-system pod/metrics-server-c65c9d66-lkkck 1/1 Running 0 6h20 m NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PO RT(S) AGE container-registry service/registry NodePort 10.152.183.130 <none> 50 00:32000/TCP 6h19m default service/kubernetes ClusterIP 10.152.183.1 <none> 44 3/TCP 6h21m kube-system service/dashboard-metrics-scraper ClusterIP 10.152.183.173 <none> 80 00/TCP 6h20m kube-system service/kube-dns ClusterIP 10.152.183.10 <none> 53 /UDP,53/TCP,9153/TCP 6h20m kube-system service/kubernetes-dashboard ClusterIP 10.152.183.101 <none> 44 3/TCP 6h20m kube-system service/metrics-server ClusterIP 10.152.183.210 <none> 44 3/TCP 6h20m NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE container-registry deployment.apps/registry 1/1 1 1 6h19 m kube-system deployment.apps/coredns 1/1 1 1 6h20 m kube-system deployment.apps/dashboard-metrics-scraper 1/1 1 1 6h20 m kube-system deployment.apps/hostpath-provisioner 1/1 1 1 6h19 m kube-system deployment.apps/kubernetes-dashboard 1/1 1 1 6h20 m kube-system deployment.apps/metrics-server 1/1 1 1 6h20 m NAMESPACE NAME DESIRED CURRENT READY AGE container-registry replicaset.apps/registry-7cf58dcdcc 1 1 1 6h19m kube-system replicaset.apps/coredns-588fd544bf 1 1 1 6h20m kube-system replicaset.apps/dashboard-metrics-scraper-59f5574d4 1 1 1 6h20m kube-system replicaset.apps/hostpath-provisioner-75fdc8fccd 1 1 1 6h19m kube-system replicaset.apps/kubernetes-dashboard-6d97855997 1 1 1 6h20m kube-system replicaset.apps/metrics-server-c65c9d66 1 1 1 6h20m [root@hecs-x-medium-2-linux-20200711102537 ~]# microk8s kubectl get secrets --all-namespaces|grep dash board-token kube-system kubernetes-dashboard-token-zwxvg kubernetes.io/service-account-to ken 3 6h23m [root@hecs-x-medium-2-linux-20200711102537 ~]# microk8s kubectl describe --namespace kube-system secrets kubernetes-dashboard-token-zwxvg Name: kubernetes-dashboard-token-zwxvg Namespace: kube-system Labels: <none> Annotations: kubernetes.io/service-account.name: kubernetes-dashboard kubernetes.io/service-account.uid: d3940950-0251-4db4-b9f7-d448ec3b7992 Type: kubernetes.io/service-account-token Data ==== ca.crt: 1103 bytes namespace: 11 bytes token: eyJhbGciOiJSUzI1NiIsImtpZCI6InpLNTBYaVdEY2FNbUxQeDQ3bExtenkyMm5qS0VUMm9wVGtGWFJYdllhLWcifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZC10b2tlbi16d3h2ZyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6ImQzOTQwOTUwLTAyNTEtNGRiNC1iOWY3LWQ0NDhlYzNiNzk5MiIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlLXN5c3RlbTprdWJlcm5ldGVzLWRhc2hib2FyZCJ9.Gcly56i7IPpTd6VUWFZZjjQmRE4rCgvKD9jlTrHxrE5bG_M2x91GzzPNzHbMZpZX6-cJSC0h8u3Ncg79QoGAIMHVApSRVdZ_Xqt7T6s-vFwwwBB0SRvuLTwTMVzhVyJ7rpdluwoGlljKT3Sek2OoyuHko2yYdCI9zMUJnx4TmMI7F5X-M6vD3j05LgjFg4BFFb53el0F9jXRxH4RHpa9ozHBwCmTh_g_j0mdWXiW2dNLr0S5iCLU10Y87YNlLR-nJCwWO9oZNYdKrVL_PCuK1XsbazVWdbIM6aui8ML23ZIa1EWQOcM7cIQQil6hsCHdylZkA8ctjPmsJhwmFJzFWw [root@hecs-x-medium-2-linux-20200711102537 ~]# microk8s kubectl get pods --all-namespaces|grep dashboard kube-system dashboard-metrics-scraper-59f5574d4-b7b4b 1/1 Running 2 6h37m kube-system kubernetes-dashboard-6d97855997-8bnsq 1/1 Running 2 6h37m [root@hecs-x-medium-2-linux-20200711102537 ~]# microk8s kubectl describe --namespace kube-system pod/kubernetes-dashboard-6d97855997-8bnsq Name: kubernetes-dashboard-6d97855997-8bnsq Namespace: kube-system Priority: 0 Node: hecs-x-medium-2-linux-20200711102537/192.168.0.192 Start Time: Sat, 11 Jul 2020 15:17:27 +0800 Labels: k8s-app=kubernetes-dashboard pod-template-hash=6d97855997 Annotations: <none> Status: Running IP: 10.1.86.17 IPs: IP: 10.1.86.17 Controlled By: ReplicaSet/kubernetes-dashboard-6d97855997 Containers: kubernetes-dashboard: Container ID: containerd://0b24cf77ea2d3881bcabfda1c6c5eb70aa021f6abb7c0ee6118a57816783595b Image: kubernetesui/dashboard:v2.0.0 Image ID: docker.io/kubernetesui/dashboard@sha256:06868692fb9a7f2ede1a06de1b7b32afabc40ec739c1181d83b5ed3eb147ec6e Port: 8443/TCP Host Port: 0/TCP Args: --auto-generate-certificates --namespace=kube-system State: Running Started: Sat, 11 Jul 2020 20:16:04 +0800 Last State: Terminated Reason: Unknown Exit Code: 255 Started: Sat, 11 Jul 2020 18:54:24 +0800 Finished: Sat, 11 Jul 2020 20:15:55 +0800 Ready: True Restart Count: 2 Liveness: http-get https://:8443/ delay=30s timeout=30s period=10s #success=1 #failure=3 Environment: <none> Mounts: /certs from kubernetes-dashboard-certs (rw) /tmp from tmp-volume (rw) /var/run/secrets/kubernetes.io/serviceaccount from kubernetes-dashboard-token-zwxvg (ro) Conditions: Type Status Initialized True Ready True ContainersReady True PodScheduled True Volumes: kubernetes-dashboard-certs: Type: Secret (a volume populated by a Secret) SecretName: kubernetes-dashboard-certs Optional: false tmp-volume: Type: EmptyDir (a temporary directory that shares a pod's lifetime) Medium: SizeLimit: <unset> kubernetes-dashboard-token-zwxvg: Type: Secret (a volume populated by a Secret) SecretName: kubernetes-dashboard-token-zwxvg Optional: false QoS Class: BestEffort Node-Selectors: <none> Tolerations: node-role.kubernetes.io/master:NoSchedule node.kubernetes.io/not-ready:NoExecute for 300s node.kubernetes.io/unreachable:NoExecute for 300s Events: <none> [root@hecs-x-medium-2-linux-20200711102537 ~]# microk8s kubectl port-forward --namespace=kube-system --address=0.0.0.0 pod/kubernetes-dashboard-59f5574d4-b7b4b 9443:8443 Error from server (NotFound): pods "kubernetes-dashboard-59f5574d4-b7b4b" not found [root@hecs-x-medium-2-linux-20200711102537 ~]# microk8s kubectl port-forward --namespace=kube-system --address=0.0.0.0 pod/kubernetes-dashboard-6d97855997-8bnsq 9443:8443 Forwarding from 0.0.0.0:9443 -> 8443 Handling connection for 9443 E0711 22:05:43.366887 26062 portforward.go:385] error copying from local connection to remote stream: read tcp4 127.0.0.1:9443->127.0.0.1:52624: read: connection reset by peer login as: root root@111.17.169.203's password: Last login: Sat Jul 11 22:05:24 2020 from 49.95.252.151 Welcome to Huawei Cloud Service [root@hecs-x-medium-2-linux-20200711102537 ~]# netstat -ntlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:44439 0.0.0.0:* LISTEN 594/containerd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1457/master tcp 0 0 127.0.0.1:1338 0.0.0.0:* LISTEN 594/containerd tcp 0 0 0.0.0.0:32000 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 0.0.0.0:9443 0.0.0.0:* LISTEN 26062/kubectl tcp 0 0 127.0.0.1:10248 0.0.0.0:* LISTEN 595/kubelet tcp 0 0 0.0.0.0:25000 0.0.0.0:* LISTEN 801/python3 tcp 0 0 127.0.0.1:10249 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 0.0.0.0:10443 0.0.0.0:* LISTEN 24260/kubectl tcp 0 0 127.0.0.1:10251 0.0.0.0:* LISTEN 598/kube-scheduler tcp 0 0 127.0.0.1:10252 0.0.0.0:* LISTEN 603/kube-controller tcp 0 0 127.0.0.1:2380 0.0.0.0:* LISTEN 597/etcd tcp 0 0 127.0.0.1:10256 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1706/sshd tcp6 0 0 ::1:25 :::* LISTEN 1457/master tcp6 0 0 :::16443 :::* LISTEN 608/kube-apiserver tcp6 0 0 :::12379 :::* LISTEN 597/etcd tcp6 0 0 :::10250 :::* LISTEN 595/kubelet tcp6 0 0 :::10255 :::* LISTEN 595/kubelet tcp6 0 0 :::10257 :::* LISTEN 603/kube-controller tcp6 0 0 :::10259 :::* LISTEN 598/kube-scheduler tcp6 0 0 :::22 :::* LISTEN 1706/sshd [root@hecs-x-medium-2-linux-20200711102537 ~]# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1) [root@hecs-x-medium-2-linux-20200711102537 ~]# login as: root root@111.17.169.203's password: Last login: Sat Jul 11 22:20:05 2020 from 183.210.229.153 Welcome to Huawei Cloud Service [root@hecs-x-medium-2-linux-20200711102537 ~]# netstat -ntlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:44439 0.0.0.0:* LISTEN 594/containerd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1457/master tcp 0 0 127.0.0.1:1338 0.0.0.0:* LISTEN 594/containerd tcp 0 0 0.0.0.0:32000 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 0.0.0.0:9443 0.0.0.0:* LISTEN 26062/kubectl tcp 0 0 127.0.0.1:10248 0.0.0.0:* LISTEN 595/kubelet tcp 0 0 0.0.0.0:25000 0.0.0.0:* LISTEN 801/python3 tcp 0 0 127.0.0.1:10249 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 0.0.0.0:10443 0.0.0.0:* LISTEN 24260/kubectl tcp 0 0 127.0.0.1:10251 0.0.0.0:* LISTEN 598/kube-scheduler tcp 0 0 127.0.0.1:10252 0.0.0.0:* LISTEN 603/kube-controller tcp 0 0 127.0.0.1:2380 0.0.0.0:* LISTEN 597/etcd tcp 0 0 127.0.0.1:10256 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1706/sshd tcp6 0 0 ::1:25 :::* LISTEN 1457/master tcp6 0 0 :::16443 :::* LISTEN 608/kube-apiserver tcp6 0 0 :::12379 :::* LISTEN 597/etcd tcp6 0 0 :::10250 :::* LISTEN 595/kubelet tcp6 0 0 :::10255 :::* LISTEN 595/kubelet tcp6 0 0 :::10257 :::* LISTEN 603/kube-controller tcp6 0 0 :::10259 :::* LISTEN 598/kube-scheduler tcp6 0 0 :::22 :::* LISTEN 1706/sshd [root@hecs-x-medium-2-linux-20200711102537 ~]# kill -9 26062 [root@hecs-x-medium-2-linux-20200711102537 ~]# netstat -ntlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:44439 0.0.0.0:* LISTEN 594/containerd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1457/master tcp 0 0 127.0.0.1:1338 0.0.0.0:* LISTEN 594/containerd tcp 0 0 0.0.0.0:32000 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 127.0.0.1:10248 0.0.0.0:* LISTEN 595/kubelet tcp 0 0 0.0.0.0:25000 0.0.0.0:* LISTEN 801/python3 tcp 0 0 127.0.0.1:10249 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 0.0.0.0:10443 0.0.0.0:* LISTEN 24260/kubectl tcp 0 0 127.0.0.1:10251 0.0.0.0:* LISTEN 598/kube-scheduler tcp 0 0 127.0.0.1:10252 0.0.0.0:* LISTEN 603/kube-controller tcp 0 0 127.0.0.1:2380 0.0.0.0:* LISTEN 597/etcd tcp 0 0 127.0.0.1:10256 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1706/sshd tcp6 0 0 ::1:25 :::* LISTEN 1457/master tcp6 0 0 :::16443 :::* LISTEN 608/kube-apiserver tcp6 0 0 :::12379 :::* LISTEN 597/etcd tcp6 0 0 :::10250 :::* LISTEN 595/kubelet tcp6 0 0 :::10255 :::* LISTEN 595/kubelet tcp6 0 0 :::10257 :::* LISTEN 603/kube-controller tcp6 0 0 :::10259 :::* LISTEN 598/kube-scheduler tcp6 0 0 :::22 :::* LISTEN 1706/sshd [root@hecs-x-medium-2-linux-20200711102537 ~]# microk8s kubectl port-forward --namespace=kube-system --address=0.0.0.0 pod/kubernetes-dashboard-6d97855997-8bnsq 8443:8443 Forwarding from 0.0.0.0:8443 -> 8443 ^C[root@hecs-x-medium-2-linux-20200711102537 ~]netstat -ntlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:44439 0.0.0.0:* LISTEN 594/containerd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1457/master tcp 0 0 127.0.0.1:1338 0.0.0.0:* LISTEN 594/containerd tcp 0 0 0.0.0.0:32000 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 127.0.0.1:10248 0.0.0.0:* LISTEN 595/kubelet tcp 0 0 0.0.0.0:25000 0.0.0.0:* LISTEN 801/python3 tcp 0 0 127.0.0.1:10249 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 0.0.0.0:10443 0.0.0.0:* LISTEN 24260/kubectl tcp 0 0 127.0.0.1:10251 0.0.0.0:* LISTEN 598/kube-scheduler tcp 0 0 127.0.0.1:10252 0.0.0.0:* LISTEN 603/kube-controller tcp 0 0 127.0.0.1:2380 0.0.0.0:* LISTEN 597/etcd tcp 0 0 127.0.0.1:10256 0.0.0.0:* LISTEN 596/kube-proxy tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1706/sshd tcp6 0 0 ::1:25 :::* LISTEN 1457/master tcp6 0 0 :::16443 :::* LISTEN 608/kube-apiserver tcp6 0 0 :::12379 :::* LISTEN 597/etcd tcp6 0 0 :::10250 :::* LISTEN 595/kubelet tcp6 0 0 :::10255 :::* LISTEN 595/kubelet tcp6 0 0 :::10257 :::* LISTEN 603/kube-controller tcp6 0 0 :::10259 :::* LISTEN 598/kube-scheduler tcp6 0 0 :::22 :::* LISTEN 1706/sshd [root@hecs-x-medium-2-linux-20200711102537 ~]# microk8s kubectl port-forward --namespace=kube-system --address=0.0.0.0 pod/kubernetes-dashboard-6d97855997-8bnsq 8443:8443 Forwarding from 0.0.0.0:8443 -> 8443 |
0