Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for inline environments #1184

Merged
merged 4 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## main / unreleased

* [FEATURE]: Add support for [inline environments](https://tanka.dev/inline-environments). [#1184](https://github.com/grafana/tempo/pull/1184) @irizzant
* [CHANGE] Search: Add new per-tenant limit `max_bytes_per_tag_values_query` to limit the size of tag-values response. [#1068](https://github.com/grafana/tempo/pull/1068) (@annanay25)
* [CHANGE] Reduce MaxSearchBytesPerTrace `ingester.max-search-bytes-per-trace` default to 5KB [#1129](https://github.com/grafana/tempo/pull/1129) @annanay25
* [CHANGE] **BREAKING CHANGE** The OTEL GRPC receiver's default port changed from 55680 to 4317. [#1142](https://github.com/grafana/tempo/pull/1142) (@tete17)
Expand Down
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
34 changes: 33 additions & 1 deletion example/tk/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If you wish to use a local image, you can import these into k3d
k3d image import grafana/tempo:latest --cluster tempo
```

Next either deploy the microservices or the single binary.
Next either deploy the microservices or the single binary. You can also use tanka [inline environments](https://tanka.dev/inline-environments) to deploy Tempo with either of the two.

### Microservices
The microservices deploy of Tempo is fault tolerant, high volume, independently scalable. This jsonnet is in use by
Expand All @@ -45,6 +45,38 @@ store them in an S3 or GCS bucket. See configuration docs or some of the other
tk apply tempo-single-binary
```

### Inline environments
Tanka [inline environments](https://tanka.dev/inline-environments) allow to programmatically create Tanka environments which are based on either of the two deployments modes described before and which can be then completely customized according to the needs.

The [cluster.libsonnet](./inline/clusters.libsonnet) file can be used to specify the deployment mode to use just by changing this line:
```
local tempo = import '../tempo-microservices/main.jsonnet',
```
The above example is for [Microservices](#microservices).

Then the:
```
dataOverride: {
```
section can be used to override anything inside Tempo's deployment.

The following is an example of how to override Tempo's `_config`:
```json

dataOverride: {
_config+:: {
ingester+: {
pvc_size: '15Gi',
pvc_storage_class: 'my-storage-class',
},
},
},
```

The very same approach can be used to add new resources to deploy along with Tempo, they just have to be added in the `dataOverride` object.

This allow the creation of multiple environments with their related customizations in a single point and also allows to reuse the already existing Single Binary and Microservices environments as a "starting point".

### Search traces

Once all pods are up and running you can search for traces in Grafana.
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.

Loading