Create a Kubernetes-dashboard
In the previous article (SEE), deploy the Kubernetes-dashboard Based on the deployed kubernetes. It is an official user management Kubernets cluster visualization tool; deploying a dashboard is the same as deploying other applications in kubernets. Just create the Replication Controller and Service services required by the dashboard;
Note that the Overlay Network of Kubernets should work properly. Each node has started Flannel, And the subnet provided by Flannel is configured during docker startup, or other methods are used to ensure the connectivity between containers, otherwise, the dashboard will not work properly;
Namespace
You can also use the default Namespace. Because the dashboard is a system application, you can use Namespace to isolate the dashboard from other apps. We recommend that you use Namespace in the formal online Kubernetes environment;
Create a kube-namespace.yaml file with the following content:
apiVersion: v1 kind: Namespace metadata: name: kube-system
Replication Controller
Replication Controller is used to ensure that the expected pod status is consistent with the current status, and the number of pods can be elastically scaled. This mainly ensures the normal operation of the dashboard;
Create a kube-dashboard-rc.yaml file with the following content:
apiVersion: v1kind: ReplicationControllermetadata:# Keep the name in sync with image version and# gce/coreos/kube-manifests/addons/dashboard counterpartsname: kubernetes-dashboard-latestnamespace: kube-systemlabels: k8s-app: kubernetes-dashboardversion: latestkubernetes.io/cluster-service: "true"spec: replicas: 1selector: k8s-app: kubernetes-dashboardtemplate: metadata: labels: k8s-app: kubernetes-dashboard version: latest kubernetes.io/cluster-service: "true" spec: containers: - name: kubernetes-dashboard image: 192.168.2.144:5000/kkubernetes-dashboard-amd64 resources: # keep request = limit to keep this container in guaranteed class limits: cpu: 100m memory: 50Mi requests: cpu: 100m memory: 50Mi ports: - containerPort: 9090 args: - --apiserver-host=http://192.168.2.143:8080 livenessProbe: httpGet: path: / port: 9090 initialDelaySeconds: 30 timeoutSeconds: 30
Because the kubernetes-dashboard-amd64 is going to be walled, it's down here;
Service
Service is used to configure the label selector of the dashboard;
Create a kube-dashboard-svc.yaml file with the following content:
apiVersion: v1kind: Servicemetadata: name: kubernetes-dashboard namespace: kube-system labels: k8s-app: kubernetes-dashboard kubernetes.io/cluster-service: "true"spec: selector: k8s-app: kubernetes-dashboard ports: - port: 80 targetPort: 9090
Create a dashboard application in kubernates
1. Create a namespace
kubectl -s 192.168.2.143:8080 create -f namespace.yaml
2. Create a replication Controller
kubectl -s 192.168.2.143:8080 create -f kube-dashboard-rc.yaml
3. Create a service
kubectl -s 192.168.2.143:8080 create -f kube-dashboard-svc.yaml
View dashboard startup status
Kubernetes dashboard access address: http: // 192.168.2.143: 8080/ui note that the address here is the address of the master node;
Kubernetes cluster deployment
OpenStack, Kubernetes, and Mesos
Problems encountered during Kubernetes cluster construction and Solutions
For details about Kubernetes, click here
Kubernetes: click here
This article permanently updates the link address: