首页 文章

fluentd-es-v1.22 DaemonSet不会创建任何pod

提问于
浏览
1

在问这个问题之前,我经历了daemonset doesn't create any podsDaemonSet doesn't create any pods: v1.1.2 . 这是我的问题 .

Kubernetes集群正在CoreOS上运行

NAME=CoreOS
ID=coreos
VERSION=1185.3.0
VERSION_ID=1185.3.0
BUILD_ID=2016-11-01-0605
PRETTY_NAME="CoreOS 1185.3.0 (MoreOS)"
ANSI_COLOR="1;32"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://github.com/coreos/bugs/issues"

我参考https://coreos.com/kubernetes/docs/latest/getting-started.html指南并创建了3个etcd,2个主人和42个节点 . 群集中运行的所有应用程序都没有问题 .

我要求使用fluentd-elasticsearch设置日志记录,并在https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/fluentd-elasticsearch部署了流利的deamonset下载了yaml文件 .

kubectl create -f fluentd-es-ds.yaml

我可以看到它已经创建但没有创建pod .

kubectl --namespace=kube-system get ds -o wide
NAME               DESIRED   CURRENT   NODE-SELECTOR                               AGE       CONTAINER(S)   IMAGE(S)                                              SELECTOR
fluentd-es-v1.22   0         0         alpha.kubernetes.io/fluentd-ds-ready=true   4h        fluentd-es     gcr.io/google_containers/fluentd-elasticsearch:1.22   k8s-app=fluentd-es,kubernetes.io/cluster-service=true,version=v1.22

kubectl --namespace=kube-system describe ds fluentd-es-v1.22
Name:           fluentd-es-v1.22
Image(s):       gcr.io/google_containers/fluentd-elasticsearch:1.22
Selector:       k8s-app=fluentd-es,kubernetes.io/cluster-service=true,version=v1.22
Node-Selector:  alpha.kubernetes.io/fluentd-ds-ready=true
Labels:         k8s-app=fluentd-es
                kubernetes.io/cluster-service=true
                version=v1.22
Desired Number of Nodes Scheduled: 0
Current Number of Nodes Scheduled: 0
Number of Nodes Misscheduled: 0
Pods Status:    0 Running / 0 Waiting / 0 Succeeded / 0 Failed
No events.

我根据上述SO问题中的评论验证了以下详细信息 .

kubectl api-versions
apps/v1alpha1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1beta1
autoscaling/v1
batch/v1
batch/v2alpha1
certificates.k8s.io/v1alpha1
extensions/v1beta1
policy/v1alpha1
rbac.authorization.k8s.io/v1alpha1
storage.k8s.io/v1beta1
v1

重启后,我可以在一个kube-controller-manager中看到下面的日志 .

I0116 20:48:25.367335       1 controllermanager.go:326] Starting extensions/v1beta1 apis
I0116 20:48:25.367368       1 controllermanager.go:328] Starting horizontal pod controller.
I0116 20:48:25.367795       1 controllermanager.go:343] Starting daemon set controller
I0116 20:48:25.367969       1 horizontal.go:127] Starting HPA Controller
I0116 20:48:25.369795       1 controllermanager.go:350] Starting job controller
I0116 20:48:25.370106       1 daemoncontroller.go:236] Starting Daemon Sets controller manager
I0116 20:48:25.371637       1 controllermanager.go:357] Starting deployment controller
I0116 20:48:25.374243       1 controllermanager.go:364] Starting ReplicaSet controller

另一个低于日志 .

I0116 23:16:23.033707       1 leaderelection.go:295] lock is held by {master.host.name} and has not yet expired

我错过了什么吗?在弄清问题时感谢您的帮助 .

1 回答

  • 4

    我在学习后找到了解决方案https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/fluentd-elasticsearch/fluentd-es-ds.yaml

    nodeSelector: set as alpha.kubernetes.io/fluentd-ds-ready: "true"

    但节点没有这样的标签 . 我所做的是将下面的标签添加到一个节点,以检查它是否正常工作 .

    kubectl label nodes {node_name} alpha.kubernetes.io/fluentd-ds-ready="true"
    

    在那之后,我可以看到流利的pod开始运行

    kubectl --namespace=kube-system get pods
    NAME                                   READY     STATUS    RESTARTS   AGE
    fluentd-es-v1.22-x1rid                 1/1       Running   0          6m
    

    谢谢 .

相关问题