MODULE 7 · TOPIC 10 · VISUAL DEVOPS LAB

Kubernetes Overview

Kubernetes manages containerized workloads using declarative API objects. The control plane accepts desired state and controllers reconcile actual state. The scheduler selects a node for a Pod; kubelet and the container runtime start its containers. Deployments manage replica sets, while Services provide stable network access to selected workloads. Kubernetes does not build application images; prepare and publish images first.

Browser-based DevOps simulations. Commands, interfaces, logs and infrastructure states are illustrative; no Jenkins, Docker, Git hosting or Kubernetes operation is executed.

1. Control plane and worker architecture

kubectl sends API requests to the API server. The control plane persists desired state and controllers reconcile it; the scheduler selects a suitable node for unscheduled Pods. Kubelet observes assigned Pods and requests the runtime to start containers.

Why this example? Trace scheduling when a worker has adequate resources and when none fits.

Before you run: Choose a scenario and use Next step or Play. Read the diagram, command/configuration panel and simulated interface together. Code fragments require the indicated tools or existing project.
Why this step happens
See all steps in this scenario
    Commands and configuration
    Simulated terminal outputConsole
    Data operationsCompact blocks
    CurrentResultError / rejected

    Change inputs and step through the example. Simulated output. Exact logs, versions and UI appearance vary by installation.

    What this animation explains

    kubectl sends API requests to the API server. The control plane persists desired state and controllers reconcile it; the scheduler selects a suitable node for unscheduled Pods. Kubelet observes assigned Pods and requests the runtime to start containers.

    Try and observe

    Observe that an accepted API object does not guarantee a running Pod.

    2. Deployment replicas and self-healing

    A Deployment manages a ReplicaSet that attempts to maintain the desired replica count. Deleting a controlled Pod can cause a replacement Pod to be created, provided resources and image availability permit it. Pod names and IPs are not stable application endpoints.

    Why this example? Scale a deployment and compare normal operation with an example deleted Pod.

    Before you run: Choose a scenario and use Next step or Play. Read the diagram, command/configuration panel and simulated interface together. Code fragments require the indicated tools or existing project.
    Why this step happens
    See all steps in this scenario
      Commands and configuration
      Simulated terminal outputConsole
      Data operationsCompact blocks
      CurrentResultError / rejected

      Change inputs and step through the example. Simulated output. Exact logs, versions and UI appearance vary by installation.

      What this animation explains

      A Deployment manages a ReplicaSet that attempts to maintain the desired replica count. Deleting a controlled Pod can cause a replacement Pod to be created, provided resources and image availability permit it. Pod names and IPs are not stable application endpoints.

      Try and observe

      Watch the controller restore the desired number of replicas.

      3. Service selectors and traffic routing

      A Service selects Pods by labels and EndpointSlices represent its backends. A ClusterIP gives stable in-cluster access. Under normal readiness-aware routing, unready endpoints are excluded; selector mismatch leaves no matching backends.

      Why this example? Change the Service selector for a deployment with app=web-lab labels.

      Before you run: Choose a scenario and use Next step or Play. Read the diagram, command/configuration panel and simulated interface together. Code fragments require the indicated tools or existing project.
      Why this step happens
      See all steps in this scenario
        Commands and configuration
        Simulated terminal outputConsole
        Data operationsCompact blocks
        CurrentResultError / rejected

        Change inputs and step through the example. Simulated output. Exact logs, versions and UI appearance vary by installation.

        What this animation explains

        A Service selects Pods by labels and EndpointSlices represent its backends. A ClusterIP gives stable in-cluster access. Under normal readiness-aware routing, unready endpoints are excluded; selector mismatch leaves no matching backends.

        Try and observe

        Inspect how matching labels produce eligible endpoints.

        4. Rolling update and readiness

        A Deployment rolling update creates Pods using a new template and scales down old ReplicaSets under configured surge and availability limits. Readiness determines eligibility for normal Service routing. A failed new Pod can stall the rollout; zero downtime is not guaranteed.

        Why this example? Compare a healthy image rollout with an image that cannot be pulled.

        Before you run: Choose a scenario and use Next step or Play. Read the diagram, command/configuration panel and simulated interface together. Code fragments require the indicated tools or existing project.
        Why this step happens
        See all steps in this scenario
          Commands and configuration
          Simulated terminal outputConsole
          Data operationsCompact blocks
          CurrentResultError / rejected

          Change inputs and step through the example. Simulated output. Exact logs, versions and UI appearance vary by installation.

          What this animation explains

          A Deployment rolling update creates Pods using a new template and scales down old ReplicaSets under configured surge and availability limits. Readiness determines eligibility for normal Service routing. A failed new Pod can stall the rollout; zero downtime is not guaranteed.

          Try and observe

          Observe old replicas retained in this simplified maxUnavailable=0 scenario.

          5. ConfigMap and Secret configuration

          ConfigMaps hold non-secret configuration; Secrets are intended for sensitive values. Kubernetes Secret data encoding is not encryption by itself; access control and encryption-at-rest configuration matter. Environment variables from a ConfigMap are read when the container starts; later changes do not automatically change a running process environment.

          Why this example? Compare editing a ConfigMap alone with restarting the consuming Deployment.

          Before you run: Choose a scenario and use Next step or Play. Read the diagram, command/configuration panel and simulated interface together. Code fragments require the indicated tools or existing project.
          Why this step happens
          See all steps in this scenario
            Commands and configuration
            Simulated terminal outputConsole
            Data operationsCompact blocks
            CurrentResultError / rejected

            Change inputs and step through the example. Simulated output. Exact logs, versions and UI appearance vary by installation.

            What this animation explains

            ConfigMaps hold non-secret configuration; Secrets are intended for sensitive values. Kubernetes Secret data encoding is not encryption by itself; access control and encryption-at-rest configuration matter. Environment variables from a ConfigMap are read when the container starts; later changes do not automatically change a running process environment.

            Try and observe

            Observe when the new environment value is visible.

            6. Resource requests, limits and scheduling

            CPU and memory requests inform scheduling; limits constrain resource use at runtime. CPU limits can throttle consumption and memory limits can lead to OOM kills. Requests are not a guarantee of all future resource availability.

            Why this example? Choose a memory request for a worker with illustrative 512 MiB allocatable remaining.

            Before you run: Choose a scenario and use Next step or Play. Read the diagram, command/configuration panel and simulated interface together. Code fragments require the indicated tools or existing project.
            Why this step happens
            See all steps in this scenario
              Commands and configuration
              Simulated terminal outputConsole
              Data operationsCompact blocks
              CurrentResultError / rejected

              Change inputs and step through the example. Simulated output. Exact logs, versions and UI appearance vary by installation.

              What this animation explains

              CPU and memory requests inform scheduling; limits constrain resource use at runtime. CPU limits can throttle consumption and memory limits can lead to OOM kills. Requests are not a guarantee of all future resource availability.

              Try and observe

              Observe scheduling eligibility under the simplified single-node capacity example.

              Command and configuration reference

              Use these commands and settings with the corresponding installed tools in a disposable practice environment.

              Command / settingWhy and when to use it
              kubectl config current-contextControl plane and worker architecture — Trace scheduling when a worker has adequate resources and when none fits.
              kubectl create deployment web-lab --image=nginx:alpineDeployment replicas and self-healing — Scale a deployment and compare normal operation with an example deleted Pod.
              apiVersion: v1Change the Service selector for a deployment with app=web-lab labels.
              kubectl set image deployment/web-lab nginx=nginx:1.27-alpineRolling update and readiness — Compare a healthy image rollout with an image that cannot be pulled.
              kubectl create configmap demo-config --from-literal=APP_MODE=dev --dry-run=client -o yaml | kubectl apply -f -ConfigMap and Secret configuration — Compare editing a ConfigMap alone with restarting the consuming Deployment.
              resources:Choose a memory request for a worker with illustrative 512 MiB allocatable remaining.

              Worked practical examples

              Follow the procedures in an isolated practice environment. Configuration snippets may require an existing project, build tools, credentials, images or cluster objects as indicated.

              1. Create and scale a Deployment

              Procedure

              1. Start a disposable local cluster and verify context before changes.
              2. Create the deployment and scale it to three replicas.
              3. Wait for rollout and inspect pods and nodes.
              Code / configuration
              kubectl config current-context
              kubectl create deployment web-lab --image=nginx:alpine
              kubectl scale deployment web-lab --replicas=3
              kubectl rollout status deployment/web-lab
              kubectl get pods -o wide
              Expected result: Three ready replicas when capacity and image pulling permit.

              2. Expose and inspect a Service

              Procedure

              1. Use the preceding disposable deployment.
              2. Create a ClusterIP Service and inspect EndpointSlices.
              3. Port-forward the Service for local access; stop port-forward with Ctrl+C.
              Code / configuration
              kubectl expose deployment web-lab --port=80 --target-port=80
              kubectl get svc web-lab
              kubectl get endpointslices -l kubernetes.io/service-name=web-lab
              kubectl port-forward svc/web-lab 8080:80
              Expected result: Service provides a stable endpoint for matching ready Pods; local port-forward reaches a backend.

              Predict the outcome before you run

              Try answering these questions, then expand each answer and repeat the appropriate simulation.

              1. Predict the final state for Insufficient CPU in “Control plane and worker architecture”. Which operation explains it?

              Adjust resource request or capacity appropriately Result: 0/1 Ready.

              2. Predict the final state for Delete one Pod in “Deployment replicas and self-healing”. Which operation explains it?

              Replacement starts and becomes ready Result: 3/3 Ready; new Pod identity.

              3. Predict the final state for app=wrong in “Service selectors and traffic routing”. Which operation explains it?

              Fix Service selector, not client DNS Result: Unavailable.

              Hands-on practice and assessment

              Hands-on challenge

              Use a disposable local Kubernetes cluster, verify the active context, create an nginx deployment, scale it, expose a service and observe rollout behavior. Never apply learning examples to production.

              Edit this command/configuration scratchpad. Review prerequisites and run only in your own isolated practice environment; the browser never executes commands.

              Quick assessment

              Official documentation

              Use the documentation for your installed tool versions and platform.

              https://kubernetes.io/docs/concepts/overview/components/

              https://kubernetes.io/docs/concepts/workloads/controllers/deployment/

              https://kubernetes.io/docs/concepts/services-networking/service/

              https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

              Key points and real tool notes

              Use a local disposable practice environment and verify the active context, account, repository and names before running commands. Examples use Java 21, Maven 3.9, Jenkins Pipeline, Docker Engine and standard Kubernetes APIs. Logs and interfaces are educational reconstructions; versions, permissions, resources and real results can differ. No real deployments, credentials or network operations run in this page.