k8s安装dashboard

1、Kubernetes Dashboard 是 k8s集群的?个 WEB UI管理?具,代码托管在 github 上,地址:

https://github.com/kubernetes/dashboard

 2、安装直接使用官方文件就行(如果地址失效去github 看一下)

wget   https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml

kubectl apply -f  kubernetes-dashboard.yaml

 3、我在master执行完现在如下

[[email protected] ~]# kubectl get pods --all-namespaces
NAMESPACE     NAME                                    READY   STATUS    RESTARTS   AGE
kube-system   coredns-576cbf47c7-2g27x                1/1     Running   0          18h
kube-system   coredns-576cbf47c7-47mgd                1/1     Running   0          18h
kube-system   etcd-master                             1/1     Running   0          18h
kube-system   kube-apiserver-master                   1/1     Running   0          18h
kube-system   kube-controller-manager-master          1/1     Running   0          18h
kube-system   kube-flannel-ds-amd64-hw277             1/1     Running   4          18h
kube-system   kube-flannel-ds-amd64-j5jcr             1/1     Running   1          18h
kube-system   kube-proxy-8tfsp                        1/1     Running   1          18h
kube-system   kube-proxy-k6k79                        1/1     Running   0          18h
kube-system   kube-scheduler-master                   1/1     Running   0          18h
kube-system   kubernetes-dashboard-65c76f6c97-htfxt   1/1     ImagePullBackOff 0 18h
 #ImagePullBackOff:这个状态是有问题的,然后我就各种百度,从启服务器,发下没有什么卵用啊,初学就是比较费劲,然后才百度出来下面的解决方法
[[email protected] ~]# kubectl describe -n kube-system pod/kubernetes-dashboard-65c76f6c97-htfxt
Name:               kubernetes-dashboard-65c76f6c97-htfxt
Namespace:          kube-system
Priority:           0
PriorityClassName:  <none>
Node:               node01/172.21.0.14
Start Time:         Sun, 13 Oct 2019 19:42:52 +0800
Labels:             k8s-app=kubernetes-dashboard
                    pod-template-hash=65c76f6c97
