Skip to content

Instantly share code, notes, and snippets.

@derberg
Last active December 5, 2019 15:50
Show Gist options
  • Save derberg/bdadaeac25ff4b245e35832262313fe0 to your computer and use it in GitHub Desktop.
Save derberg/bdadaeac25ff4b245e35832262313fe0 to your computer and use it in GitHub Desktop.
build-a-cloud-native-extension-for-wordpress - Prepare the GKE cluster with Kyma
# Set ENV variables. See sample values in comments:
export KYMA_VERSION={KYMA_RELEASE_VERSION}      # 1.8.0
export CLUSTER_NAME={CLUSTER_NAME_YOU_WANT}     # kyma-cluster
export GCP_PROJECT={YOUR_GCP_PROJECT}           # myproject
export GCP_ZONE={GCP_ZONE_TO_DEPLOY_TO}         # europe-west1-b
# Create a cluster
gcloud container --project "$GCP_PROJECT" clusters \
create "$CLUSTER_NAME" --zone "$GCP_ZONE" \
--cluster-version "1.14" --machine-type "n1-standard-4" \
--addons HorizontalPodAutoscaling,HttpLoadBalancing
# Add the current user as an admin
gcloud container clusters get-credentials $CLUSTER_NAME --zone $GCP_ZONE --project $GCP_PROJECT
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value account)
# Install Tiller
kubectl apply -f https://raw.githubusercontent.com/kyma-project/kyma/$KYMA_VERSION/installation/resources/tiller.yaml
# Install Kyma
kubectl apply -f https://github.com/kyma-project/kyma/releases/download/$KYMA_VERSION/kyma-installer-cluster.yaml
# Show the Kyma installation progress. Stop the script with `Ctrl+C` when the installation finishes.
while true; do \
  kubectl -n default get installation/kyma-installation -o jsonpath="{'Status: '}{.status.state}{', description: '}{.status.description}"; echo; \
  sleep 5; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment