【问题标题】:microk8s.enable dns gets stuck in ContainerCreatingmicrok8s.enable dns 卡在 ContainerCreating
【发布时间】:2020-01-29 01:07:59
【问题描述】:

我在 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

【问题讨论】:

    标签: microk8s


    【解决方案1】:

    我早上在 ubuntu 19.04 上与此作斗争。没有一个 microk8s 附加组件起作用。他们的容器陷入“ContainerCreating”状态,类似“MountVolume.SetUp failed for volume “kubernetes-dashboard-token-764ml”:无法同步秘密缓存:等待条件”在他们的描述中。

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

    sudo snap install microk8s --classic --channel=1.15/stable
    

    【讨论】:

    • 可以确认这仍然是 1.16.3(撰写本文时的稳定版本)的问题。降级到 1.15 解决了核心 dns 无法启动的问题。
    • 我在一台运行 microk8s 1.18.2 的机器上遇到了这个问题。任何更新?任何 github 问题或官方错误报告要链接到?不想降级到 1.15。
    猜你喜欢
    • 2018-01-04
    • 2018-08-13
    • 2017-05-18
    • 2020-04-20
    • 1970-01-01
    • 2018-11-17
    • 2021-10-05
    • 2019-10-24
    • 2021-08-17
    相关资源
    最近更新 更多