kubernetesdaemonset

Is there an imperative command to create daemonsets in kubernetes?


I was wondering if there is an easier way to create daemonsets in k8s other than yaml files. For eg, for pods we have kubectl run --generator=run-pod/v1 command. I was wondering if there is something similar for DS.

Thanks in advance.


Solution

  • There is no such quick kubectl create type command for creating daemonsets. But you can do it in some other way.

    You have your daemonset now.

    What we are doing here is: at first we're creating a deployment yaml and then replacing kind: Deployment with kind: DaemonSet and remove replicas: 1 from the deployment yaml.

    Thats's how we get yaml for daemonset.