Running custom scripts using Spinnaker

Execute scripts with Spinnaker

Although Spinnaker has a built-in Script Stage, it requires Jenkins to do the job in the background. It may not be a convenient option especially when a user does not have a Jenkins instance at all.

In this short blog, let’s look at how we can leverage a Kubernetes Job to run our custom scripts.


Use-case 1:

Create a Spinnaker pipeline that fetches the script from a git repository, creates a configmap using the fetched script and run that script using a K8s job stage in Spinnaker.

Use-case 2:

Create a Spinnaker pipeline that has a script in a configmap and then uses this config map in a K8s job stage to execute the script

Use-case 3:

Create a spinnaker pipeline that has a little complicated run job stage that requires a set of secrets and configmaps to be mounted to run the script

Note: Script expects git credentials to be mounted via a secret. So, a secret with the name gitsecret should be created before running the pipeline in the namespace where the run job runs



DevOps Engineer |

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