kbzqlq
Last Updated: December 29, 2017
·
56
· v1r00s

Using GKE Regional master

Introduction

While deweloping K8s you can choose a beta option to deploy master regional location (insted of zone).

According to the tooltip shown in GCP Console:

Determines whether your cluster's master VMs are localized within a single zone, or spread across multiple zones in one region.

Deploying the cluster

To deploy new cluster using regional location you can choose Regional (beta) radio button in Location section (if you creating the cluster using GCP web console) or --region argument (if using gcloud command).

Solving Beta related issues (connecting to cluster)

Since there is a beta option there are a few caveats:

  1. to create cluster using gsutil you have to use beta version of the gcloud container clusters create command. For example: gcloud beta container clusters create foo --region europe-west3 if you omit the betta word you will get en error:
viroos@utilvm:~$ gcloud container clusters create foo --region europe-west3
ERROR: (gcloud.container.clusters.create) unrecognized arguments:
  --region
  europe-west3
viroos@utilvm:~$ gcloud beta container clusters create foo --region europe-west3
  1. you have to use beta version of get-credentials command with --region flag support in example: gcloud beta container clusters get-credentials foo --region europe-west3
  2. Before you run `get-credentials you have to set use_v1_api_client flag to false (gcloud config set container/use_v1_api_client false). Other wise you will get error similar to this:
viroos@utilvm:~$ gcloud beta container clusters get-credentials foo --region europe-west3
WARNING: Accessing a Kubernetes Engine cluster requires the kubernetes commandline
client [kubectl]. To install, run
  $ gcloud components install kubectl

Warning: you invoked `gcloud beta`, but with current configuration
Kubernetes Engine v1 API will be used instead of v1beta1 API.
If you intended to use v1beta1 API instead, please set
container/use_v1_api_client property to false.

Do you want to continue (Y/n)?  y

Fetching cluster endpoint and auth data.
ERROR: (gcloud.beta.container.clusters.get-credentials) ResponseError: code=400, message='europe-west3' is not a valid zone.
Say Thanks
Respond