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. See ReplicaSet Kubernetes documentation for more information.

    • 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 allows your application to handle load spikes. See Horizontal Pod Autoscaling Kubernetes documentation for more information.

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

  • Spread your risk with anti-affinity rules: See Affinity and anti-affinity Kubernetes documentation for more information.

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

  • Stable endpoints and load balancing with services: See Services Kubernetes documentation for more information.

  • Graceful updates and rollbacks with deployments: See Rolling Back a Deployment Kubernetes documentation for more information.

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

What's next