New clusters for federation

Again, make sure you navigate to wherever Kubernetes was downloaded and move into the cluster sub-folder:

$ cd kubernetes/cluster/
Before we proceed, make sure you have the GCE command line and the AWS command line installed, authenticated, and configured. Refer to Chapter 1, Introduction to Kubernetes, if you need assistance doing so on a new box.

First, we will create the AWS cluster. Note that we are adding an environment variable named OVERRIDE_CONTEXT that will allow us to set the context name to something that complies with the DNS naming standards. DNS is a critical component for federation as it allows us to do cross-cluster discovery and service communication. This is important in a federated world where clusters may be in different data centers and even providers.

Run these commands to create your AWS cluster:

$ export KUBERNETES_PROVIDER=aws
$ export OVERRIDE_CONTEXT=awsk8s
$ ./kube-up.sh

Next, we will create a GCE cluster, once again using the OVERRIDE_CONTEXT environment variable:

$ export KUBERNETES_PROVIDER=gce
$ export OVERRIDE_CONTEXT=gcek8s

$ ./kube-up.sh

If we take a look at our contexts now, we will notice both the awsk8s and the gcek8s that we just created. The star in front of gcek8s denotes that it's where kubectl is currently pointing and executing against:

$ kubectl config get-contexts

The preceding command should produce something like the following:

Context Listing
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.15.82