Hi, i’m trying to deploy a .net core service to a Kubernetes cluster through Octopus but i’m having a hard time with variables. I’m using the “Deploy raw Kubernetes yaml” step.
Any idea on how I can easily transfer my Octopus variables to the pod without having to define them all in the “env” part of my deployment.yaml file? (See screenshot)
What I ideally want is to be able to define a variable in Octopus and then my pod knows about it automatically. Kind of like what you would normally do with json file replacement.
Hi @cwh , thanks for getting in touch about your variables!
It looks like our Structured Configuration Variables feature is what you need to use. The following documention page has some more information on it Structured Configuration Variables.
One thing to note; you’ll likely need to upgrade to 2020.4.1 to take adavantage of this. That is being worked on right now and should be availiable in the next week or so.
Please let me know if that works for you or if you have any other questions!
Apologies, I was a little unclear in my initial message.
You can do this in versions before 2020.4.1, it’s just that you use JSON Configuration variables instead of Structured Configuration Variables. Structured Configuration variables is an enhanced version of what we used to use in Octopus and this can be configured in the step by selecting Configuration Features. You will need to define these as variables in Octopus either as a Library Variable Set or a Project Varaible.
Upon further investigation; we hadn’t noticed that the step type didn’t have the configure features option. I want to apologise for the oversight on that.
Unfortunately; I don’t think what you’re asking can be done, but I am going to speak to a Kubernetes expert and get back to you with a definitive answer on this early next week.