DevOps Classroomnotes 30/Apr/2023

Deployment

  • Deployment is a k8s object which can help in rolling out and rolling back updates
  • Deployment controls replica set and replica set controls pods
    Preview
  • Lets create a manifest with some application deployment
  • apply deployment and service. Access the application
    Preview
    Preview
  • Lets get deployment information
    Preview
    Preview
  • lets explore rollout command
    Preview
  • Refer Here for the manifests used to create revision 1
  • Lets update the specs to change image from nginx to httpd Refer Here for changes in manifests
    Preview
    Preview
    Preview
  • Now to rollback to previous versions and update multiple versions kubectl rollout undo
    Preview
  • The change-cause is showning as none which is not good. What can be done to have a valid change cause.

Annotations

  • Refer Here for official docs
  • Refer Here for the manifest with change cause annotation
    Preview
  • Refer Here for some annotations specific to azure aks ingress
  • Refer Here for some annotations specific to aws eks ingress

DaemonSet

  • DaemonSet is a controller which creates pod on every/selected nodes in k8s cluster
  • Use cases:
    • log collectors
    • agents etc
  • Refer Here for official docs
  • Refer Here for the manifests for daemonsets
    Preview

Scheduling Pods

  • possible ways
    Preview
  • Refer Here for assigning pods to nodes

Node Selectors

  • We have added manifests with pod and service. Refer Here for manifests
  • Now lets select node by its name Refer Here
    Preview
  • We have two nodes lets attach the following labels

    • node 0: purpose: poc
    • node 1: purpose: testing
  • When we have tried to create a pod with nodeSelector matching purpose: poc it was created on node 0 and when we created a pod with purpose: testing it created in node 1 and when created a pod with purpose: development it was in pending state (not created)
---
apiVersion: v1
kind: Pod
metadata:
  name: nodeselector
  labels:
    app: nginx
    purpose: nodeselector
spec:
  nodeSelector:
    purpose: testing
  containers:
    - name: jenkins
      image: jenkins/jenkins:jdk11
      ports:
        - containerPort: 8080

Preview

Affinity/Anti Affinity Based

Taints and Tolerations

Headless Service

  • Refer Here
  • Headless service will not have cluster ip
    Preview
  • headless service spec
---
apiVersion: v1
kind: Service
metadata:
  name: nginx-svc
spec:
  selector:
    app: nginx
  type: ClusterIP
  clusterIP: None
  ports:
    - name: nginx-svc
      port: 80
      targetPort: 80
      protocol: TCP
  • Headless service returns the ips of the pods returned by selector.
  • This is used in stateful sets

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 Wordpress Development 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