GitHub Actions

Continuous Deployment with GitHub Actions

Brief Overview on Kubernetes

Kubernetes is an open-source container orchestration platform initially developed by Google and now maintained by the Cloud Native Computing Foundation (CNCF). It automates deployment, scaling, and management of containerized applications, enabling resilient, portable workloads across on-premises and cloud environments.

Kubernetes Architecture and Cluster Components

A Kubernetes cluster consists of control plane nodes and worker nodes. Control plane components manage and maintain cluster state, while worker nodes run application containers.

ComponentRoleNotes
kube-apiserverCentral API endpointValidates and configures data for API objects.
etcdDistributed key–value storeStores all cluster data and configuration.
kube-controller-managerControl loops to enforce desired stateManages node health, replication, and endpoint tracking.
kube-schedulerPod placement based on resource availabilityAssigns pods to suitable nodes.
kubelet (worker)Node agent ensuring containers run as expectedRegisters node with control plane and reports status.
kube-proxy (worker)Networking and load balancing for podsMaintains network rules on nodes.
Container runtime (worker)Executes container images (e.g., Docker, CRI-O)Interfaces with kubelet to pull and run containers.

The image is a diagram illustrating the basics of Kubernetes architecture, showing the interaction between developers, admins, and operations with the controller node and worker nodes, including components like etcd, kube apiserver, and pods.

Pods and Workloads

A Pod is the smallest deployable unit in Kubernetes, encapsulating one or more containers that share:

  • A network namespace (IP address and ports)
  • Shared storage volumes
  • Container execution configuration

Pods are ephemeral by default; they do not self-heal once terminated.

Note

To achieve high availability and self-healing, wrap pods in higher-level controllers such as ReplicaSets and Deployments.

ReplicaSets and Deployments

  • ReplicaSet: Ensures a specified number of pod replicas are running at any time.
  • Deployment: Declaratively manages ReplicaSets to facilitate rolling updates and rollbacks.

Example Deployment manifest:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80

Service Discovery and Networking

Kubernetes Services provide stable endpoints to access pods. Common types include:

Service TypeScopeUse Case
ClusterIPInternal cluster onlyMicroservices communicating within the cluster.
NodePortStatic port on every nodeDevelopment or simple external access.
LoadBalancerExternal cloud load balancerProduction traffic with a single public IP.

Warning

Provisioning a LoadBalancer service may incur additional cloud provider costs. Review your cloud network pricing before use.

Ingress

Ingress resources enable advanced HTTP(S) routing:

  • Path-based routing: Route requests by URL path (e.g., /app1, /app2).
  • Host-based routing: Direct traffic based on hostname (e.g., app.example.com).
  • TLS termination: Consolidate HTTPS certificates at the edge.

Ingress controllers often pair with ClusterIP services to secure internal access and reduce the number of external load balancers.

Watch Video

Watch video content

Previous
Understand Deployment Usecase