Deploying Spinnaker on Kubernetes
Contents
Spinnaker is a continuous delivery platform, originally developed by Netflix, for releasing software changes quickly and reliably. Spinnaker makes it easier for developers to focus on writing code without worrying about the underlying cloud infrastructure, and it integrates seamlessly with Jenkins It integrates seamlessly with Jenkins and other popular build tools. I’ve been wanting to try Spinnaker for a long time, but I’ve tried many times without success due to GFW, and this time I finally successfully deployed Spinnaker on a Kubernetes cluster after solving the proxy issue.
In this article, we will use helm3 to demonstrate the installation of Spinnaker on a Kubernetes cluster, and the corresponding environment version is shown below.
|
|
The installation and configuration of Helm3 is really simple, just install the Helm3 client on top of the node where kubectl is located, and by default it will read the kubeconfig file to access the cluster. We use the helm chart repository provided by Microsoft here.
|
|
Since we are using Kubernetes version 1.16.x, which deprecated some old APIs for many resource objects, such as Deployment, we can only use the apps/v1
version, and the Spinnaker chart package we are using here is still using the previous API version. So we need to download it manually and make a change: apps/v1
.
|
|
Then change the apiVersion of Deployment, StatefulSet and other resource objects in the spinnaker chart template to apps/v1
, also remember that if it is Deployment you need to add the selector.matchLabels
field, you can use it directly I changed the chart template https://github.com/cnych/spinnaker-helm.
In the values.yaml
file of the chart template, I specified halyard.spinnakerVersion=1.17.6
, which is still a problem because of the apiVersion version, which is compatible with Kubernetes v1.16.x clusters, and replaced the default gcr.io
image with a Microsoft image. In addition, the default gcr.io
image is replaced with the Microsoft image source gcr.azk8s.cn
, and there is also a very important thing is the storage designation, here we create a StorageClass
resource object to provide storage, I am creating a Ceph RBD
type of storage rook-ceph-block
, of course any available StorageClass
resource object is fine: the
|
|
It is necessary to specify the corresponding storage for halyard, redis, and mino, but of course it is possible to specify a suitable PVC directly, which can be decided here according to the actual situation.
|
|
The next most important step is to configure a proxy for halyard, so the prerequisite to continue is that you need to configure a proxy that can be accessed in the Kubernetes Pod, for example, if my proxy address is 10.151.30.11:8118
, you need to configure the JAVA_OPTS
environment variable as follows : `JAVA_OPTS
|
|
Get the above modified Chart template of Spinnaker and replace the above configuration in the values.yaml
file with your own configuration.
|
|
Since the installation process is very time consuming, there may be a timeout for the helm install
process above, which can be ignored.
|
|
The installation will initially generate several Pods as shown below, with spinnaker-install-using-hal-th8qf
being one of the Job tasks used to actually install Spinnaker: spinnaker-install-using-hal-th8qf
.
|
|
However, since the gcr.io
image will be used during the installation of Spinnaker, you will see a lot of Pod image pulling failure errors, at this time we can manually edit the Deployment object to change the image address.
|
|
For example, change the mirror address of the Deployment resource object spin-deck
to
|
|
Replace the other resource objects in the same way, and after a normal replacement, the Pod will start normally after some time. The final list of Pods is shown below.
|
|
If we want to expose Spinnaker to external users, we can of course create a NodePort service or an Ingress resource object, which we can specify in the chart template above. In fact, in the chart template above, we can specify the parameters of the Ingress resource object through configuration. Since I am using Traefik version 2.1 here, I create a separate IngressRoute resource object to expose the service.
|
|
Just create the resource object above, and then do a DNS resolution of the domain spinnaker.qikqiak.com
to access Spinnaker in your browser.
Here the installation is successful, of course, this is only the first step of the long journey it, and then we will slowly go to understand Spinnaker in the end what features worth our attention.