Lesson 9 / 10
Module 9Lesson 1⏱ 55 min study

Lesson 9: Multi-Cloud Kubernetes Deployments (EKS, GKE, AKS)

Examine cloud provider shared responsibility models and automate cluster provisioning and IAM identity federation across AWS EKS, GCP GKE, and Azure AKS.

✦ Key Architectural Takeaways
  • •Managed cloud Kubernetes shifts control plane maintenance, etcd backups, and master node patching to the cloud provider.
  • •Workload identity federation (IRSA on AWS, Workload Identity on GCP) eliminates long-lived static API credentials in containers.
  • •Ansible provides a unified orchestration layer to provision VPCs, clusters, and manifests across heterogeneous cloud providers.
  • •Networking topologies differ: AWS uses VPC CNI with direct ENI secondary IPs; Azure offers Kubenet and Azure CNI; GCP utilizes VPC-native alias IPs.
  • •Cross-cloud application portability requires decoupling workloads from proprietary cloud APIs using standard Kubernetes specifications.

1. The Cloud Computing Shared Responsibility Model

When deploying Kubernetes in public clouds, the operational boundary changes dramatically:

Architectural TierOn-Premises Bare-MetalCloud IaaS (Self-Managed)Managed PaaS (EKS / GKE / AKS)
Physical Facilities & PowerCustomerCloud ProviderCloud Provider
Physical Servers & HypervisorsCustomerCloud ProviderCloud Provider
Control Plane (etcd, API Server)CustomerCustomerCloud Provider (SLA-backed)
Worker Node OS & PatchingCustomerCustomerShared (Managed Node Groups)
Pod Security & Application LogicCustomerCustomerCustomer Responsibility

By outsourcing the high-availability management of etcd and the Control Plane to cloud providers, platform teams focus exclusively on application resilience and workload governance.

§

2. Automating Amazon Elastic Kubernetes Service (AWS EKS)

Amazon EKS manages the Kubernetes control plane across three Availability Zones. Workload pods access AWS services (S3, DynamoDB) securely via IAM Roles for Service Accounts (IRSA), which federates Kubernetes OpenID Connect (OIDC) tokens with AWS IAM.

Ansible Playbook: Provisioning EKS Cluster with IRSA

YAMLSYSTEM SCHEMATIC
- name: Provision Amazon EKS Managed Kubernetes Cluster
  amazon.aws.eks_cluster:
    name: production-eks-cluster
    version: "1.29"
    role_arn: "arn:aws:iam::123456789012:role/EKSClusterRole"
    subnets:
      - subnet-0123456789abcdef0
      - subnet-0fedcba9876543210
    security_groups:
      - sg-0123456789abcdef0
    enable_oidc: true
    state: present
  register: eks_cluster
§

3. Automating Google Kubernetes Engine (GCP GKE)

Google Cloud GKE is widely recognized for advanced automation and deep integration with Borg ancestry.

GKE features two distinct operating modes:

  • GKE Standard: Full control over underlying Compute Engine VM worker nodes, node pools, and custom machine types.
  • GKE Autopilot: Fully automated infrastructure where Google provisions, scales, and manages worker nodes automatically, billing strictly per pod CPU/RAM requests.

Ansible Playbook: Provisioning VPC-Native GKE Cluster

YAMLSYSTEM SCHEMATIC
- name: Provision GKE Autopilot Cluster
  google.cloud.gcp_container_cluster:
    name: production-gke-cluster
    initial_node_count: 1
    autopilot:
      enabled: true
    network: projects/my-project/global/networks/vpc-production
    subnetwork: projects/my-project/regions/us-central1/subnetworks/k8s-subnet
    location: us-central1
    project: my-project
    auth_kind: serviceaccount
    service_account_file: /etc/credentials/gcp-sa.json
    state: present
§

4. Automating Microsoft Azure Kubernetes Service (AKS)

Azure AKS integrates natively with Microsoft Entra ID (formerly Azure Active Directory) and Azure Virtual Networks:

  • Kubenet Networking: Basic virtual network routing; worker nodes act as routers, and Pod IPs are not routable within the broader Azure VNet.
  • Azure CNI (Container Network Interface): Every Pod receives a real, fully routable private IP address directly from the Azure VNet subnet.
YAMLSYSTEM SCHEMATIC
- name: Provision Azure AKS Cluster with Managed Identities
  azure.azcollection.azure_rm_aks:
    resource_group: ProductionRG
    name: production-aks-cluster
    dns_prefix: prod-k8s
    kubernetes_version: "1.29.0"
    linux_profile:
      admin_username: azureuser
      ssh_key: "{{ vault_ssh_public_key }}"
    agent_pool_profiles:
      - name: defaultpool
        count: 3
        vm_size: Standard_D4s_v5
        os_type: Linux
    identity:
      type: SystemAssigned
    network_profile:
      network_plugin: azure
    state: present