Annotations:        <none>
Status:             Running
IP:                 10.244.1.3
Controlled By:      ReplicaSet/kubernetes-dashboard-65c76f6c97
Containers:
  kubernetes-dashboard:
    Container ID:  docker://7f9d2b3f22112c761af8c451376fb2155ac2014f7c13a4a7cda8ebcefebb0de3
    Image:         k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1
    Image ID:      docker://sha256:f9aed6605b814b69e92dece6a50ed1e4e730144eb1cc971389dde9cb3820d124
    Port:          8443/TCP
    Host Port:     0/TCP
    Args:
      --auto-generate-certificates
    State:          Running
      Started:      Sun, 13 Oct 2019 20:20:58 +0800
    Ready:          True
    Restart Count:  0
    Liveness:       http-get https://:8443/ delay=30s timeout=30s period=10s #success=1 #failure=3
    Environment:    <none>
    Mounts:
      /certs from kubernetes-dashboard-certs (rw)
      /tmp from tmp-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kubernetes-dashboard-token-m4s7k (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  kubernetes-dashboard-certs:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  kubernetes-dashboard-certs
    Optional:    false
  tmp-volume:
    Type:    EmptyDir (a temporary directory that shares a pod‘s lifetime)
    Medium:
  kubernetes-dashboard-token-m4s7k:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  kubernetes-dashboard-token-m4s7k
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node-role.kubernetes.io/master:NoSchedule
                 node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason                  Age                 From               Message
  ----     ------                  ----                ----               -------
  Normal   Scheduled               60m                 default-scheduler  Successfully assigned kube-system/kubernetes-dashboard-65c76f6c97-htfxt to node01
  Normal   Pulling                 58m (x4 over 60m)   kubelet, node01    pulling image "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1"
  Warning  Failed                  58m (x4 over 60m)   kubelet, node01    Failed to pull image "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1": rpc error: code = Unknown desc = Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  Warning  Failed                  58m (x4 over 60m)   kubelet, node01    Error: ErrImagePull
  Normal   BackOff                 57m (x6 over 60m)   kubelet, node01    Back-off pulling image "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1"
  Warning  Failed                  50m (x37 over 60m)  kubelet, node01    Error: ImagePullBackOff
  Warning  FailedMount             28m                 kubelet, node01    MountVolume.SetUp failed for volume "kubernetes-dashboard-certs" : couldn‘t propagate object cache: timed out waiting for the condition
  Warning  FailedMount             28m                 kubelet, node01    MountVolume.SetUp failed for volume "kubernetes-dashboard-token-m4s7k" : couldn‘t propagate object cache: timed out waiting for the condition
  Warning  FailedCreatePodSandBox  28m                 kubelet, node01    Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "0ac235fed359b9d102282bcc816ff3de7c9e26d18270067761f5304aa998d747" network for pod "kubernetes-dashboard-65c76f6c97-htfxt": NetworkPlugin cni failed to set up pod "kubernetes-dashboard-65c76f6c97-htfxt_kube-system" network: open /run/flannel/subnet.env: no such file or directory
  Warning  FailedCreatePodSandBox  28m                 kubelet, node01    Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "233c431e6bceddf5f315f1b8aac762359202ca5a13cd4e4d2fd6a2aaf4123cd2" network for pod "kubernetes-dashboard-65c76f6c97-htfxt": NetworkPlugin cni failed to set up pod "kubernetes-dashboard-65c76f6c97-htfxt_kube-system" network: open /run/flannel/subnet.env: no such file or directory
  Normal   SandboxChanged          28m (x3 over 28m)   kubelet, node01    Pod sandbox changed, it will be killed and re-created.
  Warning  FailedCreatePodSandBox  28m                 kubelet, node01    Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "0de536b8aa18baa69b6fbdd645063b61ee7fe0fb141b063a0387872e216a6d18" network for pod "kubernetes-dashboard-65c76f6c97-htfxt": NetworkPlugin cni failed to set up pod "kubernetes-dashboard-65c76f6c97-htfxt_kube-system" network: open /run/flannel/subnet.env: no such file or directory
  Normal   Pulling                 27m (x3 over 28m)   kubelet, node01    pulling image "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1"
  Warning  Failed                  27m (x3 over 28m)   kubelet, node01    Failed to pull image "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1": rpc error: code = Unknown desc = Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  Warning  Failed                  27m (x3 over 28m)   kubelet, node01    Error: ErrImagePull
  Normal   BackOff                 26m (x4 over 28m)   kubelet, node01    Back-off pulling image "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1"
  Warning  Failed                  23m (x14 over 28m)  kubelet, node01    Error: ImagePullBackOff

结果是镜像不存在,我是阿里云所有直接从阿里云pull,在打包,然后在看,还是不行,然后又一顿百度,

docker pull  mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.1
docker tag mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.1 k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1

 一顿百度解决方法如下: 查看详细信息,发下pod在node01 上运行的,然后吧镜像save 一份到node01服务器就好了,或者直接在node01上面直接pull

[[email protected] ~]# kubectl  get pods --all-namespaces -o wide
NAMESPACE     NAME                                    READY   STATUS    RESTARTS   AGE   IP            NODE     NOMINATED NODE
kube-system   coredns-576cbf47c7-2g27x                1/1     Running   0          18h   10.244.0.4    master   <none>
kube-system   coredns-576cbf47c7-47mgd                1/1     Running   0          18h   10.244.0.5    master   <none>
kube-system   etcd-master                             1/1     Running   0          18h   172.21.0.10   master   <none>
kube-system   kube-apiserver-master                   1/1     Running   0          18h   172.21.0.10   master   <none>
kube-system   kube-controller-manager-master          1/1     Running   0          18h   172.21.0.10   master   <none>
kube-system   kube-flannel-ds-amd64-hw277             1/1     Running   4          18h   172.21.0.14   node01   <none>
kube-system   kube-flannel-ds-amd64-j5jcr             1/1     Running   1          18h   172.21.0.10   master   <none>
kube-system   kube-proxy-8tfsp                        1/1     Running   1          18h   172.21.0.14   node01   <none>
kube-system   kube-proxy-k6k79                        1/1     Running   0          18h   172.21.0.10   master   <none>
kube-system   kube-scheduler-master                   1/1     Running   0          18h   172.21.0.10   master   <none>
kube-system   kubernetes-dashboard-65c76f6c97-htfxt   1/1     Running   0          18h   10.244.1.3    node01   <none>

  

 

  

 

  

原文地址:https://www.cnblogs.com/zhaojingyu/p/11671178.html

时间: 2024-10-08 04:40:35

k8s安装dashboard的相关文章

k8s安装dashboard(未解决)

第一种,用helm安装 helm repo update Hang tight while we grab the latest from your chart repositories... ...Skip local chart repository ...Successfully got an update from the "stable" chart repository Update Complete. [root@k8s-master templates]# helm r

[k8s]kubernetes dashboard的安装

之前一直使用的是命令行,但是又觉得如果连控制台都还没有动手实践过会不会有点low 1.安装dashboard 参阅官网的安装方法,https://github.com/kubernetes/dashboard,安装很简单,如果慢可以使用其它的镜像网站,我这里使用的是mirrorgooglecontainers/kubernetes-dashboard-amd64,然后重新打了k8s.gcr.io/kubernetes-dashboard-amd64的tag 2.暴露服务 [email prote

安装 Dashboard 插件

Kubernetes Dashboard 是 k8s集群的一个 WEB UI管理工具,代码托管在 github 上,地址:https://github.com/kubernetes/dashboard 安装: 直接使用官方的配置文件安装即可: $ wget https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml 为了测试方便,我们将

kuberneets 1.17 安装 dashboard nginx-ingress

一.首先安装dashboard https://github.com/kubernetes/dashboard 需要下载的yaml文件 https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml可以进行一些修改首先是HTTPS的修改部分 containers: - name: kubernetes-dashboard image: kubernetesui/dash

Kubernetes(K8s) 安装(使用kubeadm安装Kubernetes集群)

概述: 这篇文章是为了介绍使用kubeadm安装Kubernetes集群(可以用于生产级别).使用了Centos 7系统. PS: 篇幅有点长,但是比较详细.比较全面 一.Centos7 配置说明 1.1   Firewalld(防火墙) CentOS Linux 7 默认开起来防火墙服务(firewalld),而Kubernetes的Master与工作Node之间会有大量的网络通信,安全的做法是在防火墙上配置Kbernetes各组件(api-server.kubelet等等)需要相互通信的端口

open-falcon 安装Dashboard时候报错&quot;SSLError: The read operation timed out&quot;

在部署open-falcon环境过程中,安装Dashboard时候报错"SSLError: The read operation timed out".如下: [[email protected] dashboard]# ./env/bin/pip install -r pip_requirements.txt Downloading/unpacking Flask==0.10.1 (from -r pip_requirements.txt (line 1)) Downloading

openstack M版安装 Dashboard (horizon)篇

安装配置Dashboard (horizon) web管理 一.安装Dashboard [[email protected] ~]# yum install openstack-dashboard 二.编辑配置Dashboard [[email protected] ~]#vim   /etc/openstack-dashboard/local_settings OPENSTACK_HOST = "controller" ALLOWED_HOSTS = ['*', ] SESSION_

安装dashboard在控制节点

安装dashboard在控制节点 1.安装包 编辑/etc/openstack-dashboard/local_settings完成以下设置: [[email protected] ~]# yum -y install openstack-dashboard 配置dashboard在controller主机上使用openstack服务 [[email protected] /]# vim /etc/openstack-dashboard/local_settings OPENSTACK_HOST

puppet学习—默认WEBRick安装DashBoard

DashBoard是puppet的控制台,用于显示puppet master和puppet agent的相关信息.本文以默认的WEBRick提供Web服务.DashBoard 安装在master.test.com.并且在客户端配置文件做如下配置 #vim /etc/puppet/puppet.conf [agent] report = true 一.安装依赖软件包 #rpm -ivh http://yum.puppetlabs.com/el/6Server/products/x86_64/pup