Kubernetes workloads for high availability

This page recommends Kubernetes container workload strategies that make your application more fault tolerant in a Google Distributed Cloud (GDC) air-gapped multi-zone universe. GDC supports Kubernetes-native container applications that are widely consumed and supported on Google Kubernetes Engine (GKE).

This page is for developers within the application operator group, who are responsible for creating application workloads for their organization. For more information, see Audiences for GDC air-gapped documentation.

Kubernetes considerations for HA apps

Achieving high availability (HA) in Kubernetes goes beyond just the control plane. You must also design and deploy container workloads in your Google Distributed Cloud (GDC) air-gapped universe resiliently. Kubernetes offers several powerful mechanisms to minimize downtime and provide highly available services even when facing infrastructure issues or during routine maintenance. The following topics are key strategies to consider for HA:

  • Maintain availability with replicas and autoscale: You must have enough running instances of your application to provide HA.

    • ReplicaSet: A ReplicaSet resource maintains a stable set of identical pod replicas are running at any given time. If a pod fails or is terminated, the ReplicaSet controller automatically creates a new pod to replace it. For more information, see ReplicaSet Kubernetes documentation.

    • Horizontal Pod Autoscaler (HPA): While a ReplicaSet maintains a fixed number of replicas, the HPA automatically adjusts this number based on observed metrics like CPU utilization or memory usage. This lets your application handle load spikes. For more information, see Horizontal Pod Autoscaling Kubernetes documentation.

  • Minimize downtime with PodDisruptionBudget (PDB): For more information, see Specifying a Disruption Budget for your Application Kubernetes documentation.

  • Spread your risk with anti-affinity rules: For more information, see Affinity and anti-affinity Kubernetes documentation.

  • Health checks with liveness, readiness, and startup probes: For more information, see Configure Liveness, Readiness and Startup Probes Kubernetes documentation.

  • Stable endpoints and load balancing with services: For more information, see Services Kubernetes documentation.

  • Graceful updates and rollbacks with deployments: For more information, see Rolling Back a Deployment Kubernetes documentation.

  • Set requests and limits for resources: For more information, see Resource Management for Pods and Containers Kubernetes documentation.

What's next