本文介绍了daemonset不创建任何Pod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Kubernetes DaemonSets,一点都没有运气.我一直在寻找无济于事的解决方案.我希望这里有人可以帮忙.

I'm trying to get going with Kubernetes DaemonSets and not having any luck at all. I've searched for a solution to no avail. I'm hoping someone here can help out.

首先,我看过此票证.重新启动控制器管理器似乎无济于事.如您在这里看到的,其他的kube进程都在apiserver之后启动,并且api服务器设置为'--runtime-config = extensions/v1beta1 = true'.

First, I've seen this ticket. Restarting the controller manager doesn't appear to help. As you can see here, the other kube processes have all been started after the apiserver and the api server has '--runtime-config=extensions/v1beta1=true' set.

kube     31398     1  0 08:54 ?        00:00:37 /usr/bin/kube-apiserver --logtostderr=true --v=0 --etcd_servers=http://dock-admin:2379 --address=0.0.0.0 --allow-privileged=false --portal_net=10.254.0.0/16 --admission_control=NamespaceAutoProvision,LimitRanger,ResourceQuota --runtime-config=extensions/v1beta1=true
kube     12976     1  0 09:49 ?        00:00:28 /usr/bin/kube-controller-manager --logtostderr=true --v=0 --master=http://127.0.0.1:8080 --cloud-provider=
kube     29489     1  0 11:34 ?        00:00:00 /usr/bin/kube-scheduler --logtostderr=true --v=0 --master=http://127.0.0.1:8080 

但是api版本仅显示版本1:

However api-versions only shows version 1:

$ kubectl api-versions
Available Server Api Versions: v1

Kubernetes版本为1.2:

Kubernetes version is 1.2:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"86327329213fed4af2661c5ae1e92f9956b24f55", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"86327329213fed4af2661c5ae1e92f9956b24f55", GitTreeState:"clean"}

DaemonSet已创建,但似乎没有计划的Pod(status.desiredNumberScheduled).

The DaemonSet has been created, but appears to have no pods scheduled (status.desiredNumberScheduled).

$ kubectl get ds -o json
{
    "kind": "List",
    "apiVersion": "v1",
    "metadata": {},
    "items": [
        {
            "kind": "DaemonSet",
            "apiVersion": "extensions/v1beta1",
            "metadata": {
                "name": "ds-test",
                "namespace": "dvlp",
                "selfLink": "/apis/extensions/v1beta1/namespaces/dvlp/daemonsets/ds-test",
                "uid": "2d948b18-fa7b-11e5-8a55-00163e245587",
                "resourceVersion": "2657499",
                "generation": 1,
                "creationTimestamp": "2016-04-04T15:37:45Z",
                "labels": {
                    "app": "ds-test"
                }
            },
            "spec": {
                "selector": {
                    "app": "ds-test"
                },
                "template": {
                    "metadata": {
                        "creationTimestamp": null,
                        "labels": {
                            "app": "ds-test"
                        }
                    },
                    "spec": {
                        "containers": [
                            {
                                "name": "ds-test",
                                "image": "foo.vt.edu:1102/dbaa-app:v0.10-dvlp",
                                "ports": [
                                    {
                                        "containerPort": 8080,
                                        "protocol": "TCP"
                                    }
                                ],
                                "resources": {},
                                "terminationMessagePath": "/dev/termination-log",
                                "imagePullPolicy": "IfNotPresent"
                            }
                        ],
                        "restartPolicy": "Always",
                        "terminationGracePeriodSeconds": 30,
                        "dnsPolicy": "ClusterFirst",
                        "securityContext": {}
                    }
                }
            },
            "status": {
                "currentNumberScheduled": 0,
                "numberMisscheduled": 0,
                "desiredNumberScheduled": 0
            }
        }
    ]
}

这是我的yaml文件,用于创建DaemonSet

Here is my yaml file to create the DaemonSet

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: ds-test
spec:
  selector:
    app: ds-test
  template:
    metadata:
      labels:
        app: ds-test
    spec:
      containers:
      - name: ds-test
        image: foo.vt.edu:1102/dbaa-app:v0.10-dvlp
        ports:
          - containerPort: 8080

使用该文件创建DaemonSet似乎可以正常工作(我得到了创建的daemonset"ds-test"),但是没有创建任何pod:

Using that file to create the DaemonSet appears to work (I get 'daemonset "ds-test" created'), but no pods are created:

$ kubectl get pods -o json
{
    "kind": "List",
    "apiVersion": "v1",
    "metadata": {},
    "items": []
}

推荐答案

(如果我有足够的声誉,我会把它发布为评论)

(I would have posted this as a comment, if I had enough reputation)

我对您的输出感到困惑.

I am confused by your output.

kubectl api-versions,则应打印出extensions/v1beta1.由于未启用,因此似乎未启用extensions/v1beta1.

kubectl api-versions should print out extensions/v1beta1 if it is enabled on the server. Since it does not, it looks like extensions/v1beta1 is not enabled.

但是,如果未启用extensions/v1beta1,则kubectl get ds应该会失败.因此,我无法确定您的服务器上是否启用了extensions/v1beta1.

But kubectl get ds should fail if extensions/v1beta1 is not enabled. So I can not figure out if extensions/v1beta1 is enabled on your server or not.

您可以尝试使用GET masterIP/apis并查看其中是否列出了扩展名吗?您也可以转到masterIP/apis/extensions/v1beta1,查看其中是否列出了守护程序.

Can you try GET masterIP/apis and see if extensions is listed there?You can also go to masterIP/apis/extensions/v1beta1 and see if daemonsets is listed there.

此外,我看到kubectl version表示1.2,但是kubectl api-versions不应打印出字符串Available Server Api Versions(该字符串已在1.1中删除: https://github.com/kubernetes/kubernetes/pull/15796 ).

Also, I see kubectl version says 1.2, but then kubectl api-versions should not print out the string Available Server Api Versions (that string was removed in 1.1: https://github.com/kubernetes/kubernetes/pull/15796).

这篇关于daemonset不创建任何Pod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 04:24