Created
May 12, 2019 11:54
-
-
Save viktorbenei/0e44b7a6cb33142f2882d506de0fcc73 to your computer and use it in GitHub Desktop.
Create a GKE Kubernetes cluster (with Istio addon enabled) and install Knative on top of it
This file contains hidden or 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
#!/usr/bin/env bash | |
set -ex | |
if [ -z "$GCP_PROJECT_ID" ] ; then | |
echo '[!] GCP_PROJECT_ID is not set - required' | |
exit 1 | |
fi | |
gcloud config set project "$GCP_PROJECT_ID" | |
function create_gke_cluster_with_istio { | |
# To see which GKE versions are supported/recommended for | |
# Cloud Run on GKE: https://cloud.google.com/run/docs/gke/cluster-versions | |
gcloud beta container clusters create knativeexp \ | |
--addons=HorizontalPodAutoscaling,HttpLoadBalancing,Istio \ | |
--machine-type=n1-standard-4 \ | |
--cluster-version=1.12.6 --zone=us-central1-a \ | |
--enable-stackdriver-kubernetes --enable-ip-alias \ | |
--scopes cloud-platform | |
} | |
function install_knative { | |
kubectl apply --filename https://github.com/knative/serving/releases/download/v0.5.0/serving.yaml \ | |
--filename https://github.com/knative/eventing/releases/download/v0.5.0/release.yaml \ | |
--filename https://github.com/knative/eventing-sources/releases/download/v0.5.0/eventing-sources.yaml \ | |
--filename https://github.com/knative/serving/releases/download/v0.5.0/monitoring.yaml \ | |
--filename https://raw.githubusercontent.com/knative/serving/v0.5.0/third_party/config/build/clusterrole.yaml | |
} | |
# MAIN | |
create_gke_cluster_with_istio | |
# re-run the install - known issue: https://github.com/knative/serving/issues/2940 | |
install_knative || install_knative | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment