Cannot use project variable for Kubernetes namespace

I have a “deploy kubernetes containers” step which can run in development or production. Since my environments have capital letters, I cannot inject this to use in the namespace field so I added a variable with scopes so that e.g. in Production, the value is production

However, in the namespace box, this new variable is not available to be selected even though it is available in the Service Name box.

I can’t imagine that the individual variable dropdowns will filter different things in different places so is there a reason that we are not allowed to use project variables for “namespace”? If not, there is no easy way to use namespace, since it is unlikely to ever be a fixed value.

Hey Luke,

Thanks for reaching out.

That does seem odd that your variable is in one place but not the other. For what it’s worth, you should be able to manually put that variable in the field and it will work, even if it’s not in the selector.

To get to the bottom of the insert issue, which version of Octopus Server are you on? Can you send me a screenshot of the format of the variable on your variables page so I can try to reproduce it on my end?

In your Variables->All section, how many variables do you have there?

As a long shot, on your process page, can you do a full refresh (Ctrl+F5) to make sure this isnt a caching issue?

Please let me know how it goes.

Best,
Jeremy

We are on v2019.11.0

Ctrl-F5 didn’t work

There is only one project variable and no variable sets

The variable setup looks like this: https://pasteboard.co/K4Ujylt.png

Thanks

Hey Luke,

Thanks for the information.

It looks like this might be a versioning thing. I tried it in 2019.12 and I’m seeing the same behavior you are. On my side, in latest, the variable does show up in the insertion menu. If you aren’t in a position to upgrade, you should be able to manually put the variable in and it should work.

Please let me know how it goes.

Best,
Jeremy

It does work when I type it in so that’s fine for now. We will upgrade at some point but it is a bit more involved than point-and-click upgrades like we get on Team City.

Hey Luke,

Thanks for letting me know it works manually.

Yup, I definitely understand that, it can be a process. In case you haven’t seen it, here is some documentation on upgrading: Upgrading a modern version of Octopus - Octopus Deploy

Please let me know if you have any other questions or concerns.

Best,
Jeremy

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