Deploy Platform Operator via GKE and Expose LB for External Clients
Deploying Platform Operator and Platform on GKE
Create cluster via GKE GUI
These settings can be configured as necessary to fit your environment.
One deployed, select ‘Connect’ to retrieve the CLI string required for kubectl connectivity.
Deploy operator and platform. Note that if using a local, custom helm chart for the HiveMQ platform, the path to the local chart can be used in place of
hivemq/hivemq-platform
, with the -f option.helm install -f local/file
.helm install test-operator hivemq/hivemq-platform-operator --wait && helm install test-platform hivemq/hivemq-platform --wait
If you encounter an error citing that Break is not defined, ensure that your installed Helm version is at least version 1.12.
Error: INSTALLATION FAILED: parse error at (hivemq-platform/templates/_helpers.tpl:93): function "break" not defined
Once deployed successfully, validation of success can be done with
kubectl describe pods
. This will provide the listed pods and validate their status.
GKE Ingresses, as created through the GUI, only support HTTP/HTTPS connections. In order to allow access to the cluster from external clients, a separate load balancer will need to be created.
Using the default deployment with the platform operator and platform pods, access your google cloud console, and perform the following :
touch lb-values.yaml
This will create a new, empty lb-values.yaml file in your current directory. Using your preferred editor, change the values of this
lb-values.yaml
file to the following :
Note that the selector field here contains a tag
hivemq-platform: your-platform-deployment-name
. The value section ‘your-platform-deployment-name’ here will need to be replaced by the name provided to the HiveMQ platform during thehelm install
command.This can also be confirmed by running
kubectl get pods
to list pod names, thenkubectl describe pod POD_NAME
. This will provide a description of the provided pod name. Within the labels, and annotations section, you will find the following :
We are specifically looking for the
hivemq-platform=test-platform
line here. This will be the name provided during the helm install, and is used to point the new load balancer to these pods.Once the
lb-values.yaml
file has been updated with the appropriate selector value, save the file and create this service withkubectl apply -f lb-values.yaml
.This will begin to automatically create the service from this file, and a Google Cloud Controller will be awoken to automatically provide an external address. This can be seen by entering
kubectl get services
.