Replies: 1 comment 2 replies
-
You can create a temporary jsonnet mixin that overrides bits from Let's say you have locations in common: // lib/common.libsonnet
{
locations: [
'us-central1'
],
} And your application in dev and prod use this: // environment/{dev,prod}/main.jsonnet
local common = import 'common.libsonnet';
{
app: {
locations: common.locations,
}
} Now you want to add another location in in dev, what we can do is add a new // environments/dev/overrides.libsonnet
local common = import 'common.libsonnet';
common {
locations+: [
'us-east1'
],
} And update dev accordingly: // environment/dev/main.jsonnet
local common = import './overrides.libsonnet';
{
app: {
locations: common.locations,
}
} Now there is a structure in place to set overrides for dev, once your happy with it, you This can grow quite complex, at Grafana Labs we work with "waves", with 'overries' for |
Beta Was this translation helpful? Give feedback.
-
Hi all,
We've been using tanka/jsonnet for several months now. One issue we've been running into is how to safely change common library code shared between environments without inadvertently breaking other environments. For example, if I have a
lib/common.libsonnet
file that is imported into all of the environments, and I want to test a single (long-term) change without breaking prod, the only workaround I've found is by making a temporary branch which greatly disturbs our gitops setup.We use Terraform/TerraGrunt for configuring our infrastructure. One of the nice things about how this is set up is that we can store our Terraform modules in a separate repository. This way, I can change the modules repository, bump the version, and then back in our gitops repo, I can bump the version on a single environment at a time.
I'm wondering if there's a way to emulate this behavior with tanka? I want to be able to version our supporting code and be able to choose which version a specific environment is using selectively. This would give us the same benefit as Terragrunt.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions