Kubernetes1.5 Integrated Dashboard
Configuring the Kubernetes dashboard is relatively straightforward. Similarly, only need to obtain the Dashboard-controller.yaml and Dashboard-service.yaml files from the source code, slightly modify can:
wget Https://rawgit.com/kubernetes/kubernetes/master/cluster/addons/dashboard/dashboard-controller.yamlwget Https://rawgit.com/kubernetes/kubernetes/master/cluster/addons/dashboard/dashboard-service.yaml
Modify the Dashboard-controller.yaml as follows:
Kind:deploymentapiversion:extensions/v1beta1metadata:labels:app:kubernetes-dashboard Name:kubernetes-dashboard Namespace:kube-systemspec:replicas:1 revisionhistorylimit:10 Selector:matchlabels:app:kubernetes-dashbo ARD Template:metadata:labels:app:kubernetes-dashboard # Comment The following annotation if DASHB Oard must not being deployed on Master annotations:scheduler.alpha.kubernetes.io/tolerations: | [{"Key": "Dedicated", "operator": "Equal", "Value": "Master", "Effect": "Noschedule"}] spec:containers:-Name:kubernetes-dashboard ima ge:myhub.fdccloud.com/library/kubernetes-dashboard-amd64:v1.5.1 imagepullpolicy:always ports:-Con tainerport:9090 protocol:tcp args: # Uncomment the following line to manually specify Kubernete s API Server Host # If Not specified, Dashboard would attempt to auto discover the API server and connect # to it. Uncomment only if the default does isn't work.
#额外增加---apiserver-host=http://10.5.10.116:8080 LivenessProbe:httpGet:path:/ port:9090 initialdelayseconds:30 timeoutseconds:30
Dashboard-service.yaml do not need to modify, here directly to the source of the sample files:
Kind:ServiceapiVersion:v1metadata: Labels: app:kubernetes-dashboard Name:kubernetes-dashboard Namespace:kube-systemspec: type:nodeport ports: -port:80 targetport:9090 selector: App:kubernetes-dashboard
To perform a startup:
Kubectl create-f dashboard-controller.yamlkubectl create-f Dashboard-service.yaml
Once started, you can view the nodeport of the map by following these instructions:
[[email protected] kubernetes]# kubectl Get svc--namespace=kube-systemname cluster-ip external-ip PORT ( S) agekube-dns 10.254.0.100 <none> 53/udp,53/tcp 5hkubernetes-dashboard 10.254.68.60 <nodes> 80:30097/tcp 1d
The following access addresses are available for access:
http://10.5.10.116:8080/uihttp://10.5.10.116:30097
Dashboard interface
Error Description:
During the actual configuration process, it was found that dashboard could not be started, and the pod log was viewed through KUBECTL logs as follows:
# Kubectl Logs--namespace=kube-system < container name >
Using HTTP Port:9090error While initializing connection to Kubernetes Apiserver. This likely means, the cluster is Misconfigurhas invalid apiserver certificates or service accounts configuration ) or the--apiserver-host param points to a ser is not exist. Reason:invalid configuration:no configuration has been providedrefer to the troubleshooting guide for more information: Https://github.com/kubernetes/dashboard/blob/master/docs/uubleshooting.md
This error is due to the need to add the following parameters to the dashboard startup args parameter:
--apiserver-host=http://10.5.10.116:8080
In addition, we found that this dashboard visit does not have any authentication and authorization mechanism, and the follow-up will be dedicated to Kubernetes certification mechanism to do the relevant instructions.
Kubernetes1.5 Integrated Dashboard