DevOps Classroom notes 08/Jan/2026

Daemonsets

Preview

  • Refer Here
  • Daemonset ensure a pod is schedule on every node (on subset of nodes)
  • Daemonsets support rollingupdates
  • Lets run a daemonset with alpine pod with sleep 1d
  • Daemonset generally run agent kind of applications (log agent, sync agents)
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: example-1
spec:
  minReadySeconds: 2
  selector:
    matchLabels:
      app: logagent
  template:
    metadata:
      labels:
        app: logagent
    spec:
      containers:
        - name: logagent
          image: alpine:latest
          command:
            - sleep
            - "3600s"

Jobs and Cron Jobs

Example

  • Lets write a cron job which runs container for 20 seconds and should be repeated every minute
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: example-1
spec:
  schedule: '* * * * *'
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: alpine:latest
            args:
             - sleep
             - "10s"
          restartPolicy: OnFailure

Namespace

  • Namespaces act as virtual clusters
  • names of resources have to be unique within namespaces
  • in k8s we have resources which have two scpes
    • cluster scope
    • namespace scope
  • The default namespace is default
  • We can use namespaces for environments or applications or any logical organization

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube