Skip to content

Commit

Permalink
Add make kube-manifests-check (grafana#991)
Browse files Browse the repository at this point in the history
* Add make kube-manifests-check

* Only diff .yaml files: jsonnetfile.lock.json will change all the time

* Install Tanka in CI

* Regen kube-manifests
  • Loading branch information
Koenraad Verheyden authored Sep 29, 2021
1 parent 07ff464 commit f20104e
Show file tree
Hide file tree
Showing 19 changed files with 69 additions and 85 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
run: make tempo-query

tempo-mixin:
name: Check tempo-mixin
name: Check kube-manifests & tempo-mixin
runs-on: ubuntu-latest
steps:

Expand All @@ -54,13 +54,16 @@ jobs:
with:
go-version: 1.16

- name: Install jsonnet & jsonnet-bundler
- name: Install jsonnet, jsonnet-bundler & tanka
run: |
brew install jsonnet
brew install jsonnet tanka
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected]
- name: Check out code
uses: actions/checkout@v2

- name: Check kube-manifests
run: make kube-manifests-check

- name: Check tempo-mixin
run: make tempo-mixin-check
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ docs-test:
docker pull ${DOCS_IMAGE}
docker run -v ${PWD}/docs/tempo/website:/hugo/content/docs/tempo/latest:z -p 3002:3002 --rm $(DOCS_IMAGE) /bin/bash -c 'mkdir -p content/docs/grafana/latest/ && touch content/docs/grafana/latest/menu.yaml && make prod'

### kube-manifests
.PHONY: kube-manifests kube-manifests-check
kube-manifests:
$(MAKE) -C operations/kube-manifests/util gen

kube-manifests-check:
$(MAKE) -C operations/kube-manifests/util check

### tempo-mixin
.PHONY: tempo-mixin tempo-mixin-check
tempo-mixin:
Expand Down
6 changes: 2 additions & 4 deletions operations/kube-manifests/ConfigMap-tempo-compactor.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
apiVersion: v1
data:
overrides.yaml: |
overrides: {}
tempo.yaml: |
compactor:
compaction:
Expand All @@ -21,13 +19,13 @@ data:
join_members:
- gossip-ring.tracing.svc.cluster.local:7946
overrides:
per_tenant_override_config: /conf/overrides.yaml
per_tenant_override_config: /overrides/overrides.yaml
server:
http_listen_port: 3200
storage:
trace:
backend: gcs
blocklist_poll: 10m
blocklist_poll: 5m
cache: memcached
gcs:
bucket_name: tempo
Expand Down
4 changes: 1 addition & 3 deletions operations/kube-manifests/ConfigMap-tempo-distributor.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
apiVersion: v1
data:
overrides.yaml: |
overrides: {}
tempo.yaml: |
compactor: {}
distributor:
Expand All @@ -24,7 +22,7 @@ data:
join_members:
- gossip-ring.tracing.svc.cluster.local:7946
overrides:
per_tenant_override_config: /conf/overrides.yaml
per_tenant_override_config: /overrides/overrides.yaml
server:
http_listen_port: 3200
storage:
Expand Down
4 changes: 1 addition & 3 deletions operations/kube-manifests/ConfigMap-tempo-ingester.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
apiVersion: v1
data:
overrides.yaml: |
overrides: {}
tempo.yaml: |
compactor: {}
distributor: {}
Expand All @@ -15,7 +13,7 @@ data:
join_members:
- gossip-ring.tracing.svc.cluster.local:7946
overrides:
per_tenant_override_config: /conf/overrides.yaml
per_tenant_override_config: /overrides/overrides.yaml
server:
http_listen_port: 3200
storage:
Expand Down
8 changes: 8 additions & 0 deletions operations/kube-manifests/ConfigMap-tempo-overrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
data:
overrides.yaml: |
overrides: {}
kind: ConfigMap
metadata:
name: tempo-overrides
namespace: tracing
2 changes: 1 addition & 1 deletion operations/kube-manifests/ConfigMap-tempo-querier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data:
join_members:
- gossip-ring.tracing.svc.cluster.local:7946
overrides:
per_tenant_override_config: /conf/overrides.yaml
per_tenant_override_config: /overrides/overrides.yaml
querier:
frontend_worker:
frontend_address: query-frontend-discovery.tracing.svc.cluster.local:9095
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data:
join_members:
- gossip-ring.tracing.svc.cluster.local:7946
overrides:
per_tenant_override_config: /conf/overrides.yaml
per_tenant_override_config: /overrides/overrides.yaml
server:
http_listen_port: 3200
storage:
Expand Down
52 changes: 0 additions & 52 deletions operations/kube-manifests/ConfigMap-tempo.yaml

This file was deleted.

