5

我已经在 VBox 中的 Ubuntu 19 上安装了 microk8s snap。当我运行microk8s.enable dns时,部署的 pod 不会超过 ContainerCreating 状态。

我以前工作过。我还重新安装了 microk8s,这有助于通过,但不再是了。

的输出microk8s.kubectl get all --all-namespaces显示机密的音量有问题。我不知道如何进一步调查,因此不胜感激。

干杯

NAMESPACE     NAME                          READY   STATUS              RESTARTS   AGE
kube-system   pod/coredns-9b8997588-z88lz   0/1     ContainerCreating   0          16m

NAMESPACE     NAME                 TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                  AGE
default       service/kubernetes   ClusterIP   10.152.183.1    <none>        443/TCP                  20m
kube-system   service/kube-dns     ClusterIP   10.152.183.10   <none>        53/UDP,53/TCP,9153/TCP   16m

NAMESPACE     NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
kube-system   deployment.apps/coredns   0/1     1            0           16m

NAMESPACE     NAME                                DESIRED   CURRENT   READY   AGE
kube-system   replicaset.apps/coredns-9b8997588   1         1         0       16m

输出自microk8s.kubectl describe pod/coredns-9b8997588-z88lz -n kube-system

Name:                 coredns-9b8997588-z88lz
Namespace:            kube-system
Priority:             2000000000
Priority Class Name:  system-cluster-critical
Node:                 peza-ubuntu-19/10.0.2.15
Start Time:           Sun, 29 Sep 2019 15:49:27 +0200
Labels:               k8s-app=kube-dns
                      pod-template-hash=9b8997588
Annotations:          scheduler.alpha.kubernetes.io/critical-pod: 
Status:               Pending
IP:                   
IPs:                  <none>
Controlled By:        ReplicaSet/coredns-9b8997588
Containers:
  coredns:
    Container ID:  
    Image:         coredns/coredns:1.5.0
    Image ID:      
    Ports:         53/UDP, 53/TCP, 9153/TCP
    Host Ports:    0/UDP, 0/TCP, 0/TCP
    Args:
      -conf
      /etc/coredns/Corefile
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Limits:
      memory:  170Mi
    Requests:
      cpu:        100m
      memory:     70Mi
    Liveness:     http-get http://:8080/health delay=60s timeout=5s period=10s #success=1 #failure=5
    Readiness:    http-get http://:8181/ready delay=0s timeout=1s period=10s #success=1 #failure=3
    Environment:  <none>
    Mounts:
      /etc/coredns from config-volume (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from coredns-token-h6qlm (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  config-volume:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      coredns
    Optional:  false
  coredns-token-h6qlm:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  coredns-token-h6qlm
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  <none>
Tolerations:     CriticalAddonsOnly
                 node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason       Age                    From                     Message
  ----     ------       ----                   ----                     -------
  Normal   Scheduled    <unknown>              default-scheduler        Successfully assigned kube-system/coredns-9b8997588-z88lz to peza-ubuntu-19
  Warning  FailedMount  5m59s                  kubelet, peza-ubuntu-19  Unable to attach or mount volumes: unmounted volumes=[coredns-token-h6qlm config-volume], unattached volumes=[coredns-token-h6qlm config-volume]: timed out waiting for the condition
  Warning  FailedMount  3m56s (x11 over 10m)   kubelet, peza-ubuntu-19  MountVolume.SetUp failed for volume "coredns-token-h6qlm" : failed to sync secret cache: timed out waiting for the condition
  Warning  FailedMount  3m44s (x2 over 8m16s)  kubelet, peza-ubuntu-19  Unable to attach or mount volumes: unmounted volumes=[config-volume coredns-token-h6qlm], unattached volumes=[config-volume coredns-token-h6qlm]: timed out waiting for the condition
  Warning  FailedMount  113s (x12 over 10m)    kubelet, peza-ubuntu-19  MountVolume.SetUp failed for volume "config-volume" : failed to sync configmap cache: timed out waiting for the condition

4

1 回答 1

3

我早上在 ubuntu 19.04 上与此作斗争。没有一个 microk8s 附加组件起作用。他们的容器卡在“ ContainerCreating ”状态,在他们的描述中出现类似“ MountVolume.SetUp failed for volume “kubernetes-dashboard-token-764ml”: failed to sync secret cache: timed out waiting for the condition ”。

我尝试了几次启动/停止/重置/重新安装 microk8s。没有任何效果。一旦我将它降级到以前的版本,问题就消失了。

sudo snap install microk8s --classic --channel=1.15/stable
于 2019-10-02T21:59:30.407 回答