Spinnaker
Spinnaker is an open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence.
To install Spinnaker locally follow the next steps. They will walk you through installing a local Kubernetes cluster (using Minikube) and deploying Spinnaker on it using Halyard.
If you plan to deploy Spinnaker on a remote Kubernetes cluster (AWS EKS, GKE / other), the steps are pretty similar.
Install Minikube
Minikube provides a way to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.
To install Minikube, follow the steps here, depending on your platform: https://kubernetes.io/docs/tasks/tools/install-minikube/
Start Minikube. Take into consideration that Spinnaker is composed out of multiple microservices, so you’ll need quite some memory and cpu to run it locally.
minikube start --cpus 4 --memory 8192
Optional: Install Minio for S3 storage
Spinnaker needs a persistent storage, usually AWS S3. Instead of using an actual AWS S3 bucket, you can install a local server that mimics the AWS S3 API. This is where Minio comes into place.
To download Minio go here.
To start Minio locally:
export MINIO_ACCESS_KEY=minio
export MINIO_SECRET_KEY=miniostorage
minio server /tmp/minio_s3_data
Install Halyard
Halyard is a tool for configuring, installing, and updating Spinnaker.
For MacOS:
curl -O https://raw.githubusercontent.com/spinnaker/halyard/master/install/macos/InstallHalyard.sh
sudo bash InstallHalyard.sh
For other platforms go here.
Configure for Minikube (Kubernetes) deployment
At this point you should have the Minio server up and running alongside Minikube.
kubectl should also work
kubectl get nodes
NAME STATUS ROLES AGE VERSION
Minikube Ready 28d v1.10.3
Hal: Setup Spinnaker storage
hal config storage s3 edit --access-key-id minio --secret-access-key --region us-east-1 --endpoint http://127.0.0.1:9000
hal config storage edit --type s3
Hal: Configure Docker registry
At least a docker registry is required for the Spinnaker kubernetes setup. You can add the public docker registry:
hal config provider docker-registry account add dockerhub --address index.docker.io --repositories library/nginx
And you can even add your private Docker registries:
# hal config provider docker-registry account add docker-private-repo --address https://my-private-docker-repo.example.com --username myuser --password
You then need to enable the docker-registry provider:
hal config provider docker-registry enable
Hal: Configure the Spinnaker Kubernetes provider
hal config provider kubernetes account add my-k8s-account --docker-registries dockerhub --context $(kubectl config current-context)
hal config provider kubernetes enable
hal config deploy edit --type=distributed --account-name my-k8s-account
Hal: Configure Spinnaker version
To view the full version list:
hal version list
To setup the desired version:
hal config version edit --version 1.8.0
Hal: Deploy spinnaker to Minikube (Kubernetes)
hal deploy apply
This will take a while. Hal will try to spin up all the required Spinnaker pods in the Kubernetes cluster.
You can see them in action by running
kubectl get pods --namespace spinnaker
NAME READY STATUS RESTARTS AGE
spin-clouddriver-bootstrap-v000-fjhqs 1/1 Running 0 2h
spin-clouddriver-v000-sm728 1/1 Running 0 2h
spin-deck-v000-zwf69 1/1 Running 0 2h
spin-echo-v000-fwfm5 1/1 Running 0 2h
spin-front50-v000-njdzn 1/1 Running 0 2h
spin-gate-v000-4kn5z 1/1 Running 0 2h
spin-igor-v000-msbj2 1/1 Running 0 2h
spin-orca-bootstrap-v000-64cg8 1/1 Running 0 2h
spin-orca-v000-9lgp4 1/1 Running 0 2h
spin-redis-bootstrap-v000-xtldr 1/1 Running 0 2h
spin-redis-v000-vffcd 1/1 Running 0 2h
spin-rosco-v000-jvhh4 1/1 Running 0 2h
Connect to Spinnaker
Once everything is done, it’s time to connect to the Spinnaker UI. You can run:
hal deploy connect
If you don’t wanna use hal to connect, you can do a port forwarding to the Spinnaker pods:
alias spin_gate='kubectl port-forward -n spinnaker $(kubectl get pods -n spinnaker -o=custom-columns=NAME:.metadata.name | grep gate) 8084:8084'
alias spin_deck='kubectl port-forward -n spinnaker $(kubectl get pods -n spinnaker -o=custom-columns=NAME:.metadata.name | grep deck) 9001:9000'
alias spinnaker='spin_gate &; spin_deck &'
And then run:
❯ spinnaker
[1] 20836
[2] 20840
❯ Forwarding from 127.0.0.1:8084 -> 8084
Forwarding from [::1]:8084 -> 8084
Forwarding from 127.0.0.1:9001 -> 9000
Forwarding from [::1]:9001 -> 9000
Open your browser and go to http://localhost:9001
Awesome job! I opted for hal after trying installation with helm .. Helm worked but I couldnt create the loadbalancer or even clusters for my app in spinnaker.
LikeLike
@Simon Takite,
Glad this helped!
The current Helm chart for spinnaker is pretty old. However, the guys are working on revamping the stable/spinnaker helm chart in order to leverage Hal: https://github.com/helm/charts/pull/6407
That should be pretty awesome.
LikeLike
I get stuck during hal deploy apply command. It gets stuck on manually deploying spin-clouddriver-bootstrap.
LikeLike
Thanks for the guide, it was very useful. I got stuck after the apply command because the spin-front50 wasn’t starting correctly, giving the following exception in the logs: java.lang.IllegalArgumentException: hostname cannot be null
I fixed that by specifying the hostname hal config storage command. (i.e. –endpoint http://localhost:9000/ instead of just –endpoint http://:9000/)
Hope this helps!
LikeLike
Thanks for the feedback, @Enrico Pelizzon. I updated the post with your suggestion.
LikeLike