Deploy Spinnaker onto K8S and access via Ingress

Kasun Sameera
Nov 3 · 4 min read

In this small story, I would like to share how I deployed Spinnaker onto Kubernetes and accessed it via ingress.


Spinnaker is a multi-cloud continuous delivery platform. It provides two main features.

  • Application management
  • Application deployment

Back in my previous company we used Spinnaker to deploy our microservices onto Kubernetes clusters. I did not involve in setting up the Spinnaker but I created pipelines for microservices. But I always wanted to setup Spinnaker by my own.

As usual I started reading Spinnaker documentation. According to the documentation the recommended way to setup Spinnaker is a distributed installation onto a Kubernetes cluster. So I wanted to try that.

Instructions given by the Spinnaker documentation, were followed.

I installed Halyard using below 2 commands,

curl -O https://raw.githubusercontent.com/spinnaker/halyard/master/install/macos/InstallHalyard.sh

Then I setup my cloud provider as kubernetes.

hal config provider kubernetes enable

Then added an account.

CONTEXT=$(kubectl config current-context)

Then Halyard was configured to deploy Spinnaker onto Kubernetes. As it is the recommended way to use in production.

hal config deploy edit --type distributed --account-name $ACCOUNT

Then I setup a value for LONGEST_SERVICE_STARTUP_TIME. That is used for liveness-probe-initial-delay-seconds . I setup it as 600 but it can be changed according to your requirement (My k8s is very basic one first time it took some time to spin up pods).

hal config deploy edit --liveness-probe-enabled true --liveness-probe-initial-delay-seconds $LONGEST_SERVICE_STARTUP_TIME

Then I selected Redis as my storage. But it is not recommended for production(for this demo it is enough).

hal config storage edit --type redis

Then I did very important thing that is not in the documentation. I setup UI hostname and API host name. I did it using below 2 commands.

hal config security ui edit \
--override-base-url http://spinnaker.prod

hal config security api edit \
--override-base-url http://spinnaker-api.prod

Then Spinnaker version was configured.

hal config version edit --version 1.13.12

Then I applied these changes using below command.

hal deploy apply

When you run above command you will get an error similar below.

Error from server (AlreadyExists): error when creating "STDIN": namespaces

Try again running the same command. It will solve the that issue.

What is important next is I created an ingress rules for Spinnaker UI(dek) and API(gate)

Ingress for Gate
Ingress for Spinnaker Dek

Then I got public IP for Spinnaker UI and API by running kubectl get ingress -n spinnaker command.

Spinnaker Ingress

Then I added host entries for spinnaker.prod and spinnaker-api.prod. Then accessed Spinnaker using spinnaker.prod host name. If it doesn’t work first time then you will have to restart spin-deck pod.

Spinnaker via Ingress

Follow us on Twitter 🐦 and Facebook 👥 and join our Facebook Group 💬.

To join our community Slack 🗣️ and read our weekly Faun topics 🗞️, click here⬇

If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇

Faun

The Must-Read Publication for Aspiring Developers & DevOps Enthusiasts. Medium’s largest DevOps publication.

Kasun Sameera

Written by

developer. microservice,devops enthusiast.

Faun

Faun

The Must-Read Publication for Aspiring Developers & DevOps Enthusiasts. Medium’s largest DevOps publication.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade