This cookbook will walk you through the process of installing Anypoint Runtime Fabric (RTF) on Google Kubernetes Engine (GKE). You will create a Google Kubernetes Cluster (GKE) and install RTF. Once completed you will deploy a sample MuleSoft application to verify everything is working.

Pre-reqs

Follow instructions below to use GUI (suggested) or alternatively use command line:

gcloud compute networks create rtf-vpc --project=infra-ratio-309301 --subnet-mode=custom --mtu=1460 --bgp-routing-mode=regional

gcloud compute networks subnets create rtf-subnet --project=infra-ratio-309301 --range=10.0.0.0/16 --network=rtf-vpc --region=us-west1

Suggested Instructions:

https://console.cloud.google.com/

Follow instructions below to use GUI (suggested) or alternatively use command line:

gcloud beta container --project "infra-ratio-309301" clusters create "rtf-cluster" --region "us-west1" --no-enable-basic-auth --cluster-version "1.18.16-gke.302" --release-channel "regular" --machine-type "e2-medium" --image-type "COS" --disk-type "pd-standard" --disk-size "100" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" --num-nodes "1" --enable-stackdriver-kubernetes --enable-ip-alias --network "projects/infra-ratio-309301/global/networks/rtf-vpc" --subnetwork "projects/infra-ratio-309301/regions/us-west1/subnetworks/rtf-subnet" --default-max-pods-per-node "110" --no-enable-master-authorized-networks --addons HorizontalPodAutoscaling,HttpLoadBalancing,GcePersistentDiskCsiDriver --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0 --enable-shielded-nodes

Suggested Instructions:

Kubectl get namespaces

Download rtfctl

curl -L https://anypoint.mulesoft.com/runtimefabric/api/download/rtfctl/latest -o rtfctl
chmod +x rtfctl

Create RTF in Runtime Manager

Install RTF

./rtfctl validate <activation_data>

./rtfctl install <activation_data>

If everything went well, you will see Runtime Fabric is ready and the installation exists without errors. At this point, validate the installation with these steps:

kubectl get pods -n rtf

base64 -w0 license.lic

On macOS:

cat license.lic | base64
./rtfctl apply mule-license <BASE64_ENCODED_STRING>
./rtfctl get mule-license

One of the most popular Ingress controllers being used is Nginx. At a high level, the architecture diagram looks like this:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.40.2/deploy/static/provider/cloud/deploy.yaml

kubectl get services -n ingress-nginx

Access Your Application

kubectl get services -n ingress-nginx
curl -vv http://hello-world.rtf-on-gke.mulesoftdemo.com/helloWorld --resolve hello-world.rtf-on-gke.mulesoftdemo.com:80:<IP address of ingress controller>

If you see Hello World! Returned congratulations!!! You have successfully installed RTF on GKE!