Skip to content

Latest commit

 

History

History
85 lines (65 loc) · 2.5 KB

cluster-setup.md

File metadata and controls

85 lines (65 loc) · 2.5 KB

Single-cluster environment

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 

Multi-cluster environment

The multi-cluster examples use the following GKE setup for deploying the manifests.

  1. 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 
  1. 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
  1. Enable the Hub, Anthos, and MultiClusterIngress APIs as done here.
  2. 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
  1. 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
  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'