CentOS7 Build Kubernetes Dashboard

Source: Internet
Author: User
Tags k8s kubernetes dashboard

CentOS7 Build Kubernetes Dashboard
An environmental statement
Centos7 Three, master node one, node nodes two
Dashboard requires a mirror and requires a command download:
Docker Pull mritd/kubernetes-dashboard-amd64:v1.5.1
PS: There are many other mirrors can also build dashboard, but this version is the Chinese version of

Note: All two node nodes need to download this image, the master node does not, because the dashboard pod is scheduled to be created by master to one of the two node, not created locally on master.

two. Action
The following actions are all performed on the master node:
1. Edit Dashboard-controller.yaml, create dashboard pod
Pay attention to modifying the part of the red font!
Vim Dashboard-controller.yaml, with the following contents:

APIVERSION:EXTENSIONS/V1BETA1
Kind:deployment
Metadata:
Name:kubernetes-dashboard
Namespace: Kube-system
Labels:
k8s-app:kubernetes-dashboard
Kubernetes.io/cluster-service: "True"
Spec:
Selector:
Matchlabels:
k8s-app:kubernetes-dashboard
Template:
Metadata:
Labels:
K8s-app: Kubernetes-dashboard
Annotations:
Scheduler.alpha.kubernetes.io/critical-pod: '
Scheduler.alpha.kubernetes.io/tolerations: ' [{' key ': ' criticaladdonsonly ', ' operator ': ' Exists '}] '
Spec:
Containers:

  • Name:kubernetes-dashboard
    image:mritd/kubernetes-dashboard-amd64:v1.5.1
    Imagepullpolicy:ifnotpresent
    Resources
    Limits
    cpu:100m
    Memory:50mi
    Requests:
    cpu:100m
    Memory:50mi
    Ports

      • --apiserver-host=http://10.0.2.90:8080
        Livenessprobe:
        HttpGet:
        Path:/
        port:9090
        Initialdelayseconds:30
        Timeoutseconds:30

      • containerport:9090
        Args

    Red font Explanation:

      1. Mritd/kubernetes-dashboard-amd64: V1.5.1:dashboard Mirror, if you are not this image, be careful to modify the

      2. --apiserver-host=http:// 10.0.2.90:8080, fill in your master's apiserver address, the default port is generally 8080

    ===========================================================

    ok, now start editing dashboard-service.yaml, mapping the dashboard access port to the ports of two node host hosts for external access.
    Vim Dashboard-service.yaml with the following contents:
    Apiversion:v1
    Kind:service
    Metadata:
    Name:kubernetes-dashboard
    Namespace:kube-system
    Labels:
    k8s-app:kubernetes-dashboard
    Kubernetes.io/cluster-service: "true"
    Spec:
    Type:nodeport
    Selector:
    K8s-app:kubernetes-dashboard
    Ports:

      • port:80
        targetport:9090
        NodePort: 30003

    Red font Explanation:
    Port refers to service ports
    Targetport refers to the port of the pod
    Nodeport is the port where the host is node, k8s external Access dashboard

    Create dashboard
    Kubectl create-f dashboard-controller.yaml
    Results display: Deployment "Kubernetes-dashboard" created

    kubectl create-f Dashboard-service.yaml
    Results display: Service "Kubernetes-dashboard" created

    View creation Result:
    [[email protected] yaml]# kubectl get pods--namespace=kube-system-o wide
    NAME ready STATUS Restarts age IP NODE
    Kubernetes-dashboard-56bc76b6bb-b6kfx 1/1 Running 0 32s 172.18.0.194 node1

    [[email protected] yaml]# kubectl Get svc--namespace=kube-system
    NAME TYPE cluster-ip external-ip PORT (S) age< Br>kubernetes-dashboard nodeport 172.18.0.196 <none> 80:30003/tcp 13s

    OK, create the success, next can access the node node (two nodes can choose one) 30003-port experience Kubernetes-dashboard through the browser:


    CentOS7 Build Kubernetes Dashboard

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.