Skip to content

Commit

Permalink
feat!: add inline env support
Browse files Browse the repository at this point in the history
Signed-off-by: irizzant <[email protected]>
  • Loading branch information
irizzant authored and Ivan Rizzante committed Dec 21, 2021
1 parent 161073a commit 0d14159
Show file tree
Hide file tree
Showing 537 changed files with 12,712 additions and 11,594 deletions.
26 changes: 26 additions & 0 deletions example/tk/inline/clusters.libsonnet
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

},

},

},
]
29 changes: 29 additions & 0 deletions example/tk/inline/main.jsonnet
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
},
}
21 changes: 15 additions & 6 deletions example/tk/jsonnetfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
},
"version": "master"
},
{
"source": {
"git": {
"remote": "https://github.com/grafana/jsonnet-libs.git",
"subdir": "grafana-builder"
}
},
"version": "master"
},
{
"source": {
"git": {
Expand Down Expand Up @@ -49,20 +58,20 @@
{
"source": {
"git": {
"remote": "https://github.com/jsonnet-libs/k8s-libsonnet.git",
"subdir": "1.21"
"remote": "https://github.com/grafana/jsonnet-libs.git",
"subdir": "tanka-util"
}
},
"version": "main"
"version": "master"
},
{
"source": {
"git": {
"remote": "https://github.com/grafana/jsonnet-libs.git",
"subdir": "grafana-builder"
"remote": "https://github.com/jsonnet-libs/k8s-libsonnet.git",
"subdir": "1.21"
}
},
"version": "master"
"version": "main"
}
],
"legacyImports": true
Expand Down
44 changes: 32 additions & 12 deletions example/tk/jsonnetfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"subdir": "grafana"
}
},
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
"sum": "BHvjNVA6foCySv2Rz6EY+miuwdGnsQxkqaOsZJYAi30="
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
"sum": "7rANfqY8ERvoABHbwoGsdGpUeHxxYCSVOcM4Eky4QtQ="
},
{
"source": {
Expand All @@ -18,8 +18,8 @@
"subdir": "grafana-builder"
}
},
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
"sum": "y8uA/daOROErelzoo2p1rtqABhUPArg2alsfcb0PQBk="
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
"sum": "0KkygBQd/AFzUvVzezE4qF/uDYgrwUXVpZfINBti0oc="
},
{
"source": {
Expand All @@ -28,8 +28,8 @@
"subdir": "ksonnet-util"
}
},
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
"sum": "fFVlCoa/N0qiqTbDhZAEdRm2Vv76Z9Clxp3/haJ+PyA="
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
"sum": "JDsc/bUs5Yv1RkGKcm0hMteqCKZqemxA3qP6eiEATr8="
},
{
"source": {
Expand All @@ -38,7 +38,7 @@
"subdir": "kube-state-metrics/"
}
},
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
"sum": "kH7gD2rdqRtBujmCObN0ifNF/BkSZU8pleFRI8itkqY="
},
{
Expand All @@ -48,7 +48,7 @@
"subdir": "memcached"
}
},
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
"sum": "dTOeEux3t9bYSqP2L/uCuLo/wUDpCKH4w+4OD9fePUk="
},
{
Expand All @@ -58,8 +58,28 @@
"subdir": "prometheus"
}
},
"version": "c4975f7c4a7ab4c21020c4afbf247aa49142174d",
"sum": "jecVpzopHoNjOW5CjsUnMfYNQNtKGlvzONYtQQbkDqg="
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
"sum": "1/gaGD2Wu6ZML+sXTEKo5zZC/VyBgS30yznbprRyy84="
},
{
"source": {
"git": {
"remote": "https://github.com/grafana/jsonnet-libs.git",
"subdir": "tanka-util"
}
},
"version": "264a5c2078c5930af57fe2d107eff83ab63553af",
"sum": "AGgjH6IJe/1qwNtxFIiG8V1uyOJZascEydQsNrfPQ4c="
},
{
"source": {
"git": {
"remote": "https://github.com/jsonnet-libs/docsonnet.git",
"subdir": "doc-util"
}
},
"version": "fc3f9bca2dff836b0e924a993bdf11bc51af78d4",
"sum": "JUBWG9ybm0TlY3uCWrNoQS00BcfPlCvuK9jPFU0NIj8="
},
{
"source": {
Expand All @@ -68,8 +88,8 @@
"subdir": "1.21"
}
},
"version": "efb8cd3f9e2a3562c24e10404d5ed8b6c2d67174",
"sum": "EZpcgrWS8k6QCOMYW7t4wnLpCRlaikXLMDKJNV9ZD5Q="
"version": "f8efa81cf15257bd151b97e31599e20b2ba5311b",
"sum": "FYub7WxElJkqjjXA++DemsKHwsPqUFW945BTgpVop6Q="
}
],
"legacyImports": false
Expand Down
1 change: 1 addition & 0 deletions example/tk/vendor/doc-util

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0d14159

Please sign in to comment.