Posts

Showing posts with the label Kubernetes

Manual Scheduling in Kubernetes

 In Kubernetes, the scheduler acts as the cluster’s strategist, deciding the optimal Node for every Pod. While the default scheduler is automated and highly efficient, there are scenarios where you might want to take direct control over Pod placement. The Automated Scheduler For most workloads, the default Kubernetes scheduler handles Pod placement. It uses a two-stage process— filtering and scoring —to find the most suitable Node for each Pod. Stage 1: Filtering In this stage, the scheduler identifies Nodes that can feasibly run the Pod by applying a series of checks called predicates . Nodes failing any check are excluded from consideration. Common filters include: PodFitsResources : Ensures the Node has enough CPU and memory for the Pod. PodFitsHostPorts : Verifies if the requested port is available on the Node. NodeSelector : Matches Node labels with the Pod’s nodeSelector field. Taints and Tolerations : Ensures the Pod can tolerate any taints on the Node. ...

Kubernetes – Creating a ReplicaSet

 A ReplicaSet is a core Kubernetes controller designed to ensure that a specified number of identical Pods, called replicas , are running at all times. It serves as a self-healing mechanism — if any Pod fails, crashes, or is accidentally deleted, the ReplicaSet automatically creates a replacement to maintain the desired count. This guarantees high availability , scalability , and reliability for applications running in Kubernetes. Purpose of a ReplicaSet The main objectives of a ReplicaSet are to maintain application stability , availability , and scalability . High Availability: A ReplicaSet maintains a consistent number of running Pods. Even if a node or Pod fails, others remain available to serve traffic, ensuring zero downtime. Load Balancing: When used with a Kubernetes Service , a ReplicaSet distributes traffic evenly across all its Pods. As replicas scale up or down, the Service dynamically adjusts to maintain balanced traffic distribution. Scalability: You...

Kubernetes Deployment

 A Kubernetes Deployment is a higher-level abstraction used to manage and scale containerized applications while ensuring they remain in the desired operational state. It provides a declarative way to specify how many Pods should run, which container images they should use, and how updates or rollbacks should occur — all without downtime. Key Capabilities of a Deployment With a Deployment, you can: Scale applications dynamically based on workload. Maintain availability by ensuring the specified number of Pods are always healthy and running. Perform rolling updates to deploy new versions seamlessly. Rollback easily if a deployment introduces issues. Automate self-healing , ensuring that failed Pods are recreated automatically. Think of a Deployment as both a blueprint and a controller for Pods — it simplifies and automates most aspects of application lifecycle management in Kubernetes. Common Use Cases Kubernetes Deployments are widely used for managin...

Kubernetes – Difference Between ReplicaSet and Replication Controller

  Overview Kubernetes (K8s) is an open-source container orchestration platform initially developed by Google and now maintained by the Cloud Native Computing Foundation (CNCF) . It automates the deployment, scaling, and management of containerized applications. Kubernetes is available in two major forms: Kubernetes: The full-fledged version used in production environments. Minikube: A lightweight local version used for development and testing. Replication in Kubernetes Replication ensures that multiple instances of an application (Pods) are running simultaneously to maintain high availability , load balancing , and scalability . Key benefits of replication include: Reliability: Prevents downtime by maintaining a desired number of Pods. Load Balancing: Distributes traffic evenly among available Pods. Auto Scaling: Dynamically adjusts the number of Pods based on workload. Replication is especially useful in microservices architectures, cloud-native ap...

Kubernetes – Replication Controller

 A Replication Controller (RC) in Kubernetes is a core component responsible for ensuring that a specified number of Pod replicas are running at all times. Similar to a ReplicaSet , its primary function is to maintain the desired number of identical Pods — automatically creating or terminating them as necessary. This ensures high availability, fault tolerance, and scalability within a Kubernetes cluster. Core Responsibilities of a Replication Controller Ensuring Availability If a Pod managed by an RC fails, is deleted, or the node hosting it crashes, the RC will automatically create a new Pod to replace it, maintaining the desired replica count. Scaling The number of running Pods can be increased or decreased simply by updating the replicas field in the RC’s configuration. Load Balancing When used with a Kubernetes Service , the RC ensures that traffic is evenly distributed across all active Pods, promoting efficient resource utilization. Example: Running a Rep...