Skip to content

Latest commit

 

History

History
85 lines (71 loc) · 1.93 KB

File metadata and controls

85 lines (71 loc) · 1.93 KB

DaemonSets

In this section, we will take a look at DaemonSets.

DaemonSets are like replicasets, as it helps in to deploy multiple instances of pod. But it runs one copy of your pod on each node in your cluster.

ds

DaemonSets - UseCases

ds-uc

ds-uc-kp

ds-ucn

DaemonSets - Definition

  • Creating a DaemonSet is similar to the ReplicaSet creation process.

  • For DaemonSets, we start with apiVersion, kind as DaemonSets instead of ReplicaSet, metadata and spec.

    apiVersion: apps/v1
    kind: Replicaset
    metadata:
      name: monitoring-daemon
      labels:
        app: nginx
    spec:
      selector:
        matchLabels:
          app: monitoring-agent
      template:
        metadata:
         labels:
           app: monitoring-agent
        spec:
          containers:
          - name: monitoring-agent
            image: monitoring-agent
    
    apiVersion: apps/v1
    kind: DaemonSet
    metadata:
      name: monitoring-daemon
      labels:
        app: nginx
    spec:
      selector:
        matchLabels:
          app: monitoring-agent
      template:
        metadata:
         labels:
           app: monitoring-agent
        spec:
          containers:
          - name: monitoring-agent
            image: monitoring-agent
    

    dsd

  • To create a daemonset from a definition file

    $ kubectl create -f daemon-set-definition.yaml
    

View DaemonSets

  • To list daemonsets
    $ kubectl get daemonsets
    
  • For more details of the daemonsets
    $ kubectl describe daemonsets monitoring-daemon
    
    ds1

How DaemonSets Works

ds2

K8s Reference Docs