Difference between a Deployment and a DaemonSet in Kubernetes

0 votes
What is the difference between a Deployment and a DaemonSet in Kubernetes?
Jan 6 in Kubernetes by Ali
• 10,290 points
261 views

2 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Hey @Ali, 

A deployment provides declarative updates for replicasets and pods. What are declarative updates? So basically, you describe the desired state in your deployment object and the deployment controller will change the actual state to the desired state in a very controlled fashion. 

Use-cases:

  • Create a replicationController
  • Declare a new state of the pod
  • Rollback feature can be used
  • scaling for efficient deployment can be used
  • Clean-up older replicaSets
answered Jan 6 by Rohit
0 votes

Adding to @Rohit's answer, I'll explain about the daemonSet. DaemonSet ensures that all nodes are running a copy of the pods. If new nodes are added to the cluster, pods get equally distributed amongst the newly added nodes. This is taken care of by the DaemonSet. 

DeamonSet yaml look something like this:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: daemonset
  namespace: kube-system
  labels:
    k8s-app: fluentd-logging
spec:
  selector:
    matchLabels:
      name: daemonset
  template:
    metadata:
      labels:
        name: daemonset
    spec:
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
      containers:
      - name: daemonset
        image: k8s.gcr.io/fluentd-elasticsearch:1.20
        resources:
          limits:
            memory: 200Mi
          requests:
            cpu: 100m
            memory: 200Mi
        volumeMounts:
        - name: varlog
          mountPath: /var/log
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
      terminationGracePeriodSeconds: 30
      volumes:
      - name: varlog
        hostPath:
          path: /var/log
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers
answered Jan 6 by Ramya

Related Questions In Kubernetes

0 votes
1 answer

What's the difference betweena a deployment and a stateful set?

Both the deployments and replication controllers are ...READ MORE

answered Oct 3, 2018 in Kubernetes by ajs3033
• 7,000 points
150 views
0 votes
1 answer

What's the difference between kubernetes load balancer and ingress controller?

Load Balancer: So Kubernetes LoadBalancer just points ...READ MORE

answered Jan 4 in Kubernetes by DareDev
• 6,520 points
82 views
0 votes
1 answer
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
446 views
+3 votes
1 answer
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.