Skip to content

Commit 0d14159

Browse files
irizzantIvan Rizzante
authored andcommitted
feat!: add inline env support
Signed-off-by: irizzant <i.rizzante@gmail.com>
1 parent 161073a commit 0d14159

537 files changed

Lines changed: 12712 additions & 11594 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
// import the microservices example
4+
local tempo = import '../tempo-microservices/main.jsonnet',
5+
6+
name: 'cluster name',
7+
apiServer: 'https://0.0.0.0:6443',
8+
namespace: 'namespace',
9+
10+
data: tempo,
11+
12+
dataOverride: {
13+
_images+:: {
14+
// images can be overridden here if desired
15+
},
16+
17+
_config+:: {
18+
19+
// config can be overridden here if desired
20+
21+
},
22+
23+
},
24+
25+
},
26+
]

example/tk/inline/main.jsonnet

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
local clusters = import 'clusters.libsonnet';
2+
local tanka = import 'github.com/grafana/jsonnet-libs/tanka-util/main.libsonnet';
3+
4+
{
5+
environment(cluster)::
6+
tanka.environment.new(
7+
name='grafana/' + cluster.name,
8+
namespace=cluster.namespace,
9+
apiserver=cluster.apiServer,
10+
)
11+
+ tanka.environment.withLabels({ cluster: cluster.name })
12+
+ tanka.environment.withData( cluster.data {
13+
14+
_config+:: {
15+
namespace: cluster.namespace,
16+
},
17+
18+
} + cluster.dataOverride)
19+
+ {
20+
spec+: {
21+
injectLabels: true,
22+
},
23+
},
24+
25+
envs: {
26+
[cluster.name]: $.environment(cluster)
27+
for cluster in clusters
28+
},
29+
}

example/tk/jsonnetfile.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
},
1111
"version": "master"
1212
},
13+
{
14+
"source": {
15+
"git": {
16+
"remote": "https://github.com/grafana/jsonnet-libs.git",
17+
"subdir": "grafana-builder"
18+
}
19+
},
20+
"version": "master"
21+
},
1322
{
1423
"source": {
1524
"git": {
@@ -49,20 +58,20 @@
4958
{
5059
"source": {
5160
"git": {
52-
"remote": "https://github.com/jsonnet-libs/k8s-libsonnet.git",
53-
"subdir": "1.21"
61+
"remote": "https://github.com/grafana/jsonnet-libs.git",
62+
"subdir": "tanka-util"
5463
}
5564
},
56-
"version": "main"
65+
"version": "master"
5766
},
5867
{
5968
"source": {
6069
"git": {
61-
"remote": "https://github.com/grafana/jsonnet-libs.git",
62-
"subdir": "grafana-builder"
70+
"remote": "https://github.com/jsonnet-libs/k8s-libsonnet.git",
71+
"subdir": "1.21"
6372
}
6473
},
65-
"version": "master"
74+
"version": "main"
6675
}
6776
],
6877
"legacyImports": true

example/tk/jsonnetfile.lock.json

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"subdir": "grafana"
99
}
1010
},
11-
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
12-
"sum": "BHvjNVA6foCySv2Rz6EY+miuwdGnsQxkqaOsZJYAi30="
11+
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
12+
"sum": "7rANfqY8ERvoABHbwoGsdGpUeHxxYCSVOcM4Eky4QtQ="
1313
},
1414
{
1515
"source": {
@@ -18,8 +18,8 @@
1818
"subdir": "grafana-builder"
1919
}
2020
},
21-
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
22-
"sum": "y8uA/daOROErelzoo2p1rtqABhUPArg2alsfcb0PQBk="
21+
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
22+
"sum": "0KkygBQd/AFzUvVzezE4qF/uDYgrwUXVpZfINBti0oc="
2323
},
2424
{
2525
"source": {
@@ -28,8 +28,8 @@
2828
"subdir": "ksonnet-util"
2929
}
3030
},
31-
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
32-
"sum": "fFVlCoa/N0qiqTbDhZAEdRm2Vv76Z9Clxp3/haJ+PyA="
31+
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
32+
"sum": "JDsc/bUs5Yv1RkGKcm0hMteqCKZqemxA3qP6eiEATr8="
3333
},
3434
{
3535
"source": {
@@ -38,7 +38,7 @@
3838
"subdir": "kube-state-metrics/"
3939
}
4040
},
41-
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
41+
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
4242
"sum": "kH7gD2rdqRtBujmCObN0ifNF/BkSZU8pleFRI8itkqY="
4343
},
4444
{
@@ -48,7 +48,7 @@
4848
"subdir": "memcached"
4949
}
5050
},
51-
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
51+
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
5252
"sum": "dTOeEux3t9bYSqP2L/uCuLo/wUDpCKH4w+4OD9fePUk="
5353
},
5454
{
@@ -58,8 +58,28 @@
5858
"subdir": "prometheus"
5959
}
6060
},
61-
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
62-
"sum": "jecVpzopHoNjOW5CjsUnMfYNQNtKGlvzONYtQQbkDqg="
61+
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
62+
"sum": "1/gaGD2Wu6ZML+sXTEKo5zZC/VyBgS30yznbprRyy84="
63+
},
64+
{
65+
"source": {
66+
"git": {
67+
"remote": "https://github.com/grafana/jsonnet-libs.git",
68+
"subdir": "tanka-util"
69+
}
70+
},
71+
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
72+
"sum": "AGgjH6IJe/1qwNtxFIiG8V1uyOJZascEydQsNrfPQ4c="
73+
},
74+
{
75+
"source": {
76+
"git": {
77+
"remote": "https://github.com/jsonnet-libs/docsonnet.git",
78+
"subdir": "doc-util"
79+
}
80+
},
81+
"version": "fc3f9bca2dff836b0e924a993bdf11bc51af78d4",
82+
"sum": "JUBWG9ybm0TlY3uCWrNoQS00BcfPlCvuK9jPFU0NIj8="
6383
},
6484
{
6585
"source": {
@@ -68,8 +88,8 @@
6888
"subdir": "1.21"
6989
}
7090
},
71-
"version": "efb8cd3f9e2a3562c24e10404d5ed8b6c2d67174",
72-
"sum": "EZpcgrWS8k6QCOMYW7t4wnLpCRlaikXLMDKJNV9ZD5Q="
91+
"version": "f8efa81cf15257bd151b97e31599e20b2ba5311b",
92+
"sum": "FYub7WxElJkqjjXA++DemsKHwsPqUFW945BTgpVop6Q="
7393
}
7494
],
7595
"legacyImports": false

example/tk/vendor/doc-util

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github.com/jsonnet-libs/docsonnet/doc-util

example/tk/vendor/github.com/grafana/jsonnet-libs/grafana-builder/grafana.libsonnet

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/tk/vendor/github.com/grafana/jsonnet-libs/grafana/config.libsonnet

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/tk/vendor/github.com/grafana/jsonnet-libs/ksonnet-util/util.libsonnet

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/tk/vendor/github.com/grafana/jsonnet-libs/prometheus/config.libsonnet

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/tk/vendor/github.com/grafana/jsonnet-libs/prometheus/ha-mixin.libsonnet

Lines changed: 16 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)