Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Highly available cross-region deployments with Kubernetes

Highly available cross-region deployments with Kubernetes

Out-of-the-box Kubernetes makes it easy to deploy and scale your applications within one Kubernetes cluster in one single region. But with the Kubernetes Federation API and the use of service meshes like Istio, it’s also possible to deploy an application over multiple clusters in different regions, so that it becomes truly highly available even if a complete region fails.

Bastian Hofmann explains how to set the Kubernetes cluster federation up and how to deploy your applications to make best use of it, especially regarding monitoring, persistent storage, latencies, and data integrity.

Bastian Hofmann

November 06, 2019
Tweet

More Decks by Bastian Hofmann

Other Decks in Programming

Transcript

  1. Why

  2. apiVersion: apps/v1 kind: Deployment metadata: name: nginx spec: template: spec:

    containers: - image: nginx name: nginx nodeSelector: failure-domain.beta.kubernetes.io/region: dbl
  3. apiVersion: v1 kind: Service metadata: name: nginx spec: type: ClusterIP

    ports: - port: 80 targetPort: 80 selector: app: nginx
  4. apiVersion: v1 kind: Service metadata: name: nginx spec: type: LoadBalancer

    ports: - port: 80 targetPort: 80 selector: app: nginx
  5. apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: standard provisioner: kubernetes.io/gce-pd parameters:

    type: pd-standard volumeBindingMode: WaitForFirstConsumer allowedTopologies: - matchLabelExpressions: - key: failure-domain.beta.kubernetes.io/zone values: - us-central1-a - us-central1-b
  6. Beskow, Paul & Vik, Knut-Helge & Halvorsen, Pål & Griwodz,

    Carsten. (2009). The partial migration of game state and dynamic server selection to reduce latency. Multimedia Tools Appl.. 45. 83-107. 10.1007/s11042-009-0287-7.
  7. Cluster 1 Cluster 2 WireGuard VPN Kubernetes Master Components Kubernetes

    Master Components Nginx Nginx Nginx Service Nginx Service Curl
  8. cluster.region2:53 { forward . 10.10.11.10 } .:53 { kubernetes cluster.local

    cluster.region1 in-addr.arpa ip6.arpa { pods insecure upstream fallthrough in-addr.arpa ip6.arpa } forward . /etc/resolv.conf loop loadbalance }
  9. cluster.region1:53 { forward . 10.10.10.10 } .:53 { kubernetes cluster.local

    cluster.region2 in-addr.arpa ip6.arpa { pods insecure upstream fallthrough in-addr.arpa ip6.arpa } forward . /etc/resolv.conf loop loadbalance }
  10. Cluster 1 Cluster 2 Kubernetes Master Components Kubernetes Master Components

    Kubefed Controller FederatedService FederatedDeployment
  11. Cluster 1 Cluster 2 Kubernetes Master Components Kubernetes Master Components

    Nginx Service Nginx Service Kubefed Controller Kubefed Controller Nginx Nginx
  12. Cluster 1 Cluster 2 WireGuard VPN Kubernetes Master Components Kubernetes

    Master Components Nginx Nginx Nginx Service Nginx Service Curl LB LB
  13. Cluster 1 Cluster 2 Istio Gateway Istio Control Plane Kubernetes

    Master Components Kubernetes Master Components Istio Nginx Nginx Nginx Service Nginx Service Istio Gateway Curl