kubernetesdaemonset

Problem with daemonset creation on kubernetes cluster


I am running the following command on the master node, to create a daemonset on a Kubernetes cluster.

$ kubectl apply -f https://k8s.io/examples/controllers/daemonset.yaml

I think it got created successfully because the following message is shown,

daemonset.apps/fluentd-elasticsearch created

But after that when I run,

$ kubectl get daemonsets
No resources found in default namespace

So I tried to recreate the same but this time it shows,

$ kubectl apply -f https://k8s.io/examples/controllers/daemonset.yaml
daemonset.apps/fluentd-elasticsearch unchanged

I don’t understand what is happening here. An explanation would be highly appreciated.


Solution

  • It's getting deployed in kube-system namespace since the deployment yaml has namespace: kube-system

    kubectl get daemonsets command shows daemonsets from default namespace and hence it gives No resources found

    You need to add -n parameter in the command to check daemonsets created in a specific namespace such as kube-system

    kubectl get daemonsets -n kube-system