Slide 1

Slide 1 text

Setup Kubernetes Federation Between Clusters AWS User Group Taiwan

Slide 2

Slide 2 text

About Me ⽩白凱仁(Kyle Bai) • Interested in emerging technologies. • COSCUP, Kubernetes Day and OpenStack Day Speaker • OpenStack and Kubernetes Projects Contributor(100+ PR) • Certified Kubernetes Administrator @kairen([email protected]) https://kairen.github.io/

Slide 3

Slide 3 text

Why Federation?

Slide 4

Slide 4 text

Multiple clusters • Serving users from clusters closest to them. • Avoiding provider lock-in: By making it easier to migrate applications across clusters, federation prevents cluster provider lock-in. • High availability: Ability to federate clusters across different regions/ cloud providers.

Slide 5

Slide 5 text

Federation Federation makes it easy to manage multiple clusters. • Sync resources across clusters: Federation provides the ability to keep resources in multiple clusters in sync. • Cross cluster discovery: Federation provides the ability to auto-configure DNS servers and load balancers with backends from all clusters.

Slide 6

Slide 6 text

Federation pros • Keep your app synced across clusters. • Configure network resources (services, ingress) to route traffic across clusters. • Single place to apply policies. • Policy-based Resource Placement(OPA).

Slide 7

Slide 7 text

Use cases for Federation • Geographically Distributed Deployments: Spread Deployments across clusters in different parts of the world. • Hybrid Cloud: Extend Deployments from on-premise clusters to the cloud. • Application Migration: Simplify the migration of applications from on- premise to the cloud or between cloud providers.

Slide 8

Slide 8 text

Federation cons • Increased network bandwidth and cost: The federation control plane watches all clusters to ensure that the current state is as expected. • Reduced cross cluster isolation: A bug in the federation control plane can impact all clusters. • Maturity: The federation project is relatively new and is not very mature. • Not all resources are available and many are still alpha and beta.

Slide 9

Slide 9 text

Federation support API resources • Cluster • ConfigMap • DaemonSets • Deployment • Events • HPA • Ingress • Jobs • Namespaces • ReplicaSets • Secrets • Services * Only support API version for extensions/v1beta1, v1

Slide 10

Slide 10 text

Federation Architecture

Slide 11

Slide 11 text

Overview Federation Control Plane Federated Resources Federated Clusters

Slide 12

Slide 12 text

Federation API Server The Kubernetes federation API server validates and configures data for the API objects which include pods, services, replicationcontrollers, and others.

Slide 13

Slide 13 text

Federation Controller Manager The federation controller manager is a daemon that embeds the core control loops shipped with federation. • Watches Federation API Server • Clusters - federation/v1beta1/cluster • API Resources - v1/foo • Watches All Kubernetes Clusters • API Resources - v1/foo • Reconciles • Compare and update • Handles cascading deletion

Slide 14

Slide 14 text

How to place? • Placement can be controlled per-resource via annotations. • Annotations supported: • federation.kubernetes.io/replica-set-preferences • federation.kubernetes.io/deployment-preferences • federation.alpha.kubernetes.io/cluster-selector • federation-controller evaluates annotations to produce final placement

Slide 15

Slide 15 text

How to setup Kubernetes Federation on AWS

Slide 16

Slide 16 text

Architecture

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Prerequisites(1/2) • In this lab, we will deploy clusters in different AWS regions: • US West: Oregon (us-west-2) • US East: Ohio (us-east-2) • Asia: Tokyo(ap-northeast-1) • Install the following tools on host: • kubectl • kubefed: if os is Mac OS X, you need build from Federation source code. • kops • AWS CLI

Slide 19

Slide 19 text

Prerequisites(2/2) Amazon Web Services: • IAM: Identity and Access Management. • EC2: Kubernetes cluster. • ELB: Kubernetes service load balancer. • Route53: Public domain for Kubernetes API, Service, … etc • S3: Store kops state. • VPC: Cluster Network. Godaddy: • Buy your own domain name.

Slide 20

Slide 20 text

Live setup and demo!!! (Boom!!!) https://github.com/kairen/aws-k8s-federation

Slide 21

Slide 21 text

Thanks