千家信息网

Kubernetes安装dashboard的步骤

发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,这篇文章主要讲解了"Kubernetes安装dashboard的步骤",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Kubernetes安装dashbo
千家信息网最后更新 2026年11月01日Kubernetes安装dashboard的步骤

这篇文章主要讲解了"Kubernetes安装dashboard的步骤",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Kubernetes安装dashboard的步骤"吧!

1. 准备工作

参看CentOS7配置Kubernetes(K8S)集群 这里使用k8s版本为1.5.2

2. 准备yaml

# Copyright 2015 Google Inc. All Rights Reserved.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at##     http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.# Configuration to deploy release version of the Dashboard UI.## Example usage: kubectl create -f kind: DeploymentapiVersion: extensions/v1beta1metadata:  labels:    app: kubernetes-dashboard    version: latest  name: kubernetes-dashboard  namespace: kube-systemspec:  replicas: 1  selector:    matchLabels:      app: kubernetes-dashboard  template:    metadata:      labels:        app: kubernetes-dashboard      # Comment the following annotation if Dashboard must not be deployed on master      annotations:        scheduler.alpha.kubernetes.io/tolerations: |          [            {              "key": "dedicated",              "operator": "Equal",              "value": "master",              "effect": "NoSchedule"            }          ]    spec:      containers:      - name: kubernetes-dashboard        image: docker.io/googlecontainer/kubernetes-dashboard-amd64:v1.6.1        imagePullPolicy: Always        ports:        - containerPort: 9090          protocol: TCP        args:          # Uncomment the following line to manually specify Kubernetes API server Host          # If not specified, Dashboard will attempt to auto discover the API server and connect          # to it. Uncomment only if the default does not work.          - --apiserver-host=192.168.0.51:8080        livenessProbe:          httpGet:            path: /            port: 9090          initialDelaySeconds: 30          timeoutSeconds: 30---kind: ServiceapiVersion: v1metadata:  labels:    app: kubernetes-dashboard  name: kubernetes-dashboard  namespace: kube-systemspec:  type: NodePort  ports:  - port: 80    targetPort: 9090  selector:    app: kubernetes-dashboard

3. 启动

kubectl apply -f k8s-dashboard.yaml

4. 注意事项

4.1 kubelet

#### kubernetes kubelet (minion) config# The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)KUBELET_ADDRESS="--address=0.0.0.0"# The port for the info server to serve on# KUBELET_PORT="--port=10250"# You may leave this blank to use the actual hostnameKUBELET_HOSTNAME="--hostname-override=192.168.0.51"# location of the api-serverKUBELET_API_SERVER="--api-servers=http://192.168.0.51:8080"# pod infrastructure containerKUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=docker.io/openshift/origin-pod:latest"# Add your own!KUBELET_ARGS=""

将这里的ip地址修改为0.0.0.0和192.168.0.51(master地址),这里将pod-infra指向本地镜像pod-infra-container-image=docker.io/openshift/origin-pod:latest,需要在master和slave端都配置一遍

4.2 apiserver

#### kubernetes system config## The following values are used to configure the kube-apiserver## The address on the local server to listen to.KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0"# The port on the local server to listen on.# KUBE_API_PORT="--port=8080"# Port minions listen on# KUBELET_PORT="--kubelet-port=10250"# Comma separated list of nodes in the etcd clusterKUBE_ETCD_SERVERS="--etcd-servers=http://192.168.0.51:2379"# Address range to use for servicesKUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"# default admission control policies#KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ResourceQuota"# Add your own!KUBE_API_ARGS=""

这里去除账号验证

4.3 pod-infrastructure

安装Pod时需要用到这个镜像,提前准备,不然会因为GW的原因下不到

[root@k8s-master elk]# docker search pod-infrastructureINDEX       NAME                                                DESCRIPTION                                     STARS     OFFICIAL   AUTOMATEDdocker.io   docker.io/openshift/origin-pod                      The pod infrastructure image for OpenShift 3    8docker.io   docker.io/davinkevin/podcast-server                 Container around the Podcast-Server Applic...   5docker.io   docker.io/infrastructureascode/aws-cli              Containerized AWS CLI on alpine to avoid r...   4                    [OK]docker.io   docker.io/newrelic/infrastructure                   Public image for New Relic Infrastructure.      4docker.io   docker.io/infrastructureascode/uwsgi                uWSGI application server                        2                    [OK]docker.io   docker.io/infrastructureascode/serf                 A tiny Docker image with HashiCorp Serf us...   1                    [OK]docker.io   docker.io/mosquitood/k8s-rhel7-pod-infrastructure                                                   1docker.io   docker.io/podigg/podigg-lc-hobbit                   A HOBBIT dataset generator wrapper for PoDiGG   1                    [OK]docker.io   docker.io/stefanprodan/podinfo                      Kubernetes multi-arch pod info                  1docker.io   docker.io/tianyebj/pod-infrastructure               registry.access.redhat.com/rhel7/pod-infra...   1docker.io   docker.io/w564791/pod-infrastructure                latest                                          1docker.io   docker.io/grapeupci/infrastructure                                                                  0docker.io   docker.io/infrastructureascode/hello-world          A tiny "Hello World" web server with a hea...   0                    [OK]docker.io   docker.io/jqka/pod-infrastructure                   redhat pod                                      0                    [OK]docker.io   docker.io/ocpqe/hello-pod                           Copy form docker.io/deshuai/hello-pod:latest    0docker.io   docker.io/oudi/pod-infrastructure                   pod-infrastructure                              0                    [OK]docker.io   docker.io/sebastianhutter/podcaster                 python script to download podcasts https:/...   0                    [OK]docker.io   docker.io/shadowalker911/pod-infrastructure                                                         0docker.io   docker.io/statemood/pod-infrastructure              Automated build from registry.access.redha...   0                    [OK]docker.io   docker.io/tfgco/podium                              Podium is a blazing-fast player ranking se...   0docker.io   docker.io/trancong/pod2consul                       register pod with consul                        0docker.io   docker.io/tundradotcom/podyn                        dockerized Podyn                                0docker.io   docker.io/vistalba/podget                           Podget Docker with rename included.             0                    [OK]docker.io   docker.io/xplenty/rhel7-pod-infrastructure          registry.access.redhat.com/rhel7/pod-infra...   0docker.io   docker.io/zengshaoyong/pod-infrastructure           pod-infrastructure                              0                    [OK]

