Kubernetes仪表板部署已存在,未创建Pod

时间:2020-08-12 21:35:32

标签: kubernetes kubernetes-pod kubernetes-dashboard

我们的团队正在尝试使用Kubernetes仪表板解决一些问题,因为它无法为您提供秘密。我们正在使用仪表板版本1.8.3,而Kubernetes服务器版本是1.9。

为了检查是否可以通过重新安装仪表板解决此问题,我运行了命令

kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.8.3/src/deploy/recommended/kubernetes-dashboard.yaml

然后输入命令

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.8.3/src/deploy/recommended/kubernetes-dashboard.yaml

但是,我最终无法重新创建Kubernetes窗格。我不确定为什么部署拒绝生成值。这是来自

的输出
kubectl describe deployment kubernetes-dashboard -n kube-system

表明需要一个副本,但没有创建。

Name:                   kubernetes-dashboard
Namespace:              kube-system
CreationTimestamp:      <hidden>
Labels:                 addonmanager.kubernetes.io/mode=Reconcile
                        k8s-app=kubernetes-dashboard
                        kubernetes.io/cluster-service=true
Annotations:            Selector:  k8s-app=kubernetes-dashboard
Replicas:               1 desired | 0 updated | 0 total | 0 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:           k8s-app=kubernetes-dashboard
  Service Account:  kubernetes-dashboard
  Containers:
   kubernetes-dashboard:
    Image:      k8s-gcrio.azureedge.net/kubernetes-dashboard-amd64:v1.8.3
    Port:       8443/TCP
    Host Port:  0/TCP
    Args:
      --auto-generate-certificates
      --heapster-host=http://heapster.kube-system:80
    Limits:
      cpu:     500m
      memory:  500Mi
    Requests:
      cpu:        300m
      memory:     150Mi
    Liveness:     http-get https://:8443/ delay=30s timeout=30s period=10s #success=1 #failure=3
    Environment:  <none>
    Mounts:
      /certs from kubernetes-dashboard-certs (rw)
  Volumes:
   kubernetes-dashboard-certs:
    Type:        EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
    SizeLimit:   <unset>
OldReplicaSets:  <none>
NewReplicaSet:   <none>
Events:          <none>

如何创建广告连播,并使仪表板再次工作?

更新:我发现我们在名为“ kubernetes-dashboard”的命名空间中创建了仪表板,因此我删除了与kubernetes-dashboard命名空间关联的所有内容。但是,部署仍未创建仪表板。

我还发现问题似乎是应该创建Pod的任何副本集或部署都没有在应有的时候创建Pod。我可以发送任何信息以获取有关此问题的帮助吗?

1 个答案:

答案 0 :(得分:0)

我建议您宁可指向最新版本。与Kubernetes版本相同-确实过时了。

尝试手动删除Kubernetes仪表板,然后重新创建。

执行以下命令:

$ kubectl delete deployment kubernetes-dashboard --namespace=kube-system

$ kubectl delete service kubernetes-dashboard --namespace=kube-system

$ kubectl delete role kubernetes-dashboard-minimal --namespace=kube-system

$ kubectl delete rolebinding kubernetes-dashboard-minimal --namespace=kube-system

$ kubectl delete sa kubernetes-dashboard --namespace=kube-system

$ kubectl delete secret kubernetes-dashboard-certs --namespace=kube-system

$ kubectl delete secret kubernetes-dashboard-key-holder --namespace=kube-system

然后重新创建仪表板。

看看:kubernetes-dashboardcluster-management