-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Improve GKE instructions (#315)
This change improves GKE cluster creation instructions by adding a custom service account and new VPC network. It also integrates those instructions into the overall install instructions.
- Loading branch information
1 parent
15c95d6
commit 57254cb
Showing
5 changed files
with
171 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Use an existing Kf cluster | ||
|
||
To use an existing cluster, it is assumed your cluster has the following: | ||
|
||
* Can run containers as root. | ||
* Has at least 12 vCPUs. | ||
* Has at least 45G of memory. | ||
* Has a minimum of three nodes. | ||
|
||
## Install dependencies | ||
|
||
`kf` uses Istio to route HTTP requests to the running applications and Knative | ||
to deploy and scale applications. | ||
|
||
> Note: Installing Istio and Knative Serve can be skipped if you are [using | ||
> Cloud Run on GKE](/docs/install/existing-cluster.md). | ||
Install Istio: | ||
|
||
```.sh | ||
kubectl apply --filename | ||
https://raw.githubusercontent.com/knative/serving/v0.6.1/third_party/istio-1.1.3/istio-crds.yaml | ||
&& \ | ||
kubectl apply --filename | ||
https://raw.githubusercontent.com/knative/serving/v0.6.1/third_party/istio-1.1.3/istio.yaml | ||
&& \ | ||
kubectl label namespace default istio-injection=enabled | ||
``` | ||
|
||
Install Knative Serve: | ||
|
||
```.sh | ||
kubectl apply --filename | ||
https://github.com/knative/serving/releases/download/v0.6.1/serving.yaml \ | ||
--filename | ||
https://github.com/knative/serving/releases/download/v0.6.1/monitoring.yaml \ | ||
--filename | ||
https://raw.githubusercontent.com/knative/serving/v0.6.1/third_party/config/build/clusterrole.yaml | ||
|
||
## Confirm kubeconfig | ||
The workstation you install `kf` on must have a valid `kubectl` configuration | ||
located at `$HOME/.kube/config`. | ||
|
||
### Next steps | ||
Continue with the [install docs](docs/install.md) to install Kf into the cluster you just created. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Prepping GKE for KF | ||
|
||
This guide walks you through the installation of GKE with Cloud Run with the | ||
intent of using it with `kf`. | ||
|
||
> Note: Installing Cloud Run is equivalent to installing Knative Serve and | ||
> Istio. Therefore, only Knative Build is required after. | ||
## Before you begin | ||
|
||
This guide assumes you are using `bash` in a Mac or Linux environment; some | ||
commands will need to be adjusted for use in a Windows environment. | ||
|
||
### Install Cloud SDK | ||
|
||
1. If you already have `gcloud` installed you can skip these steps. | ||
1. Download and install the gcloud command line tool: | ||
https://cloud.google.com/sdk/install | ||
1. Authorize `gcloud`: | ||
```sh | ||
gcloud auth login | ||
``` | ||
|
||
### Setup environment variables | ||
|
||
We will use these environment variables to simplify the installation. | ||
|
||
``` | ||
export CLUSTER_NAME=[REPLACE] | ||
export ZONE=[REPLACE] | ||
export PROJECT_ID=[REPLACE] | ||
export SERVICE_ACCOUNT=$CLUSTER_NAME@$PROJECT_ID.iam.gserviceaccount.com | ||
export NETWORK=projects/$PROJECT_ID/global/networks/$CLUSTER_NAME | ||
``` | ||
*NOTE: Replace the `[REPLACE]` value with the according values.* | ||
### Create a service account and give it `roles/storage.admin` on your project: | ||
```sh | ||
gcloud iam service-accounts create $CLUSTER_NAME | ||
gcloud projects add-iam-policy-binding $PROJECT_ID \ | ||
--member=serviceAccount:$SERVICE_ACCOUNT \ | ||
--role="roles/storage.admin" | ||
``` | ||
|
||
### Create a network | ||
|
||
If you have an existing network you wish to use, customize the `NETWORK` env var set previously to point to your network and skip this step. | ||
|
||
```sh | ||
gcloud compute networks create $CLUSTER_NAME | ||
``` | ||
|
||
### Create the Kubernetes cluster | ||
|
||
```sh | ||
gcloud beta container clusters create $CLUSTER_NAME \ | ||
--zone $ZONE \ | ||
--no-enable-basic-auth \ | ||
--cluster-version "1.13.6-gke.13" \ | ||
--machine-type "n1-standard-1" \ | ||
--image-type "COS" \ | ||
--disk-type "pd-standard" \ | ||
--disk-size "100" \ | ||
--metadata disable-legacy-endpoints=true \ | ||
--service-account $SERVICE_ACCOUNT \ | ||
--num-nodes "3" \ | ||
--enable-stackdriver-kubernetes \ | ||
--enable-ip-alias \ | ||
--network $NETWORK \ | ||
--default-max-pods-per-node "110" \ | ||
--addons HorizontalPodAutoscaling,HttpLoadBalancing,Istio,CloudRun \ | ||
--istio-config auth=MTLS_PERMISSIVE \ | ||
--enable-autoupgrade \ | ||
--enable-autorepair | ||
``` | ||
|
||
### Target your cluster: | ||
|
||
```sh | ||
gcloud container clusters get-credentials $CLUSTER_NAME | ||
``` | ||
|
||
### Next steps | ||
Continue with the [install docs](/docs/install.md) to install Kf into the cluster you just created. |