1. Cloud-Native and Kubernetes FoundationsIntroduction and ContextCloud-native computing is an approach to designing, building, deploying, and operating software so that it can exploit the elasticity, automation, resilience, and programmability of modern cloud platforms. It is not synonymous with “running an application in the cloud.” A conventional application moved unchanged from a data centre to a virtual machine may be cloud-hosted without being cloud-native. Cloud-native architecture concerns the relationship between application design, infrastructure, delivery practices, and operational responsibility. The emergence of containers, service-oriented architectures, continuous delivery, infrastructure automation, observability, and programmable networks created a need for a common operational platform. Kubernetes became the most influential response to that need. It provides an extensible control plane for running containerised workloads, but its significance extends beyond scheduling containers. Kubernetes expresses infrastructure and application operation as a continuously reconciled system of declared resources. For postgraduate students, the important question is not merely how to issue Kubernetes commands. It is why the platform works as it does, which organizational and technical problems it solves, what trade-offs it introduces, and when another deployment model may be more appropriate. Learning ObjectivesAfter completing this chapter, the learner should be able to: 1. Explain cloud-native principles and distinguish them from simple cloud hosting. 2. Interpret important terminology used by the Cloud Native Computing Foundation (CNCF). 3. Describe containers, orchestration, declarative management, control loops, and reconciliation. 4. Explain the architecture and principal responsibilities of a Kubernetes cluster. 5. Compare Kubernetes with virtual machines, serverless platforms, managed application platforms, and traditional deployment models. 6. Evaluate practical, organizational, governance, and operational implications of adopting Kubernetes. From Cloud Hosting to Cloud-Native ArchitectureCloud computing supplies on-demand access to configurable computing resources. Virtual machines, managed databases, object storage, networks, and identity services allow organizations to obtain infrastructure through APIs rather than through manual hardware procurement. Cloud-native architecture builds on this foundation by treating infrastructure and operations as software systems. Several characteristics commonly appear together. Applications are packaged as independently deployable units, automated pipelines validate and release changes, infrastructure is represented as code, services expose machine-readable interfaces, and telemetry supports rapid feedback. The architecture is designed for failure: instances may disappear, networks may be delayed, and capacity may change. Recovery is therefore achieved through automation and redundancy rather than reliance on a single carefully maintained server. Cloud-native does not require microservices in every case. A modular monolith can be deployed using containers, automated delivery, managed services, and declarative infrastructure. Conversely, an unnecessarily fragmented microservice system may be less cloud-native in practice if it cannot be tested, observed, secured, or operated reliably. Cloud-native is best understood as a set of design and operating principles, not as a fashionable list of products. The CNCF promotes a broad ecosystem of open-source technologies for cloud-native computing. Its landscape includes container runtimes, orchestration systems, service meshes, observability tools, databases, networking technologies, security tools, and delivery platforms. CNCF terminology often describes projects by function rather than by a single prescribed architecture. Kubernetes is a graduated CNCF project and serves as a central platform in many cloud-native environments, although the CNCF ecosystem is larger than Kubernetes itself. Containers as a Packaging and Isolation ModelA container packages an application and its user-space dependencies into an image that can be executed consistently across compatible environments. Unlike a virtual machine, a container normally shares the host operating system kernel. This makes containers lightweight and fast to start, but it does not make them equivalent to security boundaries of the same strength as virtual machines in every situation. Container images are generally constructed in layers. An image may contain a base operating system user space, language runtime, application libraries, and application code. Immutability in this context means that a running workload is replaced by a new image rather than modified through undocumented manual changes. Immutability supports reproducibility, rollback, auditing, and scalable deployment. Containers solve packaging and process-isolation problems; they do not by themselves solve scheduling, service discovery, high availability, secrets management, scaling, or rollout coordination. A single container engine can run a process, but a production platform must coordinate many workloads across many nodes. That coordination is orchestration. Container security requires attention to image provenance, dependency vulnerabilities, privilege, filesystem access, network policy, runtime isolation, and secret handling. A container image should be minimal enough to reduce attack surface, regularly rebuilt, scanned, signed where appropriate, and promoted through controlled environments. Orchestration and the Kubernetes ModelOrchestration coordinates the lifecycle of workloads across a pool of compute resources. An orchestrator decides where workloads run, starts replacement instances after failure, attaches networking and storage, performs updates, and exposes operational status. Kubernetes performs these functions through an API-driven control plane and a collection of controllers. A Kubernetes cluster consists conceptually of a control plane and worker nodes. The control plane stores and processes the desired configuration of cluster resources. The API server is the principal entry point for users, automation, and other components. The data store, commonly etcd, preserves cluster state. The scheduler selects suitable nodes for unscheduled Pods. Controllers observe resources and take actions intended to move the actual system toward the declared state. On each worker node, the kubelet receives Pod specifications and ensures that the assigned containers are running. A container runtime, such as one conforming to the Container Runtime Interface, creates and manages containers. Networking components implement service connectivity and routing. The exact implementation may vary, but the division of responsibility remains important: the control plane coordinates, while nodes execute workloads. A Pod is Kubernetes’ smallest deployable unit. It represents one or more tightly coupled containers sharing network and storage context. In ordinary application deployments, a Pod commonly contains one main application container, although sidecar patterns can be useful for proxies, telemetry, or supporting processes. Pods are ephemeral; higher-level resources such as Deployments, StatefulSets, and Jobs manage their replacement and lifecycle. A Deployment describes a desired set of interchangeable application replicas and manages rolling updates. A Service provides a stable virtual endpoint for a changing set of Pods. ConfigMaps hold non-confidential configuration, while Secrets are intended for sensitive values, although their secure use also depends on encryption, access control, and external secret-management practices. Namespaces provide a scope for names and policies, not a complete security boundary. Declarative Management, Desired State, and ReconciliationImperative management instructs a system what action to perform: create a server, start a process, or change a setting. Declarative management describes the state that should exist. The platform determines the sequence of actions required to reach that state. This distinction is central to Kubernetes. A declarative manifest might state that an application should have three replicas, use a specified image, expose a port, and receive particular resource limits. The manifest does not normally prescribe which node should host each replica or the exact order of every operation. Kubernetes compares the desired state recorded through its API with the observed state of the cluster. This comparison produces a control loop: 1. Observe the current state. 2. Compare it with the desired state. 3. Calculate an action that reduces the difference. 4. Perform the action. 5. Observe again and repeat. Reconciliation is therefore continuous rather than a one-time installation procedure. If a Pod fails, a controller creates a replacement. If an operator changes the replica count, the controller adjusts the number of Pods. If a node becomes unavailable, scheduling and workload controllers may place replacements elsewhere, subject to constraints and available capacity. The model is powerful because it tolerates drift and partial failure. It also has limits. Convergence may take time; a desired state may be impossible because of insufficient capacity, invalid configuration, dependency failure, or policy restrictions. A manifest is not a guarantee that the requested outcome can be achieved. Status conditions, events, logs, metrics, and tracing are needed to understand why reconciliation has or has not succeeded. A useful distinction is between level-triggered and edge-triggered automation. An edge-triggered system reacts primarily to an event, such as “a server failed.” A level-triggered reconciler repeatedly asks, “Does the current state match the desired state?” Kubernetes emphasizes the latter. This makes recovery possible even when an event is missed, provided that the current state can be observed. The declarative model also changes operational practice. Manual changes made directly to running resources can be overwritten by controllers or later deployments. Production teams therefore commonly use version-controlled manifests, policy checks, and GitOps workflows in which a repository represents the approved desired state. GitOps is an operational approach built on declarative configuration and reconciliation; it is not identical to Kubernetes and can be applied more broadly. Kubernetes as an Extensible PlatformKubernetes is not a complete application architecture and does not automatically make systems resilient. It supplies primitives and extension mechanisms. Custom Resource Definitions allow organizations and projects to define new API objects. Operators combine custom resources with controllers to automate domain-specific operational knowledge, such as database backup, restoration, scaling, or failover. This extensibility produces a platform model: teams can consume standardized interfaces while platform engineers implement the underlying capabilities. Admission controllers can validate or mutate requests before they are stored. Role-Based Access Control limits actions by identity and resource. Network policies can restrict traffic, and resource requests and limits support scheduling and containment. These facilities must be deliberately configured; their presence in the platform does not guarantee safe use. Kubernetes networking follows a service-oriented abstraction. Pods receive addresses, but Pods can be replaced, so clients should generally use Services rather than Pod addresses. Ingress or Gateway mechanisms expose HTTP and other application traffic according to the networking implementation. A service mesh may add traffic policy, mutual TLS, retries, and telemetry, but it also introduces proxies, operational complexity, and performance overhead. It should be adopted for a clearly identified need rather than as a default requirement. Storage illustrates an important boundary. Containers are often treated as replaceable, while data frequently must persist independently of a Pod. Persistent Volumes and related abstractions separate application claims from the underlying storage implementation. Stateful workloads can run on Kubernetes, but their correctness depends on storage semantics, backup design, failure handling, and operator maturity. Comparing Deployment ModelsKubernetes should be selected because its capabilities match a problem, not because it is widely used. A traditional deployment on physical or virtual machines may be preferable for stable, tightly coupled applications, specialized hardware, low operational complexity, or workloads requiring direct host control. Virtual machines provide stronger isolation in many contexts and can be easier to understand for small teams, though they usually consume more resources and require more explicit lifecycle management. A managed application platform, often called a platform as a service, abstracts much of the operating system and runtime. It can provide rapid delivery with fewer infrastructure responsibilities. Its constraints may be beneficial when an organization values simplicity over portability or deep customization. Kubernetes provides broader control and ecosystem compatibility, but that flexibility creates a larger skills and governance burden. Serverless functions and managed container execution abstract servers and often charge according to invocation or resource use. They suit event-driven, bursty, or narrowly scoped workloads. Cold starts, execution limits, statelessness, vendor-specific integrations, and debugging constraints may make them unsuitable for long-running or highly customized services. Kubernetes can host event-driven systems but does not automatically offer the same operational abstraction. A container service managed by a cloud provider may provide a middle position: container packaging without the full complexity of operating a Kubernetes control plane. It can be an excellent choice when teams need containers but do not need Kubernetes’ extensive ecosystem, portability, or extensibility. The comparison should consider more than infrastructure cost. Relevant criteria include: - workload variability and scaling behaviour;
- required control over networking, storage, and scheduling;
- team expertise and on-call capacity;
- portability and dependence on a provider;
- compliance, isolation, and audit requirements;
- delivery frequency and organizational structure;
- observability and disaster-recovery capability; and
- total cost of ownership, including platform engineering and training.
Kubernetes is particularly valuable when many teams need a consistent platform, workloads have varied operational requirements, environments span clouds or data centres, and automation justifies platform investment. It may be excessive for a small application that can be reliably operated on a managed service. An Illustrative Case: Migrating a Digital Commerce PlatformBackgroundA fictional retailer, Northstar Commerce, operates an online store, payment integration, inventory services, and a reporting system. Its original platform consists of several applications deployed manually to virtual machines. Releases occur monthly because configuration differences between environments make testing difficult. Situation and ProblemDuring promotional events, the web tier requires additional capacity, but scaling is slow. A failed application server requires manual intervention. Teams cannot agree whether a problem originates in code, configuration, or infrastructure. Management proposes Kubernetes as a universal solution. AnalysisThe technical problem is not simply the absence of Kubernetes. Northstar has configuration drift, weak deployment automation, insufficient observability, and unclear ownership of operational tasks. Some workloads are stateless and suitable for container orchestration. The reporting database has demanding storage and recovery requirements and should not be moved without a separate data strategy. The payment integration also requires strict secret management and audit controls. ApproachNorthstar first standardizes application builds and introduces automated tests, image scanning, and a versioned deployment process. It places the stateless web and catalog services on a managed Kubernetes platform. Deployments specify resource requests, health probes, replica counts, disruption policies, and controlled rollout behaviour. Services provide internal discovery, while an external gateway handles inbound traffic. Secrets are integrated with a dedicated secret-management service. Metrics, logs, traces, and alerts are established before migration of critical traffic. The database remains on a managed database service. A small platform team defines namespaces, access roles, network policies, approved base images, and service templates. Product teams remain responsible for application health and capacity declarations. A staged rollout compares error rates, latency, recovery time, and operational effort with the previous platform. OutcomeThe retailer gains repeatable deployments and automated replacement of failed application instances. Promotional capacity can be adjusted through declared configuration and autoscaling policies. However, the platform team discovers that cluster upgrades, cost allocation, policy enforcement, and incident response require continuing investment. Kubernetes improves the operating model but does not eliminate architectural defects or organizational responsibility. Learning PointsThe case demonstrates four principles. First, platform adoption should follow problem analysis, not product enthusiasm. Second, migration should separate stateless compute from data management. Third, observability and governance are prerequisites for safe automation. Finally, Kubernetes creates a platform capability whose benefits increase when shared standards and team responsibilities are explicit. Risks, Limitations, and GovernanceKubernetes introduces a substantial control surface. Misconfigured permissions can expose workloads; excessive privileges can allow container escape or lateral movement; public endpoints can be unintentionally created; and unprotected secrets can be copied into logs or images. Security must therefore be layered across identity, images, admission, runtime, network, storage, and supply chain. Operational complexity is another limitation. A cluster may appear to reduce manual work while shifting effort into upgrades, capacity planning, incident management, policy design, and platform engineering. Poorly designed health probes can cause restart loops. Incorrect resource requests can waste capacity or produce scheduling failures. Aggressive retries can amplify an outage. Autoscaling without meaningful metrics can create instability rather than resilience. Governance should define who may create resources, which images are trusted, how costs are attributed, how data is classified, and how changes are approved. Regulatory obligations may require audit trails, geographic restrictions, retention controls, encryption, and documented recovery procedures. Kubernetes supports many of these requirements but does not determine the organization’s policy. Ethically, automation should be designed to preserve accountability. A controller may make thousands of changes quickly, so teams need understandable policies, reviewable configuration, and records of significant actions. Availability decisions can affect customers, employees, and public services; reliability and security are therefore professional responsibilities, not merely technical optimization goals. Current Directions and Best PracticesCurrent cloud-native development increasingly emphasizes platform engineering, internal developer platforms, software supply-chain security, policy as code, and workload portability across heterogeneous environments. Kubernetes is also used at the edge and in hybrid architectures, although intermittent connectivity and constrained resources require adaptations. Declarative delivery is expanding through GitOps, while artificial intelligence and machine-learning workloads are driving interest in specialized scheduling, accelerators, and automated operations. Sound practice begins with a clear workload assessment. Teams should use managed control planes where appropriate, keep images minimal and reproducible, define resource requests and limits, implement health checks carefully, and design backups and recovery independently of application replacement. Access should follow least privilege. Configuration should be versioned and validated before deployment. Observability should cover the user journey, not only cluster health. Organizations should establish a paved path rather than permitting every team to design its own platform. Standard templates, approved deployment patterns, secure defaults, documentation, and self-service interfaces reduce cognitive load. Nevertheless, the platform must allow justified exceptions and measure outcomes such as deployment frequency, change-failure rate, recovery time, availability, cost, and developer experience. Chapter SummaryCloud-native architecture combines automation, resilient design, programmable infrastructure, observable services, and repeatable delivery. Containers provide portable packaging and process isolation, but orchestration is required to coordinate distributed workloads. Kubernetes supplies an API-driven control plane, worker-node execution, declarative resources, and continuous reconciliation. Its central operational idea is the control loop: observe actual state, compare it with desired state, act, and repeat. Kubernetes is extensible through controllers, custom resources, policies, and operators. It can provide a powerful common platform, but it also introduces complexity, governance obligations, security risks, and continuing operational cost. Virtual machines, managed application platforms, serverless services, and simpler container platforms remain valid alternatives. The appropriate choice depends on workload characteristics, organizational capability, compliance, portability, and total cost of ownership. Successful adoption begins with disciplined engineering and clear responsibilities rather than with the platform alone. Key TermsCloud-native architecture: An approach that designs software and operations to exploit automation, elasticity, resilience, and programmable infrastructure. CNCF: The Cloud Native Computing Foundation, which hosts and supports major open-source cloud-native projects. Container: An isolated process environment that packages an application with its user-space dependencies while commonly sharing the host kernel. Container image: An immutable, layered package used to create a container. Orchestration: Automated coordination of workload placement, scaling, networking, updates, and recovery. Kubernetes: An extensible platform for managing containerised workloads through APIs and controllers. Cluster: A collection of control-plane and worker-node components managed as one platform. Pod: Kubernetes’ smallest deployable unit, containing one or more closely associated containers. Control plane: Components that expose the API, store cluster state, schedule workloads, and reconcile resources. Desired state: The configuration that an operator or automation declares should exist. Observed state: The condition currently detected in the running system. Reconciliation: The repeated process of moving observed state toward desired state. Controller: A component that watches resources and performs actions to maintain a desired condition. Declarative management: Describing the required outcome while allowing the platform to determine implementation steps. Deployment: A Kubernetes resource that manages replicated, replaceable application Pods and rolling updates. Service: A stable network abstraction for reaching a changing set of Pods. Operator: A controller-based extension that automates operational knowledge for a particular application or domain. GitOps: An operational approach that uses version-controlled declarative configuration as a source of approved state. Infrastructure as code: Representing infrastructure configuration in machine-readable, versioned definitions. Platform engineering: The design and operation of shared internal platforms that enable teams to deliver software safely and efficiently. Review QuestionsShort Answer Questions1. Why is cloud-native architecture broader than hosting an application on a cloud virtual machine? 2. What problem do containers solve, and what problems do they leave to an orchestrator? 3. Distinguish desired state from observed state in Kubernetes. 4. What is the role of a Kubernetes Service? 5. Why can a managed application platform be preferable to Kubernetes for some organizations? Long Answer Questions1. Explain Kubernetes architecture, including the responsibilities of the API server, data store, scheduler, controllers, kubelet, and container runtime. 2. Describe the Kubernetes reconciliation model and explain how it supports recovery from failure. 3. Critically compare Kubernetes, virtual machines, serverless functions, and managed container services. 4. Discuss the security, governance, and operational risks associated with Kubernetes adoption. 5. Explain why cloud-native architecture does not require microservices and evaluate the role of containers, automation, and observability. Analytical / Application Questions1. An organization has three small, stable applications, one platform engineer, and no requirement for multi-cloud portability. Recommend a deployment model and justify your decision using the criteria in this chapter. 2. A Kubernetes Deployment repeatedly reports unavailable replicas although the manifest specifies the correct replica count. Identify possible categories of causes and explain how reconciliation evidence should be investigated. 3. Design an initial migration strategy for a legacy e-commerce system to Kubernetes. Specify which concerns should be addressed before migration and which workload components should probably remain outside the cluster initially. 22. Multiple Choice Questions with AnswersQuestion 1Which statement best distinguishes cloud-native architecture from simple cloud hosting? A. Cloud-native systems must use only public cloud services. B. Cloud-native systems combine automation, resilience, programmable infrastructure, and repeatable delivery. C. Cloud-native systems always consist of microservices. D. Cloud-native systems do not use virtual machines. Correct Answer: B. Cloud-native systems combine automation, resilience, programmable infrastructure, and repeatable delivery. Question 2What is the primary purpose of container orchestration? A. To compile application source code B. To replace all application databases C. To coordinate workload placement, scaling, networking, updates, and recovery D. To guarantee that containers are secure by default Correct Answer: C. To coordinate workload placement, scaling, networking, updates, and recovery Question 3A Kubernetes controller notices that only two replicas exist when three are declared. What is the controller expected to do? A. Delete the declaration B. Create or arrange for a replacement replica C. Change the desired count to two D. Wait for a human to restart the cluster Correct Answer: B. Create or arrange for a replacement replica Question 4Which statement about declarative management is most accurate? A. It specifies every execution command in a fixed order. B. It describes the desired outcome and lets the platform determine implementation actions. C. It prevents all configuration drift permanently. D. It can be used only for networking. Correct Answer: B. It describes the desired outcome and lets the platform determine implementation actions. Question 5What is the smallest deployable unit in Kubernetes? A. Node B. Service C. Pod D. Deployment Correct Answer: C. Pod Question 6Why should clients usually use a Kubernetes Service rather than a Pod IP address? A. Services compile containers faster. B. Pod identities and addresses can change, while a Service provides a stable endpoint. C. Services eliminate the need for networking. D. Pod IP addresses are always private to the control plane. Correct Answer: B. Pod identities and addresses can change, while a Service provides a stable endpoint. Question 7A company wants containers but lacks the expertise to operate a full Kubernetes platform. Which alternative may best fit? A. A managed container execution service B. Manual deployment to unpatched servers C. A larger number of independent clusters D. Removing all health checks Correct Answer: A. A managed container execution service Question 8Which case most strongly supports adopting Kubernetes? A. A single stable application with no automation needs B. Many teams need a consistent, extensible platform for varied workloads and automated operations C. A workload requires only one short-lived function invocation D. An organization refuses to fund platform operations Correct Answer: B. Many teams need a consistent, extensible platform for varied workloads and automated operations Question 9Why is a Kubernetes manifest not a guarantee that the requested state will be achieved? A. Kubernetes ignores manifests after submission. B. The desired state may be impossible because of capacity, policy, invalid configuration, or dependency failures. C. Controllers act only once and never retry. D. Kubernetes cannot report status. Correct Answer: B. The desired state may be impossible because of capacity, policy, invalid configuration, or dependency failures. Question 10In the Northstar Commerce case, why was the database initially kept on a managed database service? A. Kubernetes cannot run any databases. B. The database had distinct storage, backup, recovery, and operational requirements. C. Databases cannot use network services. D. Managed databases do not require security controls. Correct Answer: B. The database had distinct storage, backup, recovery, and operational requirements.
|