DevOps Classroom notes 09/Jul/2025

Labels

  • A label is a key value pair that can be applied to any kubernetnes object
  • This can be used for querying objects
  • To add labels in manifest, refer metadata section.
  • Refer Here for official docs
  • manifest
---
apiVersion: v1
kind: Pod
metadata:
  name: one
  labels:
    app: nginx
    env: dev
    project: learning
spec:
  containers:
    - name: web
      image: nginx
      resources:
        requests:
          cpu: 100m
          memory: 10M
        limits:
          cpu: 500m
          memory: 128M
---
apiVersion: v1
kind: Pod
metadata:
  name: two
  labels:
    app: nginx
    env: qa
    project: learning
spec:
  containers:
    - name: web
      image: nginx
      resources:
        requests:
          cpu: 100m
          memory: 10M
        limits:
          cpu: 500m
          memory: 128M
---
apiVersion: v1
kind: Pod
metadata:
  name: three
  labels:
    app: nginx
    env: uat
    project: learning
spec:
  containers:
    - name: web
      image: nginx
      resources:
        requests:
          cpu: 100m
          memory: 10M
        limits:
          cpu: 500m
          memory: 128M
  • Once labels are applied we can query them using selectors
  • Selectors are of two types
    • Equality Based: Two major operations equals & not equals
    • Set Based:
      • in
      • notin
      • exists
      • doesnot exists
  • Query using
kubectl get po
kubectl get po -l 'env = dev'
kubectl get po -l 'env in (dev,qa)'

Usecases

  • My pod requires some service to be up & then it should start
    • types of containers in pod
  • How to ensure pods are running
    • controller objects
      • replica set
      • deployments => zero down time & rollbacks
      • daemonset
  • How to run batch jobs
    • Job
    • CronJob
  • How about rather than static replicas i need dynamic => Autoscalers
  • Load balancing/Service Interactions
    • Service
    • Ingress
    • Exposing the services to external world
      • Loadbalancers
      • Port forwarding
  • Storage Solutions:
    • Persistent Volumes
    • Controller:
      • StatefulSet
  • Configuration & Secrets
    • configmaps
    • secrets
    • vaults (secret vaults)
  • Administrative:
    • backup
    • upgrade
    • Authentication & Authorization
    • Network policies
  • Manifest => Static YAML , To enable Dyanmic YAML
    • HELM
    • Kustomize
  • GitOps:
    • ArgoCD
  • Troubleshooting: (Observability)
    • Monitor
    • Prometheus & Grafana
  • Security:
  • Service Mesh
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

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
Exit mobile version
%%footer%%