11 changes: 8 additions & 3 deletions operations/kube-manifests/Deployment-compactor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ spec:
name: compactor
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
maxSurge: 50%
maxUnavailable: 100%
template:
metadata:
annotations:
config_hash: 527bb84fb5ed28ab14bed73b2434e3dc
config_hash: 9e1f883a7a6ce95d5952bb119bdde93d
labels:
app: compactor
name: compactor
Expand Down Expand Up @@ -50,7 +50,12 @@ spec:
volumeMounts:
- mountPath: /conf
name: tempo-conf
- mountPath: /overrides
name: overrides
volumes:
- configMap:
name: tempo-compactor
name: tempo-conf
- configMap:
name: tempo-overrides
name: overrides
7 changes: 6 additions & 1 deletion operations/kube-manifests/Deployment-distributor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
template:
metadata:
annotations:
config_hash: 74a9c5a46c39c13146cc518435f003d0
config_hash: 3c0ba38c611e090f34119e99081a6c83
labels:
app: distributor
name: distributor
Expand Down Expand Up @@ -52,8 +52,13 @@ spec:
volumeMounts:
- mountPath: /conf
name: tempo-conf
- mountPath: /overrides
name: overrides
terminationGracePeriodSeconds: 60
volumes:
- configMap:
name: tempo-distributor
name: tempo-conf
- configMap:
name: tempo-overrides
name: overrides
2 changes: 1 addition & 1 deletion operations/kube-manifests/Deployment-querier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
template:
metadata:
annotations:
config_hash: c83370e4a6c7e2eec54f5c49e5f88bea
config_hash: a1b5f8315434d8ce62f63fb8d5e132f0
labels:
app: querier
name: querier
Expand Down
5 changes: 1 addition & 4 deletions operations/kube-manifests/Deployment-query-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
template:
metadata:
annotations:
config_hash: 0bf23ab3d6ba5b97313fcc0c4b845a33
config_hash: 48de574bb668780f2434f8e3d827b9ef
labels:
app: query-frontend
name: query-frontend
Expand Down Expand Up @@ -54,9 +54,6 @@ spec:
- --query.base-path=/tempo
- --grpc-storage-plugin.configuration-file=/conf/tempo-query.yaml
- --query.bearer-token-propagation=true
env:
- name: JAEGER_DISABLED
value: "true"
image: grafana/tempo-query:latest
imagePullPolicy: IfNotPresent
name: tempo-query
Expand Down
7 changes: 6 additions & 1 deletion operations/kube-manifests/StatefulSet-ingester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
template:
metadata:
annotations:
config_hash: 0bf23ab3d6ba5b97313fcc0c4b845a33
config_hash: 48de574bb668780f2434f8e3d827b9ef
labels:
app: ingester
name: ingester
Expand Down Expand Up @@ -57,10 +57,15 @@ spec:
name: tempo-conf
- mountPath: /var/tempo
name: ingester-data
- mountPath: /overrides
name: overrides
volumes:
- configMap:
name: tempo-ingester
name: tempo-conf
- configMap:
name: tempo-overrides
name: overrides
updateStrategy:
type: RollingUpdate
volumeClaimTemplates:
Expand Down
11 changes: 11 additions & 0 deletions operations/kube-manifests/util/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: gen check

gen:
jb update
tk export out/ example --format "{{.kind}}-{{or .metadata.name .metadata.generateName}}"

cp out/*.yaml ../
rm -r out/

check: gen
git diff --exit-code -- ../*.yaml
12 changes: 6 additions & 6 deletions operations/kube-manifests/util/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
To generate the manifests from this directory, run the following
# kube-manifests

```
jb update
Example Kubernetes manifests to deploy Tempo distributed.

tk export out_dir generator --format "{{.kind}}-{{or .metadata.name .metadata.generateName}}"
```
### Build

The manifests will be generated in the out_dir.
To generate the manifests from this directory, run `make gen`.

This requires [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler) and [Tanka](https://tanka.dev/) to be installed.
4 changes: 2 additions & 2 deletions operations/kube-manifests/util/jsonnetfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"subdir": "ksonnet-util"
}
},
"version": "a20c679492aae363414dce23bc63da09cf8a7287",
"version": "bc9b685050691a78ee414cd8f789857de0eabe8d",
"sum": "OxgtIWL4hjvG0xkMwUzZ7Yjs52zUhLhaVQpwHCbqf8A="
},
{
Expand All @@ -18,7 +18,7 @@
"subdir": "memcached"
}
},
"version": "a20c679492aae363414dce23bc63da09cf8a7287",
"version": "bc9b685050691a78ee414cd8f789857de0eabe8d",
"sum": "dTOeEux3t9bYSqP2L/uCuLo/wUDpCKH4w+4OD9fePUk="
},
{
Expand Down

0 comments on commit f20104e

Please sign in to comment.