From 2fa2c5d3103db101f534cf1add49e18841597ca7 Mon Sep 17 00:00:00 2001 From: Christie Wilson Date: Wed, 29 May 2019 16:00:22 -0700 Subject: [PATCH] =?UTF-8?q?Update=20dev=20guide=20to=20have=20GKE=20cluste?= =?UTF-8?q?r=20install=20instructions=20=F0=9F=93=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We had been pointing folks at the knative docs on cluster setup, (https://github.com/knative/docs/blob/master/docs/install/Knative-with-GKE.md#creating-a-kubernetes-cluster) but actually the requirements for running a knative cluster are much more intense than just for running Tekton (they require 10 nodes, I've been fine with just 3 all this time), so now let's have our own instructions that we can keep in sync with Tekton. Plus this way more of the info you need is right there in the dev guide :) --- DEVELOPMENT.md | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 015fe901d52..26b463f378a 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -91,20 +91,53 @@ configuring Kubernetes resources. ## Kubernetes cluster Docker for Desktop using an edge version has been proven to work for both -developing and running Pipelines. Your Kubernetes version must be 1.11 or later. +developing and running Pipelines. The recommended configuration is: + +- Kubernetes version 1.11 or later +- 4 vCPU nodes (`n1-standard-4`) +- Node autoscaling, up to 3 nodes +- API scopes for cloud-platform To setup a cluster with GKE: 1. [Install required tools and setup GCP project](https://github.com/knative/docs/blob/master/docs/install/Knative-with-GKE.md#before-you-begin) (You may find it useful to save the ID of the project in an environment variable (e.g. `PROJECT_ID`). -1. [Create a GKE cluster](https://github.com/knative/docs/blob/master/docs/install/Knative-with-GKE.md#creating-a-kubernetes-cluster) -Note that -[the `--scopes` argument to `gcloud container cluster create`](https://cloud.google.com/sdk/gcloud/reference/container/clusters/create#--scopes) -controls what GCP resources the cluster's default service account has access to; -for example to give the default service account full access to your GCR -registry, you can add `storage-full` to your `--scopes` arg. +1. Create a GKE cluster (with `--cluster-version=latest` but you can use any version 1.11 or later): + + ```bash + export PROJECT_ID=my-gcp-project + export CLUSTER_NAME=mycoolcluster + + gcloud container clusters create $CLUSTER_NAME \ + --enable-autoscaling \ + --min-nodes=1 \ + --max-nodes=3 \ + --scopes=cloud-platform \ + --enable-basic-auth \ + --no-issue-client-certificate \ + --project=$PROJECT_ID \ + --region=us-central1 \ + --machine-type=n1-standard-4 \ + --image-type=cos \ + --num-nodes=1 \ + --cluster-version=latest + ``` + + Note that + [the `--scopes` argument to `gcloud container cluster create`](https://cloud.google.com/sdk/gcloud/reference/container/clusters/create#--scopes) + controls what GCP resources the cluster's default service account has access to; + for example to give the default service account full access to your GCR + registry, you can add `storage-full` to your `--scopes` arg. + +1. Grant cluster-admin permissions to the current user: + + ```bash + kubectl create clusterrolebinding cluster-admin-binding \ + --clusterrole=cluster-admin \ + --user=$(gcloud config get-value core/account) + ``` ## Environment Setup