Deploying Spinnaker on GKE with Traefik Ingress

Sail away!

Last week I was asked to create a Spinnaker pipeline deployed on a GKE cluster. Even though Google offers a great tutorial, I found that it didn’t cover the part of actually sharing the Spinnaker setup beyond a port forward to localhost.

The scope of this article covers the part from forwarding a pod port to localhost and to adding Traefik load balancer, setting up ingresses to expose Spinnaker to the outside, all while maintaining Spinnaker’s own access to its API.

Note: hint about Spinnaker api setup came from here.

Note: each step is linked to a file in a GitHub repo. Ingress specifications would need a domain that will be used to point to the appropriate ingress and served by the appropriate service. You will need to setup a DNS record pointing to the GKE cluster.

Follow on the tutorial, setting up Spinnaker using helm.

This will get you a working cluster, setup with ClusterIP services. This won’t do you any good with GKE though, but you can get a taste of the UI by forwarding the port as suggested.

export DECK_POD=$(kubectl get pods --namespace default -l "cluster=spin-deck" \-o jsonpath="{.items[0].metadata.name}")kubectl port-forward --namespace default $DECK_POD 8080:9000 >> /dev/null &

Setup Traefik

You will need:

Setup Consul

Consul is a versatile KV store, I tend to use it to hold Traefik configuration, as well as other configuration. I am planning to learn to use it as a service discovery system as well, it tends to beat Kubernetes’ very own. You will need:

Spinnaker overrides

This is the interesting part. Since the default helm chart uses ClusterIP, we need to override some services to turn them to NodePort. By “some” I mean exactly two, “spin-deck” and “spin-gate”. You will need:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store