下载一个镜像

[root@k8s-master elk]# docker pull docker.io/openshift/origin-pod

同样的原因,提前准备dashboard的镜像

[root@k8s-master es]# docker search kubernetes-dashboardINDEX       NAME                                                            DESCRIPTION                                     STARS     OFFICIAL   AUTOMATEDdocker.io   docker.io/mritd/kubernetes-dashboard-amd64                      kubernetes image kubernetes-dashboard-amd64     23                   [OK]docker.io   docker.io/brainqi/kubernetes-dashboard-amd64                    full from gcr.io/google_containers/kuberne...   6docker.io   docker.io/ist0ne/kubernetes-dashboard-amd64                     https://gcr.io/google_containers/kubernete...   6                    [OK]docker.io   docker.io/k8scn/kubernetes-dashboard-amd64                      kubernetes-dashboard-amd64 image                6                    [OK]docker.io   docker.io/kubernetesdashboarddev/kubernetes-dashboard-amd64                                                     6docker.io   docker.io/siriuszg/kubernetes-dashboard-amd64                   gcr.io/google_containers/kubernetes-dashbo...   6                    [OK]docker.io   docker.io/mirrorgooglecontainers/kubernetes-dashboard-amd64                                                     4docker.io   docker.io/larry0208/kubernetes-dashboard-amd64-google           full from gcr.io/google_containers/kuberne...   3docker.io   docker.io/4admin2root/kubernetes-dashboard-amd64                gcr.io/google_containers/kubernetes-dashbo...   1                    [OK]docker.io   docker.io/kubernetesonarm/dashboard                                                                             1docker.io   docker.io/lhcalibur/kubernetes-dashboard-amd64                  kubernetes-dashboard-amd64                      1                    [OK]docker.io   docker.io/zounengren/kubernetes-dashboard-amd64                 kubernetes dashboard 1.8.0 for kubernetes ...   1docker.io   docker.io/cokabug/kubernetes-dashboard-amd64                    kubernetes-dashboard-amd64                      0                    [OK]docker.io   docker.io/gysan/kubernetes-dashboard-amd64                      gcr.io/google-containers/kubernetes-dashbo...   0                    [OK]docker.io   docker.io/huanwei/kubernetes-dashboard-amd64                    kubernetes-dashboard-amd64                      0                    [OK]docker.io   docker.io/kubernetesdashboarddev/kubernetes-dashboard-arm                                                       0docker.io   docker.io/kubernetesdashboarddev/kubernetes-dashboard-arm64                                                     0docker.io   docker.io/kubernetesdashboarddev/kubernetes-dashboard-ppc64le                                                   0docker.io   docker.io/kubernetesdashboarddev/kubernetes-dashboard-s390x                                                     0docker.io   docker.io/linkmancheng/kubernetes-dashboard-amd64               kubernetes-dashboard-amd64                      0                    [OK]docker.io   docker.io/lolop82/kubernetes-dashboard                                                                          0docker.io   docker.io/rainf/kubernetes-dashboard-amd64                      kubernetes-dashboard-amd64:v1.5.1               0                    [OK]docker.io   docker.io/steady1211/kubernetes-dashboard-amd64                 kubernetes-dashboard-amd64 v1.6.1               0                    [OK]docker.io   docker.io/tristan129/kubernetes-dashboard-amd64                 mirror from gcr.io/google_containers/kuber...   0docker.io   docker.io/visenzek8s/kubernetes-dashboard-amd64                                                                 0

这里我选择第一个镜像

docker pull docker.io/mritd/kubernetes-dashboard-amd64

镜像准备,在master和slave端都进行准备

5. 进入界面

通过http://192.168.0.51:8080/ui进入页面,即主机ip和apiserver端口

感谢各位的阅读,以上就是"Kubernetes安装dashboard的步骤"的内容了,经过本文的学习后,相信大家对Kubernetes安装dashboard的步骤这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!

镜像 准备 步骤 学习 内容 原因 地址 配置 验证 主机 事项 就是 思路 情况 指向 文章 更多 注意事项 版本 界面 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 天津市摩尔互联网科技 互联网科技网 北京路客互联网科技有限公司 互联网科技公司华为 互联网科技财经 银优互联网科技有限公司 睿民互联网科技 互联网科技logo 佩信高科技互联网 衡水科技产业互联网平台 富国互联网科技创新基金 承德科技产业互联网发展 来此购互联网科技有限公司 湖南一路畅行互联网科技 乌苏新华互联网科技做什么的 中国互联网公司排名锤子科技 南通创西澳互联网科技有限公司 华人运通互联网科技公司 瑞安市蟠桃会互联网科技有限公司 中国主要互联网科技公司 重庆威客帮互联网科技 来此购互联网科技有限公司 互联网科技革命什么开始 华夏互联网科技业 河南住房之家互联网科技 每天都有哪些好的互联网科技 半导体行业属于互联网高科技类吗 易企秀互联网科技是做什么的 上海乐五互联网科技有限公司 青岛易易互联网科技
0