Completek8s Classroomnotes 09/Aug/2023

Overview of K8s Workloads

  • In Kubernetes we have objects which maintain Pods as part of their desired state
    • Job
    • CronJob
    • DaemonSet
    • ReplicaSet
    • ReplicationController
    • Deployment
    • StatefulSet

Why ReplicaSet over ReplicationController?

  • ReplicaSet is successor of Replication Controller and introducted some improvements
    • More Expressive Selectors: In ReplicaSet both Set and Equalty Based Selectors can be used
    • Rolling Updates and Rollbacks: ReplicaSets offer better support
    • Scaling Behavior: RS offer more control over scaling behavior
    • Detailed Status Conditions

Job

  • This is a resource that manages execution of specific task or batch job. It ensure that the job completes successfully before considering it done.
  • Job might create one or more pods to perform task
  • Refer Here
    Preview

CronJob

  • This is to run a particular task on schedule
    Preview

Deployment

  • This resource manages the deployment and scaling of set of identical pods
  • key features
    • Replica Management
    • Rolling Updates
    • Roll backs
    • History and Rollout status
  • Deployment internally create replica set which inturn creates pods
    Preview
  • Sample
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80

Preview

StatefulSets

  • This resources is designed to manage deployment and scaling of stateful applications such as databases, distrbuted data stores.
  • Unlike deployment which is designed for staleless applications, stateful set which is designed for Stateful applications has following features
    • Stable Network Identity
    • Ordered Deployment and Scaling
    • Persistent Storage
    • Headless Services
      Preview

DaemonSet

  • This resource ensures that copy of a specific pod runs on each or selected nodes with in cluster
  • key features
    • one pod per node
    • node specific tasks
  • Use cases:
    • Deploying agents
      • monitoring
      • logging
    • network proxies

Exercise

  • Install kubernetes using kube-spray Refer Here
  • Try installing a highly available k8s cluster using kubeadm Refer Here

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
Social Media Icons Powered by Acurax Web Design 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