Skip to main content

Kubernetes (K8s) with Yaml

 Kubernetes(K8s) is a container orchestration technology (like Docker Swarm, MESOS)

Node: A virtual/Physical machine, where Kubernetes is installed 
            Cluster -  Set of one or more nodes grouped together

K8s (orchestration) components:
  • API server
  • etcd       - Key Value store              
  • Kubelet
  • container Runtime
  • Controller
  • Scheduler

Master & Worker Nodes

The master node has ApiServer, etcd, controller, and scheduler. While the Worker node has Kubelet

Kubectl - kube command line interface

Basic Yaml file for Kubernates. These are used as input to create Pod, Service, Replica, deployment.
some example of main component in yaml.










Eg.:(pod-definition.yml) below are mandatory fields


apiVersion:
kind:
metadata:


spec:


================================================

Ngnix image pod creation 







command to create pod with yaml


==============================================================

Replication Controller -old technology replaced by "Replica Set"

replicationController yaml eg.











Command to execute




=================================

Replica set monitors pods, if any issue will create new 

ReplicaSet yaml














Commands















Deployment yaml

























Deployment Strategy:
  • Recreate - Put all instance/Pod down and create new pod with newer version
  • Rolling Update - one pod by one pod to be replaced with newer version
 

yaml file structure (CI/CD pipeline) 



Comments

Popular posts from this blog

API Basics

 

Algorithm solving Common Patterns & Techniques

  These are targeted data manipulation strategies used to handle arrays, strings, and linked lists efficiently. Two Pointers : Uses two reference pointers to iterate through a data structure simultaneously, typically from opposite ends or at different speeds (Fast & Slow pointers). Sliding Window : Maintains a subset of data (a "window") over a sequential structure to track running statistics without recalculating the whole set. Prefix Sum : Pre-computes and stores cumulative sums of an array to allow for \(O(1)\) constant-time range sum queries. Dynamic Programming (DP ): Dynamic programming is an optimization technique used to solve problems by breaking them down into simpler subproblems and storing the results of these subproblems to avoid redundant computations. It is particularly effective for problems exhibiting overlapping subproblems and optimal substructure. Greedy Algorithm Breadth-First Search (BFS) / Depth-First Search (DFS) : Systematic graph and tree travers...