Config Helm Release for GKE Cluster

Learn how to create a different configuration file for a different environment.

Our application is up and running on Google Cloud, but a couple of things could still be done better, e.g., not using the kubectl command to open the kanban-frontend main page. The best approach would be to have a URL that can be used by anyone, so we can share it.

Also in this lesson, we’ll replace our PostgreSQL database that is installed on a cluster with an external database located on a different cloud or server. By switching our database from Kubernetes to another place we can get rid of the maintenance burden. Especially if we have only intermediate or basic knowledge of the database.

Finally, this lesson aims to help us start using our own Helm chart and see how easy it is to reuse it in a different environment. With only a few tweaks we can do almost anything.

Note: As usual, at the end of the lesson, there is an interactive sandbox with all the code that was discussed.

Set up load balancer

Let’s start with exposing kanban-frontend to the internet. There are a couple of ways we could approach it. One way, which is probably the best one but at the same time the most work-intensive, would be to create an Ingress. Another approach would be to change the type of kanban-frontend's Service to NodePort, but that’s usually not advised.

Luckily for us, we’ve deployed our application on the Google Cloud, which supports the LoadBalancer Service type. If we replace ClusterIP in the Service definition we’ll expose our application to the Internet.

Because we don’t want to make any changes in a Helm chart itself we need to create a values.yaml file that will override this value. So here it is, the gke.yaml file:

Get hands-on with 1400+ tech skills courses.