diff --git a/README.md b/README.md index 7648cebd0..80c9c3d85 100644 --- a/README.md +++ b/README.md @@ -51,12 +51,6 @@ Daher haben wir eine Roadmap entwickelt, was wir wann erreichen möchten: [Roadm ## Entwicklung & Werkzeuge -[MeisterTask](https://www.meistertask.com/app/project/p7zXoSfq/demokratie) - -[Analysetool Dateistruktur](https://veniversum.me/git-visualizer/?owner=demokratie-live&repo=demokratie-app) - -[Analysetool Commits](http://ghv.artzub.com/#repo=demokratie-app&climit=10000&user=demokratie-live) - [Malwerkzeug zur Planung](https://www.draw.io/) ## Open Source @@ -149,11 +143,35 @@ docker buildx build \ ``` ## Contributing +# Running the Dev Environment + +First clone this repository + +## Tilt (Kuberneetes) + +### Prerequirements + +- local kubernetes cluster + - [Docker Desktop](https://www.docker.com/products/docker-desktop/) - _the easiest way_ + - [colima](https://github.com/abiosoft/colima) - _for Apple Silicon (M1)_ + - or your favourite +- [local docker registry](https://docs.docker.com/registry/deploying/#native-basic-auth) +- [tilt.dev](https://docs.tilt.dev/install.html) + +### Start + +`tilt up` + +### Clean Up + +`tilt down` + +# Contributing Anyone and everyone is welcome to [contribute](https://github.com/demokratie-live/democracy-development/blob/master/CONTRIBUTE.md). Start by checking out the list of [open issues](https://github.com/demokratie-live/democracy-development/issues). -## License +# License Copyright © 2017-present DEMOCRACY Deutschland e.V.. This source code is licensed under the Apache 2.0 license found in the [LICENSE](https://github.com/demokratie-live/democracy-development/blob/master/LICENSE) file. diff --git a/Tiltfile b/Tiltfile new file mode 100644 index 000000000..1c701ce6b --- /dev/null +++ b/Tiltfile @@ -0,0 +1,91 @@ +include('./infra/tilt/monitoring/Tiltfile') +include('./infra/tilt/dapr/Tiltfile') + +k8s_yaml('./infra/kustomize/overlays/local/namespace.yaml') +k8s_yaml(kustomize('./infra/kustomize/overlays/local')) + +k8s_resource(workload='democracy-app-depl', port_forwards='3000:3000', labels=["democracy"], resource_deps=['democracy-api-depl']) +k8s_resource( + workload='democracy-api-depl', + port_forwards='3001:3000', + labels=["democracy"], + resource_deps=['bundestagio-depl'] +) + + +k8s_resource( + workload='bundestagio-depl', + port_forwards='3101:3100', + labels=["bundestag"], + resource_deps=[ + 'dapr-dashboard', + 'dapr-operator', + 'dapr-sentry', + 'dapr-sidecar-injector', + 'dapr-placement-server', + 'democracy-mongo-depl' + ]) +k8s_resource(workload='bundestagio-admin-depl', labels=["bundestag"], resource_deps=['bundestagio-depl']) +k8s_resource(workload='bundestagio-dip-depl', port_forwards='3102:3101', labels=["bundestag"], resource_deps=['bundestagio-depl']) + +k8s_resource(workload='qr-code-handler-depl', labels=["services"], resource_deps=['bundestagio-depl']) + +k8s_resource(workload='cleanup-push-queue', labels=["cronjobs"], resource_deps=['democracy-api-depl']) +k8s_resource(workload='democracy-sync-deputy-profiles-cronjob', labels=["cronjobs"], resource_deps=['democracy-api-depl']) +k8s_resource(workload='democracy-sync-named-polls-cronjob', labels=["cronjobs"], resource_deps=['democracy-api-depl']) +k8s_resource(workload='democracy-sync-procedures-cronjob', labels=["cronjobs"], resource_deps=['democracy-api-depl']) +k8s_resource(workload='import-conference-week-details-cronjob', labels=["cronjobs"], resource_deps=['bundestagio-depl']) +k8s_resource(workload='import-deputy-profiles-cronjob', labels=["cronjobs"], resource_deps=['bundestagio-depl']) +k8s_resource(workload='import-deputy-profiles-period-18-cronjob', labels=["cronjobs"], resource_deps=['bundestagio-depl']) +k8s_resource(workload='import-deputy-profiles-period-19-cronjob', labels=["cronjobs"], resource_deps=['bundestagio-depl']) +k8s_resource(workload='import-named-poll-deputies-cronjob', labels=["cronjobs"], resource_deps=['bundestagio-depl']) +k8s_resource(workload='import-named-polls-cronjob', labels=["cronjobs"], resource_deps=['bundestagio-depl']) +k8s_resource(workload='import-plenary-minutes-cronjob', labels=["cronjobs"], resource_deps=['bundestagio-depl']) +k8s_resource(workload='import-procedures-cronjob', labels=["cronjobs"], resource_deps=['bundestagio-depl']) +k8s_resource(workload='index-sync-bundestagio-cronjob', labels=["cronjobs"], resource_deps=['bundestagio-depl']) +k8s_resource(workload='index-sync-democracy-cronjob', labels=["cronjobs"], resource_deps=['democracy-api-depl']) +k8s_resource(workload='push-send-queued-cronjob', labels=["cronjobs"], resource_deps=['democracy-api-depl']) +k8s_resource(workload='queue-pushs-conference-week-cronjob', labels=["cronjobs"], resource_deps=['democracy-api-depl']) +k8s_resource(workload='queue-pushs-vote-conference-week-cronjob', labels=["cronjobs"], resource_deps=['democracy-api-depl']) +k8s_resource(workload='queue-pushs-vote-top-100-cronjob', labels=["cronjobs"], resource_deps=['democracy-api-depl']) +k8s_resource(workload='shedule-bio-resync-cronjob', labels=["cronjobs"], resource_deps=['democracy-api-depl']) + +k8s_resource(workload='democracy-mongo-depl', labels=["third-paty"]) +k8s_resource(workload='gorush', labels=["third-paty"]) +k8s_resource(workload='nats-depl', labels=["third-paty"]) +k8s_resource(workload='redis', labels=["third-paty"]) + + +### democracy-api ########################################################################################## +# docker_build( +# 'democracy/democracy-server', +# context='./democracy/api', +# dockerfile='./democracy/api/Dockerfile', +# only=['.'], +# target='build_stage', +# entrypoint='yarn dev', +# live_update=[ +# sync('./democracy/api/src/', '/app/src/'), +# run( +# 'yarn install', +# trigger=['./yarn.lock'] +# ) +# ] +# ) + +### import-procedures-cronjob ################################################## +docker_build( + 'democracy/crawler', + context='./services/cron-jobs/crawler', + dockerfile='./services/cron-jobs/crawler/Dockerfile', + only=['.'], + target='build_stage', + entrypoint='yarn dev', + live_update=[ + sync('./services/cron-jobs/crawler/src/', '/app/src/'), + run( + 'yarn install', + trigger=['./yarn.lock'] + ) + ] +) diff --git a/infra/kustomize/overlays/local/namespace.yaml b/infra/kustomize/overlays/local/namespace.yaml new file mode 100644 index 000000000..f6c453fcd --- /dev/null +++ b/infra/kustomize/overlays/local/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: democracy diff --git a/infra/tilt/dapr/Tiltfile b/infra/tilt/dapr/Tiltfile new file mode 100644 index 000000000..a7b1469cb --- /dev/null +++ b/infra/tilt/dapr/Tiltfile @@ -0,0 +1,42 @@ + +### DAPR ####################################################################### +load('ext://helm_remote', 'helm_remote') + +helm_remote('dapr', + repo_url='https://dapr.github.io/helm-charts/', + namespace='dapr-system', + create_namespace=True, + version='1.7.0', + values="./values.yaml" +) + +k8s_resource(workload='dapr-dashboard', port_forwards='3300:8080', labels=["dapr"]) +k8s_resource(workload='dapr-operator', labels=["dapr"]) +k8s_resource(workload='dapr-sentry', labels=["dapr"]) +k8s_resource(workload='dapr-sidecar-injector', labels=["dapr"]) +k8s_resource(workload='dapr-placement-server', labels=["dapr"]) + +k8s_yaml('./dapr-config.yaml', allow_duplicates=True) +# k8s_yaml('./local-secret-store.yaml', allow_duplicates=True) + +### Zipkin ####################################################################### + +# k8s_yaml(helm('./zipkin-helm', +# namespace='dapr-system', +# )) +# # k8s_yaml('./dapr-tracing-zipkin-config.yaml') + +# k8s_resource(workload='chart-zipkin-ui', port_forwards='9411', labels=["dapr"], resource_deps=['chart-zipkin-cassandra']) +# k8s_resource(workload='chart-zipkin-dependencies-gen', labels=["dapr"], resource_deps=['chart-zipkin-cassandra']) +# k8s_resource(workload='chart-zipkin-cassandra', labels=["dapr"]) +# k8s_resource(workload='chart-zipkin-collector', labels=["dapr"], resource_deps=['chart-zipkin-cassandra']) + +### HASHICORP VAULT ####################################################################### +# helm_remote('vault', +# repo_url='https://helm.releases.hashicorp.com', +# namespace='hashicorp-vault', +# create_namespace=True +# ) +# k8s_resource(workload='vault-agent-injector', labels=["vault"]) +# k8s_resource(workload='vault', port_forwards='3301:8200', labels=["vault"]) + diff --git a/infra/tilt/dapr/dapr-config.yaml b/infra/tilt/dapr/dapr-config.yaml new file mode 100644 index 000000000..2157f3446 --- /dev/null +++ b/infra/tilt/dapr/dapr-config.yaml @@ -0,0 +1,12 @@ +apiVersion: dapr.io/v1alpha1 +kind: Configuration +metadata: + name: daprsystem + namespace: dapr-system +spec: + # tracing: + # samplingRate: '1' + # zipkin: + # endpointAddress: 'http://zipkin:9411/api/v2/spans' + mtls: + enabled: false diff --git a/infra/tilt/dapr/dapr-local-storage-binding.yaml b/infra/tilt/dapr/dapr-local-storage-binding.yaml new file mode 100644 index 000000000..ee16f8f8d --- /dev/null +++ b/infra/tilt/dapr/dapr-local-storage-binding.yaml @@ -0,0 +1,11 @@ +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: local-storage + namespace: dapr-system +spec: + type: bindings.localstorage + version: v1 + metadata: + - name: rootPath + value: /tmp/dapr diff --git a/infra/tilt/dapr/dapr-test-secrets.json b/infra/tilt/dapr/dapr-test-secrets.json new file mode 100644 index 000000000..c2d565689 --- /dev/null +++ b/infra/tilt/dapr/dapr-test-secrets.json @@ -0,0 +1,3 @@ +{ + "password": "geheim" +} diff --git a/infra/tilt/dapr/dapr-tracing-zipkin-config.yaml b/infra/tilt/dapr/dapr-tracing-zipkin-config.yaml new file mode 100644 index 000000000..2ae1ee7fe --- /dev/null +++ b/infra/tilt/dapr/dapr-tracing-zipkin-config.yaml @@ -0,0 +1,10 @@ +apiVersion: dapr.io/v1alpha1 +kind: Configuration +metadata: + name: tracing + namespace: dapr-system +spec: + tracing: + samplingRate: '1' + zipkin: + endpointAddress: 'http://zipkin:9411/api/v2/spans' diff --git a/infra/tilt/dapr/local-secret-store.yaml b/infra/tilt/dapr/local-secret-store.yaml new file mode 100644 index 000000000..8cba78d01 --- /dev/null +++ b/infra/tilt/dapr/local-secret-store.yaml @@ -0,0 +1,11 @@ +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: localsecretstore + namespace: default +spec: + type: secretstores.local.file + version: v1 + metadata: + - name: secretsFile + value: /Users/manuelruck/Work/democracy/repos/democracy-development/infra/tilt/dapr/dapr-test-secrets.json diff --git a/infra/tilt/dapr/values.yaml b/infra/tilt/dapr/values.yaml new file mode 100644 index 000000000..b4c0a8c3e --- /dev/null +++ b/infra/tilt/dapr/values.yaml @@ -0,0 +1,20 @@ +dapr_dashboard: + runAsNonRoot: false + logLevel: DEBUG +dapr_placement: + runAsNonRoot: false + logLevel: DEBUG +dapr_operator: + runAsNonRoot: false + logLevel: DEBUG +dapr_sentry: + runAsNonRoot: false + logLevel: DEBUG +dapr_sidecar_injector: + hostNetwork: true + runAsNonRoot: false + logLevel: DEBUG +global: + logAsJson: true + mtls: + enabled: false diff --git a/infra/tilt/dapr/zipkin-helm/.helmignore b/infra/tilt/dapr/zipkin-helm/.helmignore new file mode 100644 index 000000000..a4ec9838b --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/.helmignore @@ -0,0 +1,26 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +example/ +docs/ +LICENSE +README.md +scripts/ \ No newline at end of file diff --git a/infra/tilt/dapr/zipkin-helm/Chart.yaml b/infra/tilt/dapr/zipkin-helm/Chart.yaml new file mode 100644 index 000000000..169bebd5b --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +description: Zipkin distributed tracing +name: zipkin-helm +version: 0.6.2 +icon: https://avatars1.githubusercontent.com/u/11860887 diff --git a/infra/tilt/dapr/zipkin-helm/LICENSE b/infra/tilt/dapr/zipkin-helm/LICENSE new file mode 100644 index 000000000..ed4f74d75 --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Financial Times + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/infra/tilt/dapr/zipkin-helm/README.md b/infra/tilt/dapr/zipkin-helm/README.md new file mode 100644 index 000000000..cdc4b486e --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/README.md @@ -0,0 +1,71 @@ +# zipkin-helm +A helm chart for zipkin + +## usage + +### Adding the repo + +`helm repo add zipkin-helm https://financial-times.github.io/zipkin-helm/docs` + +### Installing + +`helm install -f my-cassandra-config.yaml https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.1.1.tgz` + +## values + +Example + +``` +cassandra: + username: zipkinuser + password: my-super-secret-password + contactPoints: cassandra-1.me.com,cassandra-2.me.com + +ingress: + host: zipkin.example.com + +configmap: + localdc: + name: cassandra # use this notation if you want to reuse values from existing configmaps, this takes precedence over the .cassandra field + key: local.dc +``` + +## Releasing + +### Package the new version + +1. Change the version in the `Chart.yaml` file to the new version +2. `helm package -d docs/ .` +3. `helm repo index docs --url https://financial-times.github.io/zipkin-helm/docs/` +4. Commit the changes +5. Make a new release on github +6. `git commit -m 'rebuild pages' --allow-empty && git push` + +## Gotchas + +#### collectors and ui readiness probe doesn't pass + +##### Problem + +My collector and ui pods are never coming into service as the readiness probes are not passing. + +e.g. +``` +foiled-labradoodle-zipkin-cassandra-0 1/1 Running 0 8m +foiled-labradoodle-zipkin-collector-6dff48b6df-crl4z 0/1 Running 0 3m +foiled-labradoodle-zipkin-collector-6dff48b6df-m4v8t 0/1 Running 0 3m +foiled-labradoodle-zipkin-collector-6dff48b6df-rrwdb 0/1 Running 0 3m +foiled-labradoodle-zipkin-ui-7bdf9c6c96-jh7vq 0/1 Running 0 3m +``` + +##### Explanation + +This can happen for some reason when cassandra comes up before any of the collectors/ui pods. + +##### Solution +Try restarting the pods: + +``` +kubectl delete po -l app=zipkin-collector +kubectl delete po -l app=zipkin-ui +``` diff --git a/infra/tilt/dapr/zipkin-helm/docs/index.yaml b/infra/tilt/dapr/zipkin-helm/docs/index.yaml new file mode 100755 index 000000000..f61504f34 --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/docs/index.yaml @@ -0,0 +1,95 @@ +apiVersion: v1 +entries: + zipkin-helm: + - apiVersion: v1 + created: 2019-03-26T10:38:43.448003+02:00 + description: Zipkin distributed tracing + digest: fbd294e9d4c03c404d8b25a19190c0c2ac6c9f4c88765e6d24087400977f090f + icon: https://avatars1.githubusercontent.com/u/11860887 + name: zipkin-helm + urls: + - https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.6.2.tgz + version: 0.6.2 + - apiVersion: v1 + created: 2019-03-26T10:38:43.446446+02:00 + description: Zipkin distributed tracing + digest: f0091de87cf0aaac53f7be3d57578e08c3d9a369530fd3bd01a5af3757e25622 + icon: https://avatars1.githubusercontent.com/u/11860887 + name: zipkin-helm + urls: + - https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.6.1.tgz + version: 0.6.1 + - apiVersion: v1 + created: 2019-03-26T10:38:43.445555+02:00 + description: Zipkin distributed tracing + digest: ddf2ba63b5e61cb2b83399facfbf4f1d2866836b111bf7e63c7987ee1d7815d0 + icon: https://avatars1.githubusercontent.com/u/11860887 + name: zipkin-helm + urls: + - https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.6.0.tgz + version: 0.6.0 + - apiVersion: v1 + created: 2019-03-26T10:38:43.444557+02:00 + description: Zipkin distributed tracing + digest: 0d4b3214ec87d1c3c9750cb99c36cd98360b91dfe0616785771293554233465a + name: zipkin-helm + urls: + - https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.5.0.tgz + version: 0.5.0 + - apiVersion: v1 + created: 2019-03-26T10:38:43.433532+02:00 + description: Zipkin distributed tracing + digest: e2fa16f0f7cab0bfa71387938ad89c871cd0905f2d7860818b24dfae85f2f476 + name: zipkin-helm + urls: + - https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.4.0.tgz + version: 0.4.0 + - apiVersion: v1 + created: 2019-03-26T10:38:43.429008+02:00 + description: Zipkin distributed tracing + digest: 05d19c305d86bee89f17f63de3f8596fe5c15af868fc8d0ef872e70a45e8a54c + name: zipkin-helm + urls: + - https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.3.2.tgz + version: 0.3.2 + - apiVersion: v1 + created: 2019-03-26T10:38:43.425516+02:00 + description: Zipkin distributed tracing + digest: bd4d94e1d71c267762d1a0f2d92095befc5d3613db62bad5dcefad405d454d1a + name: zipkin-helm + urls: + - https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.3.1.tgz + version: 0.3.1 + - apiVersion: v1 + created: 2019-03-26T10:38:43.422916+02:00 + description: Zipkin distributed tracing + digest: d06140fcfac9816316de44626dfa1e9ae627a3bf3fcc5d657ed8781052a52753 + name: zipkin-helm + urls: + - https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.3.0.tgz + version: 0.3.0 + - apiVersion: v1 + created: 2019-03-26T10:38:43.420919+02:00 + description: Zipkin distributed tracing + digest: 5a33ee9e2a54579478c975238dfc250676a8bd6eb8d4d7cd93d04da37eb07f54 + name: zipkin-helm + urls: + - https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.2.0.tgz + version: 0.2.0 + - apiVersion: v1 + created: 2019-03-26T10:38:43.419621+02:00 + description: Zipkin distributed tracing + digest: 758a27f7f52df7e4b17b441a19855130ad643ff003b3d5ef7912f6b2415641e7 + name: zipkin-helm + urls: + - https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.1.1.tgz + version: 0.1.1 + - apiVersion: v1 + created: 2019-03-26T10:38:43.418345+02:00 + description: Zipkin distributed tracing + digest: cb5ef222f689edfe46293cb5b4bddea46084b8f24f4b17d188b993f587c5dcb4 + name: zipkin-helm + urls: + - https://financial-times.github.io/zipkin-helm/docs/zipkin-helm-0.1.0.tgz + version: 0.1.0 +generated: 2019-03-26T10:38:43.414947+02:00 diff --git a/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.1.0.tgz b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.1.0.tgz new file mode 100644 index 000000000..877b7fa66 Binary files /dev/null and b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.1.0.tgz differ diff --git a/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.1.1.tgz b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.1.1.tgz new file mode 100644 index 000000000..903b88586 Binary files /dev/null and b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.1.1.tgz differ diff --git a/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.2.0.tgz b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.2.0.tgz new file mode 100644 index 000000000..61eae6fc2 Binary files /dev/null and b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.2.0.tgz differ diff --git a/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.3.0.tgz b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.3.0.tgz new file mode 100644 index 000000000..fce71b239 Binary files /dev/null and b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.3.0.tgz differ diff --git a/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.3.1.tgz b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.3.1.tgz new file mode 100644 index 000000000..70953cfd0 Binary files /dev/null and b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.3.1.tgz differ diff --git a/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.3.2.tgz b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.3.2.tgz new file mode 100644 index 000000000..f99264f77 Binary files /dev/null and b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.3.2.tgz differ diff --git a/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.4.0.tgz b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.4.0.tgz new file mode 100644 index 000000000..a67d1dac5 Binary files /dev/null and b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.4.0.tgz differ diff --git a/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.5.0.tgz b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.5.0.tgz new file mode 100644 index 000000000..146c6a985 Binary files /dev/null and b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.5.0.tgz differ diff --git a/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.6.0.tgz b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.6.0.tgz new file mode 100644 index 000000000..312143843 Binary files /dev/null and b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.6.0.tgz differ diff --git a/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.6.1.tgz b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.6.1.tgz new file mode 100644 index 000000000..1736f38b2 Binary files /dev/null and b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.6.1.tgz differ diff --git a/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.6.2.tgz b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.6.2.tgz new file mode 100644 index 000000000..b5f1be30a Binary files /dev/null and b/infra/tilt/dapr/zipkin-helm/docs/zipkin-helm-0.6.2.tgz differ diff --git a/infra/tilt/dapr/zipkin-helm/scripts/purge.sh b/infra/tilt/dapr/zipkin-helm/scripts/purge.sh new file mode 100755 index 000000000..e57963aa9 --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/scripts/purge.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +kubectl delete deploy/zipkin-collector +kubectl delete deploy/zipkin-ui + +kubectl delete statefulsets/zipkin-cassandra + +kubectl delete hpa/zipkin-collector + +kubectl delete cronjobs/foiled-walrus-zipkin-dependencies-gen + +kubectl delete svc/zipkin +kubectl delete svc/zipkin-cassandra +kubectl delete svc/zipkin-ui + +kubectl delete storageclasses.storage.k8s.io zipkin-cassandra-storage +kubectl delete secrets zipkin +kubectl delete cm zipkin-storage + +kubectl delete ing zipkin \ No newline at end of file diff --git a/infra/tilt/dapr/zipkin-helm/templates/NOTES.txt b/infra/tilt/dapr/zipkin-helm/templates/NOTES.txt new file mode 100644 index 000000000..37e22e766 --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/NOTES.txt @@ -0,0 +1,8 @@ +Thank you for installing {{ .Chart.Name }}. + +Your release is named {{ .Release.Name }}. + +To learn more about the release, try: + + $ helm status {{ .Release.Name }} + $ helm get {{ .Release.Name }} \ No newline at end of file diff --git a/infra/tilt/dapr/zipkin-helm/templates/_helpers.tpl b/infra/tilt/dapr/zipkin-helm/templates/_helpers.tpl new file mode 100644 index 000000000..f0d83d2ed --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/_helpers.tpl @@ -0,0 +1,16 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/infra/tilt/dapr/zipkin-helm/templates/collector-service.yaml b/infra/tilt/dapr/zipkin-helm/templates/collector-service.yaml new file mode 100644 index 000000000..fe6c4c84b --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/collector-service.yaml @@ -0,0 +1,17 @@ +kind: Service +apiVersion: v1 +metadata: + name: zipkin + labels: + app: zipkin + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: collector + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +spec: + ports: + - port: {{ .Values.collector.queryPort }} + name: "http" + targetPort: {{ .Values.collector.queryPort }} + selector: + app: zipkin-collector \ No newline at end of file diff --git a/infra/tilt/dapr/zipkin-helm/templates/configmap.yaml b/infra/tilt/dapr/zipkin-helm/templates/configmap.yaml new file mode 100644 index 000000000..da19517c8 --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/configmap.yaml @@ -0,0 +1,24 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: {{ .Values.configmap.name }} + labels: + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{if eq .Values.storageMethod "cassandra3"}} + +{{if eq .Values.configmap.username.name .Values.configmap.name}} + cassandra.username: "{{ .Values.cassandra.username }}" +{{ end }} + +{{if eq .Values.configmap.localdc.name .Values.configmap.name}} + cassandra.localdc: "{{ .Values.cassandra.localdc }}" +{{ end }} + +{{if eq .Values.configmap.contactPoints.name .Values.configmap.name}} + cassandra.contactpoints: "{{ .Release.Name }}-{{ .Values.cassandra.contactPoints }}" +{{ end }} + +{{ end }} diff --git a/infra/tilt/dapr/zipkin-helm/templates/dependencies-cron.yaml b/infra/tilt/dapr/zipkin-helm/templates/dependencies-cron.yaml new file mode 100644 index 000000000..61c6ed7e3 --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/dependencies-cron.yaml @@ -0,0 +1,64 @@ +{{if eq .Values.dependencies.enabled true}} +apiVersion: batch/v1beta1 +kind: CronJob +metadata: + name: {{ .Release.Name }}-zipkin-dependencies-gen + labels: + app: zipkin-dependencies-gen + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + schedule: "{{ .Values.dependencies.cron }}" + concurrencyPolicy: Forbid + successfulJobsHistoryLimit: 3 + failedJobsHistoryLimit: 3 + jobTemplate: + spec: + template: + metadata: + labels: + app: zipkin-dependencies-gen + release: {{ .Release.Name }} + spec: + restartPolicy: Never + containers: + - name: zipkin-dependencies-gen + image: "openzipkin/zipkin-dependencies:{{ .Values.dependencies.imageVersion }}" + env: + - name: STORAGE_TYPE + value: "{{ .Values.storageMethod }}" +{{if eq .Values.storageMethod "cassandra3"}} + - name: CASSANDRA_USERNAME + valueFrom: + configMapKeyRef: + name: {{ .Values.configmap.username.name }} + key: {{ .Values.configmap.username.key }} + - name: CASSANDRA_CONTACT_POINTS + valueFrom: + configMapKeyRef: + name: {{ .Values.configmap.contactPoints.name }} + key: {{ .Values.configmap.contactPoints.key }} + - name: CASSANDRA_LOCAL_DC + valueFrom: + configMapKeyRef: + name: {{ .Values.configmap.localdc.name }} + key: {{ .Values.configmap.localdc.key }} + - name: CASSANDRA_PASSWORD + valueFrom: + secretKeyRef: + name: zipkin + key: cassandra.password + - name: CASSANDRA_ENSURE_SCHEMA + value: "false" +{{ end }} + - name: JAVA_OPTS + value: "-XX:ConcGCThreads={{ .Values.node.cpus }} -XX:ParallelGCThreads={{ .Values.node.cpus }} -Djava.util.concurrent.ForkJoinPool.common.parallelism={{ .Values.node.cpus }} -Xms{{ .Values.dependencies.resources.javaOptsHeap }}M -Xmx{{ .Values.dependencies.resources.javaOptsHeap }}M -XX:+UseG1GC -server" + resources: + limits: + cpu: "{{ .Values.dependencies.resources.cpuLimit }}" + memory: "{{ .Values.dependencies.resources.ramMb }}Mi" # TODO fix this, this field id mi but the value is mb. There will be slight wastage + requests: + cpu: "{{ .Values.dependencies.resources.cpuRequest }}" + memory: "{{ .Values.dependencies.resources.ramMb }}Mi" # TODO fix this, this field id mi but the value is mb. There will be slight wastage +{{ end }} \ No newline at end of file diff --git a/infra/tilt/dapr/zipkin-helm/templates/hpa.yaml b/infra/tilt/dapr/zipkin-helm/templates/hpa.yaml new file mode 100644 index 000000000..bc28f5766 --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/hpa.yaml @@ -0,0 +1,17 @@ +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: zipkin-collector + labels: + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app: {{ template "name" . }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: zipkin-collector + minReplicas: {{ .Values.collector.replicaCount }} + maxReplicas: {{ .Values.collector.maxReplicaCount }} + targetCPUUtilizationPercentage: {{ .Values.collector.targetCPUUtilizationPercentage }} diff --git a/infra/tilt/dapr/zipkin-helm/templates/ingress.yaml b/infra/tilt/dapr/zipkin-helm/templates/ingress.yaml new file mode 100644 index 000000000..ee7696203 --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/ingress.yaml @@ -0,0 +1,20 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: zipkin + labels: + app: zipkin + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + kubernetes.io/ingress.class: "{{ .Values.ingress.class }}" +spec: + rules: + - host: {{ .Values.ingress.host }} + http: + paths: + - path: {{ .Values.ingress.path }} + backend: + serviceName: {{ .Values.ingress.serviceName }} + servicePort: {{ .Values.ingress.servicePort }} diff --git a/infra/tilt/dapr/zipkin-helm/templates/secrets.yaml b/infra/tilt/dapr/zipkin-helm/templates/secrets.yaml new file mode 100644 index 000000000..6c6b403bb --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/secrets.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Secret +metadata: + name: zipkin + labels: + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app: {{ template "name" . }} +type: Opaque +data: +{{if eq .Values.storageMethod "cassandra3"}} + cassandra.password: {{ b64enc .Values.cassandra.password }} +{{ end }} \ No newline at end of file diff --git a/infra/tilt/dapr/zipkin-helm/templates/storage.yaml b/infra/tilt/dapr/zipkin-helm/templates/storage.yaml new file mode 100644 index 000000000..5fc20ac6c --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/storage.yaml @@ -0,0 +1,91 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-zipkin-cassandra + labels: + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app: {{ template "name" . }} +spec: + ports: + - port: 9042 + clusterIP: None + selector: + app: zipkin-cassandra + +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ .Release.Name }}-zipkin-cassandra + labels: + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app: zipkin-cassandra +spec: + serviceName: zipkin-cassandra + replicas: {{ .Values.cassandra.replicas }} + selector: + matchLabels: + app: zipkin-cassandra + volumeClaimTemplates: + - metadata: + name: data-storage + spec: + storageClassName: local-path + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.cassandra.pvSize }} + template: + metadata: + labels: + app: zipkin-cassandra + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + spec: + {{- if .Values.cassandra.tolerations }} + tolerations: +{{ toYaml .Values.cassandra.tolerations | indent 8 }} + {{- end }} + initContainers: + - name: volume-mount-hack + image: busybox + command: ["sh", "-c", "chmod -R 777 /cassandra/"] + volumeMounts: + - name: data-storage + mountPath: /cassandra/data + imagePullSecrets: + - name: nexusregistrykey + containers: + - name: zipkin-cassandra + image: {{ .Values.cassandra.image }}:{{ .Values.cassandra.tag }} + lifecycle: + preStop: + exec: + command: ["/bin/sh", "-c", "PID=$(pidof java) && kill $PID && while ps -p $PID > /dev/null; do sleep 1; done"] + ports: + - containerPort: 9042 + livenessProbe: + initialDelaySeconds: {{ .Values.cassandra.probeStartupDelay }} + tcpSocket: + port: 9042 + readinessProbe: + initialDelaySeconds: {{ .Values.cassandra.probeStartupDelay }} + tcpSocket: + port: 9042 + resources: + limits: + cpu: "{{ .Values.cassandra.resources.cpuLimit }}" + memory: "{{ .Values.cassandra.resources.ramMb }}Mi" # TODO fix this, this field id mi but the value is mb. There will be slight wastage + requests: + cpu: "{{ .Values.cassandra.resources.cpuRequest }}" + memory: "{{ .Values.cassandra.resources.ramMb }}Mi" # TODO fix this, this field id mi but the value is mb. There will be slight wastage + volumeMounts: + - name: data-storage + mountPath: /cassandra/data + diff --git a/infra/tilt/dapr/zipkin-helm/templates/ui-service.yaml b/infra/tilt/dapr/zipkin-helm/templates/ui-service.yaml new file mode 100644 index 000000000..27f52111d --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/ui-service.yaml @@ -0,0 +1,13 @@ +kind: Service +apiVersion: v1 +metadata: + name: zipkin-ui + labels: + app: zipkin-ui +spec: + ports: + - port: {{ .Values.ui.queryPort }} + name: "http" + targetPort: {{ .Values.ui.queryPort }} + selector: + app: zipkin-ui \ No newline at end of file diff --git a/infra/tilt/dapr/zipkin-helm/templates/zipkin-collector.yaml b/infra/tilt/dapr/zipkin-helm/templates/zipkin-collector.yaml new file mode 100644 index 000000000..a6b4c457b --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/zipkin-collector.yaml @@ -0,0 +1,85 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-zipkin-collector + labels: + app: zipkin-collector + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.collector.replicaCount }} + selector: + matchLabels: + app: zipkin-collector + strategy: + rollingUpdate: + maxUnavailable: 0 + maxSurge: {{ .Values.collector.replicaCount }} + template: + metadata: + labels: + app: zipkin-collector + release: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "docker.io/openzipkin/zipkin:{{ .Values.collector.imageVersion }}" + ports: + - containerPort: {{ .Values.collector.queryPort }} + livenessProbe: + initialDelaySeconds: {{ .Values.collector.probeStartupDelay }} + tcpSocket: + port: {{ .Values.collector.queryPort }} + readinessProbe: + initialDelaySeconds: {{ .Values.collector.probeStartupDelay }} + httpGet: + path: /health + port: {{ .Values.collector.queryPort }} + resources: + limits: + cpu: "{{ .Values.collector.resources.cpuLimit }}" + memory: "{{ .Values.collector.resources.ramMb }}Mi" # TODO fix this, this field id mi but the value is mb. There will be slight wastage + requests: + cpu: "{{ .Values.collector.resources.cpuRequest }}" + memory: "{{ .Values.collector.resources.ramMb }}Mi" # TODO fix this, this field id mi but the value is mb. There will be slight wastage + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: QUERY_PORT + value: "{{ .Values.collector.queryPort }}" + - name: JAVA_OPTS + value: "-XX:ConcGCThreads={{ .Values.node.cpus }} -XX:ParallelGCThreads={{ .Values.node.cpus }} -Djava.util.concurrent.ForkJoinPool.common.parallelism={{ .Values.node.cpus }} -Xms{{ .Values.collector.resources.javaOptsHeap }}M -Xmx{{ .Values.collector.resources.javaOptsHeap }}M -XX:+UseG1GC -server" + - name: COLLECTOR_SAMPLE_RATE + value: "{{ .Values.collector.sampleRate }}" + - name: QUERY_ENABLED + value: "false" + - name: STORAGE_TYPE + value: "{{ .Values.storageMethod }}" +{{if eq .Values.storageMethod "cassandra3"}} + - name: CASSANDRA_USERNAME + valueFrom: + configMapKeyRef: + name: {{ .Values.configmap.username.name }} + key: {{ .Values.configmap.username.key }} + - name: CASSANDRA_CONTACT_POINTS + valueFrom: + configMapKeyRef: + name: {{ .Values.configmap.contactPoints.name }} + key: {{ .Values.configmap.contactPoints.key }} + - name: CASSANDRA_LOCAL_DC + valueFrom: + configMapKeyRef: + name: {{ .Values.configmap.localdc.name }} + key: {{ .Values.configmap.localdc.key }} + - name: CASSANDRA_PASSWORD + valueFrom: + secretKeyRef: + name: zipkin + key: cassandra.password + - name: CASSANDRA_ENSURE_SCHEMA + value: "false" +{{ end }} diff --git a/infra/tilt/dapr/zipkin-helm/templates/zipkin-ui.yaml b/infra/tilt/dapr/zipkin-helm/templates/zipkin-ui.yaml new file mode 100644 index 000000000..ffea32e7b --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/templates/zipkin-ui.yaml @@ -0,0 +1,82 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-zipkin-ui + labels: + app: {{ .Release.Name }}-zipkin-ui + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.ui.replicaCount }} + selector: + matchLabels: + app: zipkin-ui + strategy: + rollingUpdate: + maxUnavailable: 2 + template: + metadata: + labels: + app: zipkin-ui + release: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "docker.io/openzipkin/zipkin:{{ .Values.ui.imageVersion }}" + ports: + - containerPort: {{ .Values.ui.queryPort }} + livenessProbe: + initialDelaySeconds: {{ .Values.ui.probeStartupDelay }} + tcpSocket: + port: {{ .Values.ui.queryPort }} + readinessProbe: + initialDelaySeconds: {{ .Values.ui.probeStartupDelay }} + httpGet: + path: /health + port: {{ .Values.ui.queryPort }} + resources: + limits: + cpu: "{{ .Values.ui.resources.cpuLimit }}" + memory: "{{ .Values.ui.resources.ramMb }}Mi" # TODO fix this, this field id mi but the value is mb. There will be slight wastage + requests: + cpu: "{{ .Values.ui.resources.cpuRequest }}" + memory: "{{ .Values.ui.resources.ramMb }}Mi" # TODO fix this, this field id mi but the value is mb. There will be slight wastage + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: QUERY_PORT + value: "{{ .Values.ui.queryPort }}" + - name: JAVA_OPTS + value: "-XX:ConcGCThreads={{ .Values.node.cpus }} -XX:ParallelGCThreads={{ .Values.node.cpus }} -Djava.util.concurrent.ForkJoinPool.common.parallelism={{ .Values.node.cpus }} -Xms{{ .Values.ui.resources.javaOptsHeap }}M -Xmx{{ .Values.ui.resources.javaOptsHeap }}M -XX:+UseG1GC -server" + - name: QUERY_ENABLED + value: "true" + - name: STORAGE_TYPE + value: "{{ .Values.storageMethod }}" +{{if eq .Values.storageMethod "cassandra3"}} + - name: CASSANDRA_USERNAME + valueFrom: + configMapKeyRef: + name: {{ .Values.configmap.username.name }} + key: {{ .Values.configmap.username.key }} + - name: CASSANDRA_CONTACT_POINTS + valueFrom: + configMapKeyRef: + name: {{ .Values.configmap.contactPoints.name }} + key: {{ .Values.configmap.contactPoints.key }} + - name: CASSANDRA_LOCAL_DC + valueFrom: + configMapKeyRef: + name: {{ .Values.configmap.localdc.name }} + key: {{ .Values.configmap.localdc.key }} + - name: CASSANDRA_PASSWORD + valueFrom: + secretKeyRef: + name: zipkin + key: cassandra.password + - name: CASSANDRA_ENSURE_SCHEMA + value: "false" +{{ end }} diff --git a/infra/tilt/dapr/zipkin-helm/values.yaml b/infra/tilt/dapr/zipkin-helm/values.yaml new file mode 100644 index 000000000..58676a0f5 --- /dev/null +++ b/infra/tilt/dapr/zipkin-helm/values.yaml @@ -0,0 +1,78 @@ +# Default values for zipkin. +collector: + replicaCount: 3 + maxReplicaCount: 5 + targetCPUUtilizationPercentage: 80 + imageVersion: 2 + sampleRate: 0.1 + probeStartupDelay: 200 + queryPort: 9411 + resources: + ramMb: 1100 + javaOptsHeap: 1000 + cpuRequest: 80m + cpuLimit: 300m + +ui: + replicaCount: 1 + imageVersion: 2 + probeStartupDelay: 200 + queryPort: 9411 + resources: + ramMb: 900 + javaOptsHeap: 700 + cpuRequest: 150m + cpuLimit: 600m + +dependencies: + enabled: true + cron: "0 22 * * *" + imageVersion: 1.11.0 + resources: + ramMbLimits: 4000 + ramMbRequests: 4000 + javaOptsHeap: 3500 + cpuRequest: 1 + cpuLimit: 1 + +configmap: + name: zipkin-storage + contactPoints: + name: zipkin-storage + key: cassandra.contactpoints + username: + name: zipkin-storage + key: cassandra.username + localdc: + name: zipkin-storage + key: cassandra.localdc + +ingress: + class: "nginx" + path: / + serviceName: zipkin-ui + servicePort: 9411 + +storageMethod: cassandra3 + +cassandra: + username: zipkin + password: zipkin + contactPoints: zipkin-cassandra:9042 + localdc: datacenter1 + ensureSchema: false + image: openzipkin/zipkin-cassandra + probeStartupDelay: 120 + tag: 2 + replicas: 1 + pvSize: 20Gi + resources: + ramMbRequest: 3000 + ramMbLimit: 8000 + cpuRequest: 200m + cpuLimit: 500m + +node: + cpus: 2 + + diff --git a/infra/tilt/monitoring/Tiltfile b/infra/tilt/monitoring/Tiltfile new file mode 100644 index 000000000..8d9a0180d --- /dev/null +++ b/infra/tilt/monitoring/Tiltfile @@ -0,0 +1,14 @@ +### Monitoring ####################################################################### +load('ext://helm_remote', 'helm_remote') + +helm_remote('kube-prometheus-stack', + repo_url='https://prometheus-community.github.io/helm-charts', + namespace='monitoring', + values="./values.yaml", + create_namespace=True +) + +k8s_resource(workload='kube-prometheus-stack-prometheus-node-exporter', labels=["monitoring"]) +k8s_resource(workload='kube-prometheus-stack-kube-state-metrics', labels=["monitoring"]) +k8s_resource(workload='kube-prometheus-stack-operator', labels=["monitoring"]) +k8s_resource(workload='kube-prometheus-stack-grafana', port_forwards='3302:3000', labels=["monitoring"], resource_deps=['kube-prometheus-stack-operator']) \ No newline at end of file diff --git a/infra/tilt/monitoring/values.yaml b/infra/tilt/monitoring/values.yaml new file mode 100644 index 000000000..b715977c1 --- /dev/null +++ b/infra/tilt/monitoring/values.yaml @@ -0,0 +1,12 @@ +prometheus-node-exporter: + hostRootFsMount: + enabled: false +prometheusOperator: + tls: + enabled: false + admissionWebhooks: + enabled: false + +alertmanager: + ingress: + enabled: false