Please credit this guide if you use its instructions elsewhere.
All the commands in this document are meant to be run from your computer’s terminal, unless stated otherwise. This guide has only been tested on macOS Catalina.
- Download and install Docker Desktop from: https://www.docker.com/products/docker-desktop
- Enable Kubernetes:
- Launch Docker
- Click the Docker icon on your taskbar and then click Preferences.
- Go to the Resources section and set the following:
- CPUs: 8
- Memory: 16.00 GB
- Swap: 2 GB
- Disk image size: 64 GB
- Go to the Kubernetes section.
- Check Enable Kubernetes.
- Check Deploy Docker Stacks to Kubernetes by default.
- Select Show system containers (advanced).
- Click Apply & Restart (this will take a few minutes).
- In a terminal, execute
kubectl version
to validate install.- You should see something like the following
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:16:51Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:07:57Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
Install Halyard on Docker
- Install Halyard on Docker following Spinnaker's Instructions.
- Stop the Halyard container.
docker stop halyard
We will be using Minio running in Kubernetes as a Storage Service for Spinnaker.
You will need Helm 3+ installed for this section. If you do not have it follow these instructions. Then run
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm repo update
-
Create a PersistentVolume (PV) in Kubernetes, run:
-
echo "apiVersion: v1 kind: PersistentVolume metadata: name: minio-pv labels: type: local spec: storageClassName: manual capacity: storage: 2Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data"" | kubectl apply -f -
-
-
Create a PersistentVolumeClaim (PVC) in Kubernetes.
- First, create the spinnaker namespace.
kubectl create namespace spinnaker
- Then create the PVC, run:
-
echo "apiVersion: v1 kind: PersistentVolumeClaim metadata: name: minio-pvc namespace: spinnaker spec: accessModes: - ReadWriteOnce resources: requests: storage: 2Gi" | kubectl apply -f -
- First, create the spinnaker namespace.
- Deploy Minio to Kubernetes.
(reference)
helm install minio stable/minio --namespace spinnaker --set accessKey=minioadmin --set secretKey=minioadmin --set persistence.existingClaim=minio-pvc
- Create this file on your computer (reference):
~/.hal/default/profiles/front50-local.yml
- Write this into the file and save it:
spinnaker.s3.versioning: false
- Write this into the file and save it:
- Run the Halyard docker container.
docker run --name halyard --rm -v ~/.hal:/home/spinnaker/.hal -v ~/.kube:/home/spinnaker/.kube -it gcr.io/spinnaker-marketplace/halyard:stable
- In another terminal, exec into the running Halyard container.
docker exec -it halyard bash
- In the Halyard container, run:
(reference)
echo "minioadmin" | hal config storage s3 edit --endpoint http://minio.spinnaker.svc.cluster.local:9000 --access-key-id minioadmin --secret-access-key
hal config storage edit --type s3
hal config storage s3 edit --path-style-access true
Make sure your Halyard docker container is running, from step 3 of SETUP MINIO and you are exec’d into it, step 4i. of the same section.
- In the Halyard container:
- Make sure your kubectl context is set to docker-desktop.
kubectl config use-context docker-desktop
- Configure Kubernetes as your Cloud Provider using these instructions.
- Make sure you enable artifact support.
- Configure Halyard to install Spinnaker on Kubernetes (reference):
hal config deploy edit --type distributed --account-name my-k8s-account
- Make sure your kubectl context is set to docker-desktop.
Make sure your Halyard docker container is running, from step 3 of SETUP MINIO and you are exec’d into it, step 4i. of the same section.
- In the Halyard container:
hal config version edit --version VERSION
- But changeVERSION
to the version number you need.hal deploy apply
- This is the command that actually deploys Spinnaker to K8s.
- It will take a little while for Spinnaker to start up in your Kubernetes cluster. You can monitor its progress by running
kubectl get all -n spinnaker
on your computer's terminal. - Once all the pods are up and running, continue to the next section.
Note that for this section Deck is being used as an example but you should be able to do basically the same thing for any of Spinnaker's microservices. This section assumes you have cloned the Spinnaker/Deck repository on your computer.
- Port-forward the Spinnaker Gate service so it can be accessed from your computer.
(Deck, Spinnaker’s GUI, needs to be able to reach Gate, Spinnaker’s API.)
kubectl -n spinnaker port-forward service/spin-gate 8084:8084
- Start the Spinnaker Deck service in development mode on your computer.
- Navigate to wherever you cloned the Spinnaker/Deck repository and run
AUTH_ENABLED=false API_HOST=http://localhost:8084 yarn start
- Navigate to wherever you cloned the Spinnaker/Deck repository and run
- On your browser, navigate to http://localhost:9000/, you should now see the Spinnaker UI (Deck) show up!