Google Kubernetes Engine (GKE)
This document describes end-to-end deployment process of DecisionRules app for Google Kubernetes Engine.
Prerequisites:
DecisionRules docker images for both client and server.
MongoDB database with administrator access.
GCP account with activated billing account.
Mandatory GCP APIs and services:
Kubernetes Engine API
Memorystore
Certificate Manager
Creating Memorystore Redis instance
Click on “Create Instance” on Memorystore page
Set desired configuration of Redis
Click “Create”
Price of Redis instance depends on configuration settings, please think this through before create too powerful and too expensive instances that are not really needed. Cost estimation is on the left side of form.
After creating Redis instance copy primary endpoint IPv4 address. This address will be used for decisionrules/server later.
Creating GKE cluster
Use a Standard cluster, because the Autopilot feature is broken and doesn’t work properly. This is very important and you won't be able to proceed with Autopilot.
Set the name of the cluster
Choose desired Location type
Zonal picks one zone in region
Regional picks one region with all zones included
Choose control plane version
Depends on if you want static GKE version or not.
Configure nodepools
On the Nodes page you can configure which VMs will be deployed in Kubernetes node(s). This depends on the requirements of the system.
Leave disk as is if there are no requirements for specific settings.
Configure Node-pool
Here we choose the number of nodes we want to spin up in our Kubernetes cluster
We can also enable autoscaler and node locations
Click “Create”
Setting up GKE cluster
Connect to the cluster with google cloud shell (recommended) or setup your own SSH connection with your favorite terminal.
Connect to the cluster with this command:
Check that you are connected to the right cluster by verifying cluster node that you specified earlier by command:
You should see something like this:
Creating DecisionRules namespace:
Create a yaml file with the following contents:
You can just redirect the standard output of the echo command to a yaml file in bash or open any editor that your terminal offers (GCP - Active Cloud Shell offers nano afaik).
Then apply these settings:
You can verify that your namespace is created by running:
kubectl get namespaces | grep decisionrules
Install cert-manager
Check that cert-manager is installed properly with kubectl get all -n cert-manager
You should see something like this:
Now apply the ClusterIssuer class
Now apply Issuer class
Now we can apply cert as is described here:
Install Ingress:
Deploying Ingress:
apply file below
We can check that ingress is up and running by running commad: kubectl get all -n ingress-nginx
You should see something like this:
Obtain IPv4 address of Ingress for DNS A record:
Run command: kubectl get ingress --namespace=decisionrules
You should see something like this:
Deploy app
Please, be aware of container resource consuptions, because if you exceed your MVs HW limits you wont be able to deploy pods.
For DB security you can add PODs IPs to the network access rules. You can obtain these addresses with command below:
kubectl get pod -o wide
Apply changed configuration above.
Then, you can verify that everything is running by running command: kubectl get all -n decisionrules
You should see something like this:
Now just add Ingress IPv4 address to your DNS and its done. App is available on hostname you specified earlier with TLS working.
