-
Notifications
You must be signed in to change notification settings - Fork 544
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: add inline environments support
Signed-off-by: irizzant <[email protected]>
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[ | ||
{ | ||
// import the microservices example | ||
local tempo = import '../tempo-microservices/main.jsonnet', | ||
|
||
name: 'cluster name', | ||
apiServer: 'https://0.0.0.0:6443', | ||
namespace: 'namespace', | ||
|
||
data: tempo, | ||
|
||
dataOverride: { | ||
_images+:: { | ||
// images can be overridden here if desired | ||
}, | ||
|
||
_config+:: { | ||
|
||
// config can be overridden here if desired | ||
|
||
}, | ||
|
||
}, | ||
|
||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
local clusters = import 'clusters.libsonnet'; | ||
local tanka = import 'github.com/grafana/jsonnet-libs/tanka-util/main.libsonnet'; | ||
|
||
{ | ||
environment(cluster):: | ||
tanka.environment.new( | ||
name='grafana/' + cluster.name, | ||
namespace=cluster.namespace, | ||
apiserver=cluster.apiServer, | ||
) | ||
+ tanka.environment.withLabels({ cluster: cluster.name }) | ||
+ tanka.environment.withData( cluster.data { | ||
|
||
_config+:: { | ||
namespace: cluster.namespace, | ||
}, | ||
|
||
} + cluster.dataOverride) | ||
+ { | ||
spec+: { | ||
injectLabels: true, | ||
}, | ||
}, | ||
|
||
envs: { | ||
[cluster.name]: $.environment(cluster) | ||
for cluster in clusters | ||
}, | ||
} |