Yaml variable replacement

I am deploying a raw yaml from inside a package to Kubernetes and I am not having any luck with variable replacement. Does variable replacement work on a yaml file from inside a package?

Hi @chris_cochran,

Thanks for getting in touch and I’m sorry to hear you’re experiencing issues.

Would you be able to send over a full raw task log from a deployment where you experienced this issue, please?

May I ask what Octopus version you’re running?

Is this something that has been working previously and has just recently broken or is this something new that you’ve tried that doesn’t work as anticipated?

Hopefully we can get to the bottom of this issue fairly quickly and get your deployments going again!

Kind Regards,
Adam

Hello Adam,

Our Octopus version is 2021.3.8275.

The raw task log is attached.

The deployment is working, we are trying to us YAML Variable replacement to replace the replicas value from 2 to 3. This is the first attempt at using this feature.

Below is a screenshot of our variables. We are attempting to replace spec:replicas in the yaml file.

Any help will be greatly appreciated. Thanks.

image001.png

image002.png

ServerTasks-365861.log.txt (34.1 KB)

Hi Chris,

Just stepping in for Adam from the Australia based team.

Unfortunately it doesn’t look like the Structured Configuration Variables feature is supported just yet for the Deploy RAW Kubernetes YAML step. I’ve reached out to the devs for a timeline to get this supported, as we are definitely planning to improve this features support!

In the meantime it looks like you will need to use either Variable Substitution using #{} or the Run Kubectl CLI step which does support Structured configuration variables instead.

I’d be happy to answer any questions you might have, feel free to let me know!

Best Regards,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.