How to have variable number of variables per tenant?

Hello, when considering switching from project-per-client to tenant-per-client approach, how can we solve the following issue? We have a lot of clients. Currently we are using a set of projects per client. Now we have hundreds of deployment projects and counting. Managing them is grueling. And we want to switch to Octopus multi-tenancy feature.

Currently we have an ability to specify an infinite number of deployment variables in deployment project, which allow to override any configuration parameter for the application. Mostly they are not used, but when there is a strong need, this is a real saver. This feature is mandatory for us.

If switching to tenants, we could have created project-per-product + N tenants. But how do we have dynamic list of variables in this case? Adding them to deployment project is not possible, because we will be lost in these variables. Just imagine, each tenant having 0-10 variables (sometimes more, sometimes none) for multiple tenants, all in one deployment project. It’s more than hundred variables, all belonging to different tenants. And, as I see, we can’t have dynamic list of variables for project, attached to tenant, only variable templates, which are not dynamic.

So, how would you advice us to solve this issue?

Hi Dmitry,

Thanks for getting in touch. I hope the multi-tenant deployment features in Octopus 3.4 will make management a lot easier for you. However I can only guess that given your selection of project-per-tenant your situation requires a fair amount of flexibility: perhaps custom steps, with custom variables for different tenants? It would be nice to better understand some of the specific variations your tenants enjoy today.

The short answer is we don’t currently provide a way for you to define custom/adhoc variables for tenants - mainly because we wanted to start down the path of templating variables to help tame complexity through restricting variability (to some degree). And on the flip-side, to try and discourage adhoc per-tenant variables until we saw a really clear use-case for them.

Some questions for you:

  1. What percentage of your tenant variables would be adhoc, compared to those that could be templated?
  2. Do these tenants share some variable values that could be scoped to tenant tags instead of tenants themselves?
  3. Can these variables be built by some kind of convention from other variables?

One way to make this work today would be to:

  1. Create your tenant and use project/common variable templates wherever possible to bring structure wherever possible
  2. Create a tag-set called “Adhoc Variables” (or similar) and add a tag for the tenant. This is for scoping variables since we don’t let you scope variables to a specific tenant.
  3. Create a library variable template to house that tenant’s adhoc variables, using a naming convention that makes the ownership clear, and scope the variables in that library to the tag you created in step 2.
  4. Add the adhoc variables to any projects requiring them.

It’s a bit of overhead, and not straightforward, but it should work.

Let me know what you think - I’m very interested to learn more about your situation.

Hope that helps!