卷“ config-volume”的Minikube MountVolume失败

时间:2019-06-20 04:59:42

标签: kubernetes kubectl minikube

我的ubuntu:16.04桌面遇到问题,使用的是minikube版本:v0.35.0,kubectl客户端/服务器均为:1.13.4

当我尝试运行configmap示例并获取错误kubelet时,每次尝试minikube MountVolume.SetUp都会失败。我尝试调试,但最终没有结果。大约持续了2天,但无法正常工作。

$ kubectl apply -f ./kube-pod.yml

apiVersion: v1 kind: Pod metadata: name: kuard-config spec: containers: - name: test-container image: gcr.io/kuar-demo/kuard-amd64:1 imagePullPolicy: Always command: - "/kuard" - "$(EXTRA_PARAM)" env: - name: ANOTHER_PARAM valueFrom: configMapKeyRef: name: my-config key: another-param - name: EXTRA_PARAM valueFrom: configMapKeyRef: name: my-config key: extra-param volumeMounts: - name: config-volume mountPath: "/config" volumes: - name: config-volume configMap: name: my-config restartPolicy: Never

运行以下命令时出现以下错误

$ kubectl描述po kuard-config

Namespace:          default
Priority:           0
PriorityClassName:  <none>
Node:               minikube/10.0.2.15
Start Time:         Thu, 20 Jun 2019 10:44:37 +0600
Labels:             <none>
Annotations:        kubectl.kubernetes.io/last-applied-configuration:
                      {"apiVersion":"v1","kind":"Pod","metadata":{"ann
otations":{},"name":"kuard-config","namespace":"default"},"spec":{"containers":[{"command"...
Status:             Pending
IP:
Containers:
  test-container:
    Container ID:
    Image:         gcr.io/kuar-demo/kuard-amd64:1
    Image ID:
    Port:          <none>
    Host Port:     <none>
    Command:
      /kuard
      $(EXTRA_PARAM)
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Environment:
      ANOTHER_PARAM:  <set to the key 'another-param' of config map 'my-config'>  Optional: false
      EXTRA_PARAM:    <set to the key 'extra-param' of config map 'my-config'>    Optional: false
    Mounts:
      /config from config-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-q42jl (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  config-volume:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      my-config
    Optional:  false
  default-token-q42jl:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-q42jl
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason       Age               From               Message
  ----     ------       ----              ----               -------
  Normal   Scheduled    12s               default-scheduler  Successfully assigned default/kuard-config to minikube
  Warning  FailedMount  4s (x5 over 11s)  kubelet, minikube  MountVolume.SetUp failed for volume "config-volume" : configmap "my-config" not found```

I'd expect if someone help me to figure out why `kubelet, minikube  MountVolume.SetUp failed` is occur. 

0 个答案:

没有答案