I have a spinnaker pipeline that has 3 stages creating configmaps in different clusters. These configmaps look alike except a tag value. I want to be able to create a tag parameter per stage so I can reuse the same configmap.yaml but just substitute the tag.
Is this not doable in spinnaker currently ? Or the alternative is to get the current stage name(unique value per stage) and then use that on the tag using spinnaker expression. That also seems like unsupported ?
First you will register a pipeline parameter in the “configuration” tab of the pipeline editor (only the Name is required):
In this scenario, we’re using a parameter to specify the manifest’s namespace. Edit your manifest so the metadata section contains:
# ... other keys
metadata:
namespace: '${ parameters.namespace }'
# other keys ...
When you go to run the pipeline by hand, you will see the following:
When parameterizing a YAML value that’s not a string (such as the replica count), you will need to explicitly convert the evaluated expression to the correct type.
If you were expecting the replica count to arrive in parameter replicas, you would write:
# ... other keys
spec:
replicas: '${ #toInt( parameters.replicas ) }'
# other keys ...
Reference: https://spinnaker.io/guides/user/kubernetes-v2/parameterize-manifests/