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.

Pre-requisites:

  1. A container image is required with necessary tools installed on it so that K8s job can spin up a pod to run the custom script successfully.
  2. Add git artifact account in case we want to fetch the script from git repository

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 | https://www.linkedin.com/in/abhinaybyrisetty/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Free Azure FTPS Server with 1GB of Space

Pseudo and random Password creator with Powershell

What happens when you type gcc main.c

A Story about Software Resilience

VMware ESXi virtual machine image deployment to Digital Ocean (and setup networking after)

[The API Book] API KPIs

UENC Project Weekly Report: #70 (May 03, 2021 — May 09, 2021)

Creating My First CLI Project

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
Abhinay Byrisetty

Abhinay Byrisetty

DevOps Engineer | https://www.linkedin.com/in/abhinaybyrisetty/

More from Medium

What is Tekton?

Configuring Hadoop Cluster Using Ansible Playbook(11.1)

How To Install ELK Stack On Ubuntu 20.04 With Let’s Encrypt SSL

GitOps with NSX Advanced Load Balancer and Jenkins