multipass exec microk8s-vm -- /snap/bin/microk8s.enable dns dashboard Enabling DNS Applying manifest service/kube-dns created serviceaccount/kube-dns created configmap/kube-dns created deployment.extensions/kube-dns created Restarting kubelet DNS is enabled Enabling dashboard secret/kubernetes-dashboard-certs created serviceaccount/kubernetes-dashboard created deployment.apps/kubernetes-dashboard created service/kubernetes-dashboard created service/monitoring-grafana created service/monitoring-influxdb created service/heapster created deployment.extensions/monitoring-influxdb-grafana-v4 created serviceaccount/heapster created configmap/heapster-config created configmap/eventer-config created deployment.extesions/heapster-v1.5.2 created dashboard enabled
接下来,用下面命令检查部署进程:
1
multipass exec microk8s-vm -- /snap/bin/microk8s.kubectl get all --all-namespaces
返回信息如下:
一旦所有的必要服务已开启,接下来使用以下的链接访问仪表。命令如下:
1 2 3 4 5 6 7 8
multipass exec microk8s-vm -- /snap/bin/microk8s.kubectl cluster-info Kubernetes master is running at https://127.0.0.1:16443 Heapster is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/heapster/proxy KubeDNS is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy Grafana is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy InfluxDB is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-influxdb:http/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
如果我们在 VM 内,可以用此链接来访问 Grafana 仪表。不过,我们可以通过代理在主机上访问。
1 2
multipass exec microk8s-vm -- /snap/bin/microk8s.kubectl proxy --address='0.0.0.0'--accept-hosts='.*' Starting to serve on [::][::]:8001
保持终端运行状态,记一下端口号(8001),我们在下一步需要用到。要访问 Grafana 仪表,我们需要修改 VM 内仪表的链接:
使用 VM 的 IP 替换 127.0.0.1(multipass info microk8s-vm)