The single-cluster examples use the following GKE setup for deploying the manifests.
$ gcloud container clusters create gke-1 \
--zone us-west1-a \
--enable-ip-alias \
--release-channel rapid
The multi-cluster examples use the following GKE setup for deploying the manifests.
- Deploy two GKE clusters within your Google Cloud project.
$ gcloud container clusters create gke-1 \
--zone us-west1-a \
--enable-ip-alias \
--release-channel rapid
$ gcloud container clusters create gke-2 \
--zone us-east1-b \
--enable-ip-alias \
--release-channel rapid
- Get the cluster credentials and rename the contexts to something easier to use:
$ gcloud container clusters get-credentials gke-1 --zone us-west1-a
Fetching cluster endpoint and auth data.
kubeconfig entry generated for gke-1.
$ gcloud container clusters get-credentials gke-2 --zone us-east1-b
Fetching cluster endpoint and auth data.
kubeconfig entry generated for gke-2.
$ kubectl config rename-context ${GKE1_CONTEXT} gke-1
$ kubectl config rename-context ${GKE2_CONTEXT} gke-2
- Enable the Hub, Anthos, and MultiClusterIngress APIs as done here.
- Register your two clusters. Confirm that they are registered with Hub.
$ gcloud container hub memberships list
NAME EXTERNAL_ID
gke-1 50468ae8-29a3-4ea1-b7ff-0e216533619a
gke-2 6c2704d2-e499-465d-99d6-3ca1f3d8170b
- Now enable Multi-cluster Ingress and specify
gke-1
as your config cluster.
$ gcloud alpha container hub ingress enable \
--config-membership=projects/<your-project>/locations/global/memberships/gke-1
- Confirm that MCI is configured properly.
$ gcloud alpha container hub ingress describe
createTime: '2020-11-14T20:50:53.856780163Z'
featureState:
details:
code: OK
description: Ready to use
detailsByMembership:
projects/759444700240/locations/global/memberships/gke-1:
code: OK
projects/759444700240/locations/global/memberships/gke-2:
code: OK
hasResources: true
lifecycleState: ENABLED
multiclusteringressFeatureSpec:
configMembership: projects/church-243723/locations/global/memberships/gke-1
name: projects/church-243723/locations/global/features/multiclusteringress
updateTime: '2020-11-14T20:50:54.761389487Z'