├── .github ├── CODEOWNERS └── workflows │ ├── ci.yaml │ ├── lint.yaml │ ├── postci.yaml │ ├── prereleaser.yaml │ ├── release.yaml │ └── test.yaml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── charts ├── .helmignore ├── clickhouse │ ├── .helmignore │ ├── Chart.lock │ ├── Chart.yaml │ ├── README.md │ ├── crds │ │ ├── clickhouseinstallations.clickhouse.altinity.com.yaml │ │ ├── clickhouseinstallationtemplates.clickhouse.altinity.com.yaml │ │ └── clickhouseoperatorconfigurations.clickhouse.altinity.com.yaml │ ├── templates │ │ ├── _helper.tpl │ │ ├── clickhouse-instance │ │ │ ├── clickhouse-instance.yaml │ │ │ ├── configmap.yaml │ │ │ ├── exporter-configmap.yaml │ │ │ ├── scripts-configmap.yaml │ │ │ ├── serviceaccount.yaml │ │ │ └── storage-class.yaml │ │ └── clickhouse-operator │ │ │ ├── configmaps │ │ │ ├── etc-confd-files.yaml │ │ │ ├── etc-configd-files.yaml │ │ │ ├── etc-files.yaml │ │ │ ├── etc-templatesd-files.yaml │ │ │ └── etc-usersd-files.yaml │ │ │ ├── deployment.yaml │ │ │ ├── namespace.yaml │ │ │ ├── role.yaml │ │ │ ├── rolebinding.yaml │ │ │ ├── secret.yaml │ │ │ ├── service.yaml │ │ │ ├── serviceaccount.yaml │ │ │ └── servicemonitor.yaml │ ├── tests │ │ ├── clickhouse-instance_default_test.yaml │ │ ├── clickhouse-instance_sidecar_test.yaml │ │ └── clickhouse-instance_volume_test.yaml │ └── values.yaml ├── k8s-infra │ ├── .helmignore │ ├── Chart.yaml │ ├── templates │ │ ├── NOTES.txt │ │ ├── _config.tpl │ │ ├── _helpers.tpl │ │ ├── apikey-secret.yaml │ │ ├── apikey-self-telemetry-secret.yaml │ │ ├── namespace.yaml │ │ ├── otel-agent │ │ │ ├── clusterrole.yaml │ │ │ ├── clusterrolebinding.yaml │ │ │ ├── configmap.yaml │ │ │ ├── daemonset.yaml │ │ │ ├── ingress.yaml │ │ │ ├── service.yaml │ │ │ ├── serviceaccount.yaml │ │ │ └── tests │ │ │ │ └── test-connection.yaml │ │ ├── otel-deployment │ │ │ ├── clusterrole.yaml │ │ │ ├── clusterrolebinding.yaml │ │ │ ├── configmap.yaml │ │ │ ├── deployment.yaml │ │ │ ├── ingress.yaml │ │ │ ├── service.yaml │ │ │ ├── serviceaccount.yaml │ │ │ └── tests │ │ │ │ └── test-connection.yaml │ │ └── tls-secret.yaml │ ├── tests │ │ ├── otel-agent_log_collection_test.yaml │ │ ├── otel-agent_self_telemetry_enable_otlp_test.yaml │ │ ├── otel-agent_self_telemetry_test.yaml │ │ ├── otel-deployment_prometheus_test.yaml │ │ └── otel-deployment_self_telemetry_test.yaml │ └── values.yaml ├── signoz-otel-gateway │ ├── .helmignore │ ├── Chart.lock │ ├── Chart.yaml │ ├── templates │ │ ├── _helpers.tpl │ │ ├── config.yaml │ │ ├── deployment.yaml │ │ ├── ingress.yaml │ │ ├── secrets.yaml │ │ ├── service.yaml │ │ └── serviceaccount.yaml │ └── values.yaml └── signoz │ ├── Chart.lock │ ├── Chart.yaml │ ├── README.md │ ├── templates │ ├── NOTES.txt │ ├── _clickhouse.tpl │ ├── _helpers.tpl │ ├── otel-collector │ │ ├── clusterrole.yaml │ │ ├── clusterrolebinding.yaml │ │ ├── configmap.yaml │ │ ├── deployment.yaml │ │ ├── hpa.yaml │ │ ├── ingress.yaml │ │ ├── keda-autoscaler.yaml │ │ ├── service.yaml │ │ └── serviceaccount.yaml │ ├── schema-migrator │ │ ├── migrations-async.yaml │ │ ├── migrations-sync.yaml │ │ ├── role.yaml │ │ ├── rolebinding.yaml │ │ └── serviceaccount.yaml │ ├── secrets-clickhouse-external.yaml │ └── signoz │ │ ├── ingress.yaml │ │ ├── service.yaml │ │ ├── serviceaccount.yaml │ │ ├── statefulset.yaml │ │ └── tests │ │ └── test-connection.yaml │ └── values.yaml └── ct.yaml /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # CODEOWNERS info: https://help.github.com/en/articles/about-code-owners 2 | # Owners are automatically requested for review for PRs that changes code 3 | # that they own. 4 | 5 | * @SigNoz/devops 6 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | pull_request_target: 8 | types: 9 | - labeled 10 | 11 | jobs: 12 | unittest: 13 | if: | 14 | (github.event_name == 'pull_request' && ! github.event.pull_request.head.repo.fork && github.event.pull_request.user.login != 'dependabot[bot]' && ! contains(github.event.pull_request.labels.*.name, 'safe-to-test')) || 15 | (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe-to-test')) 16 | uses: signoz/primus.workflows/.github/workflows/helm-unittest.yaml@main 17 | secrets: inherit 18 | with: 19 | PRIMUS_REF: main 20 | -------------------------------------------------------------------------------- /.github/workflows/lint.yaml: -------------------------------------------------------------------------------- 1 | name: Lint Charts 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | lint-chart: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v3 14 | with: 15 | fetch-depth: 0 16 | 17 | - name: Set up Helm 18 | uses: azure/setup-helm@v3 19 | with: 20 | version: v3.12.1 21 | 22 | - uses: actions/setup-python@v4 23 | with: 24 | python-version: "3.10" 25 | check-latest: true 26 | 27 | - name: Set up chart-testing 28 | uses: helm/chart-testing-action@v2.6.1 29 | 30 | - name: Run chart-testing (lint) 31 | run: ct lint --config ct.yaml 32 | -------------------------------------------------------------------------------- /.github/workflows/postci.yaml: -------------------------------------------------------------------------------- 1 | name: postci 2 | 3 | on: 4 | pull_request_target: 5 | branches: 6 | - main 7 | types: 8 | - synchronize 9 | 10 | jobs: 11 | remove: 12 | if: github.event.pull_request.head.repo.fork || github.event.pull_request.user.login == 'dependabot[bot]' 13 | uses: signoz/primus.workflows/.github/workflows/github-label.yaml@main 14 | secrets: inherit 15 | with: 16 | PRIMUS_REF: main 17 | GITHUB_LABEL_ACTION: remove 18 | GITHUB_LABEL_NAME: safe-to-test 19 | -------------------------------------------------------------------------------- /.github/workflows/prereleaser.yaml: -------------------------------------------------------------------------------- 1 | name: prereleaser 2 | 3 | on: 4 | # trigger on repository_dispatch event from other GitHub repository workflows 5 | repository_dispatch: 6 | types: [prereleaser] 7 | 8 | # allow manual triggering of the workflow by a maintainer 9 | workflow_dispatch: 10 | inputs: 11 | release_type: 12 | description: "Type of the release" 13 | type: choice 14 | required: true 15 | options: 16 | - 'patch' 17 | - 'minor' 18 | - 'major' 19 | 20 | jobs: 21 | verify: 22 | if: ${{ github.event.action != 'prereleaser' }} 23 | uses: signoz/primus.workflows/.github/workflows/github-verify.yaml@main 24 | secrets: inherit 25 | with: 26 | PRIMUS_REF: main 27 | GITHUB_TEAM_NAME: releaser 28 | GITHUB_MEMBER_NAME: ${{ github.actor }} 29 | charts: 30 | if: ${{ always() && (needs.verify.result != 'skipped' || github.event.action == 'prereleaser') }} 31 | uses: signoz/primus.workflows/.github/workflows/releaser.yaml@main 32 | secrets: inherit 33 | needs: [verify] 34 | with: 35 | PRIMUS_REF: main 36 | PROJECT_NAME: charts 37 | RELEASE_TYPE: ${{ (github.event.client_payload && github.event.client_payload.release_type) || inputs.release_type }} 38 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release Charts 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | release: 10 | # depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions 11 | # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token 12 | permissions: 13 | contents: write 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v3 18 | with: 19 | fetch-depth: 0 20 | 21 | - name: Configure Git 22 | run: | 23 | git config user.name "$GITHUB_ACTOR" 24 | git config user.email "$GITHUB_ACTOR@users.noreply.github.com" 25 | 26 | - name: Set up Helm 27 | uses: azure/setup-helm@v3 28 | with: 29 | version: v3.10.3 30 | 31 | - name: Add dependencies 32 | run: | 33 | helm repo add signoz https://charts.signoz.io 34 | 35 | - name: Run chart-releaser 36 | uses: helm/chart-releaser-action@v1.5.0 37 | env: 38 | CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 39 | CR_SKIP_EXISTING: true 40 | CR_GENERATE_RELEASE_NOTES: true 41 | -------------------------------------------------------------------------------- /.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: Test Charts 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | test-chart: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v3 14 | with: 15 | fetch-depth: 0 16 | 17 | - name: Set up Helm 18 | uses: azure/setup-helm@v3 19 | with: 20 | version: v3.12.1 21 | 22 | - uses: actions/setup-python@v4 23 | with: 24 | python-version: "3.10" 25 | check-latest: true 26 | 27 | - name: Set up chart-testing 28 | uses: helm/chart-testing-action@v2.6.1 29 | 30 | - name: Run chart-testing (list-changed) 31 | id: list-changed 32 | run: | 33 | changed=$(ct list-changed --config ct.yaml) 34 | if [[ -n "$changed" ]]; then 35 | echo "changed=true" >> $GITHUB_OUTPUT 36 | fi 37 | 38 | - name: Create kind cluster 39 | uses: helm/kind-action@v1.8.0 40 | with: 41 | wait: 600s 42 | # Only build a kind cluster if there are chart changes to test. 43 | if: steps.list-changed.outputs.changed == 'true' 44 | 45 | - name: Run chart-testing (install) 46 | run: ct install --config ct.yaml --helm-extra-set-args '--set=otelCollectorEndpoint=endpoint-that-does-not-exist:4317' 47 | if: steps.list-changed.outputs.changed == 'true' 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### macOS ### 2 | # General 3 | .DS_Store 4 | # Local 5 | .local/ 6 | 7 | ### Helm ### 8 | # Chart dependencies 9 | **/charts/*.tgz 10 | 11 | ### Scripts ### 12 | tmp/ 13 | 14 | rendered/ 15 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | There are primarily 2 charts in the SigNoz Helm Charts repository: 4 | 5 | - signoz: signoz and signoz collector 6 | - clickhouse: clickhouse and zookeeper 7 | 8 | signoz chart is where most of the developments are done. 9 | clickhouse chart is seldom updated to to sync major enhancements. 10 | 11 | ### To run helm chart for local development 12 | 13 | - run `git clone https://github.com/SigNoz/charts.git` followed by `cd charts` 14 | - it is recommended to use lightweight kubernetes (k8s) cluster for local development: 15 | - [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) 16 | - [k3d](https://k3d.io/#installation) 17 | - [minikube](https://minikube.sigs.k8s.io/docs/start/) 18 | - create a k8s cluster and make sure `kubectl` points to the locally created k8s cluster 19 | - run `make dev-install` to install SigNoz chart with `my-release` release name in `platform` namespace. 20 | - run `kubectl -n platform port-forward svc/my-release-signoz 8080:8080` to make SigNoz UI available at [localhost:8080](http://localhost:8080) 21 | 22 | **To install HotROD sample app:** 23 | 24 | ```bash 25 | curl -sL https://github.com/SigNoz/signoz/raw/main/sample-apps/hotrod/hotrod-install.sh \ 26 | | HELM_RELEASE=my-release SIGNOZ_NAMESPACE=platform bash 27 | ``` 28 | 29 | **To load data with HotROD sample app:** 30 | 31 | ```bash 32 | kubectl -n sample-application run strzal --image=djbingham/curl \ 33 | --restart='OnFailure' -i --tty --rm --command -- curl -X POST -F \ 34 | 'user_count=6' -F 'spawn_rate=2' http://locust-master:8089/swarm 35 | ``` 36 | 37 | **To stop the load generation:** 38 | 39 | ```bash 40 | kubectl -n sample-application run strzal --image=djbingham/curl \ 41 | --restart='OnFailure' -i --tty --rm --command -- curl \ 42 | http://locust-master:8089/stop 43 | ``` 44 | 45 | **To delete HotROD sample app:** 46 | 47 | ```bash 48 | curl -sL https://github.com/SigNoz/signoz/raw/main/sample-apps/hotrod/hotrod-delete.sh \ 49 | | HOTROD_NAMESPACE=sample-application bash 50 | ``` 51 | 52 | --- 53 | 54 | ## General Instructions 55 | 56 | You can always reach out to `prashant@signoz.io` to understand more about the SigNoz helm chart. 57 | We are very responsive over [slack](https://signoz.io/slack). 58 | 59 | Please use the label `helm-chart` for your issues and pull requests. 60 | 61 | - If you find any bugs, please create an issue 62 | - If you find anything missing in documentation, you can create an issue with label `documentation` 63 | - If you want to build any new feature, please create an issue with label `enhancement` 64 | - If you want to discuss something about the helm chart, please use the [Helm chart discussion](https://github.com/SigNoz/signoz/discussions/713) 65 | 66 | ### Conventions to follow when submitting commits, PRs 67 | 68 | 1. We try to follow https://www.conventionalcommits.org/en/v1.0.0/ 69 | 70 | More specifically the commits and PRs should have type specifiers prefixed in the name. [This](https://www.conventionalcommits.org/en/v1.0.0/#specification) should give you a better idea. 71 | 72 | 2. Follow [GitHub Flow](https://guides.github.com/introduction/flow/) guidelines for your contribution flows 73 | 74 | 3. Feel free to ping us on `#contributing` on our slack community if you need any help on this :) 75 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 SigNoz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | RELEASE_NAME := my-release 2 | NAMESPACE := platform # k8s namespace for installing the chart 3 | 4 | delete-namespace: 5 | kubectl delete namespace $(NAMESPACE) 6 | 7 | add-repository: 8 | helm repo add --force-update signoz https://charts.signoz.io 9 | 10 | update-repository: 11 | helm repo update 12 | 13 | dependency-update: 14 | helm dependency update charts/signoz 15 | 16 | setup: add-repository update-repository 17 | 18 | local-setup: dependency-update 19 | 20 | # print resulting manifests to console without applying them 21 | debug: 22 | helm install --dry-run --debug $(RELEASE_NAME) signoz/signoz 23 | 24 | # install the chart to configured namespace 25 | install: setup 26 | helm upgrade -i $(RELEASE_NAME) -n $(NAMESPACE) --create-namespace signoz/signoz 27 | 28 | # uninstall the chart and resources from configured namespace 29 | uninstall: 30 | helm uninstall -n $(NAMESPACE) $(RELEASE_NAME) 31 | 32 | # delete all resources from configured namespace 33 | delete: uninstall 34 | kubectl delete all,pvc,cm --all -n $(NAMESPACE) 35 | 36 | upgrade: create-namespace 37 | helm upgrade $(RELEASE_NAME) -n $(NAMESPACE) --create-namespace 38 | 39 | list: 40 | kubectl get all -n $(NAMESPACE) 41 | 42 | list-all: 43 | kubectl get all,pvc,cm -n $(NAMESPACE) 44 | 45 | # install the local development chart to configured namespace 46 | dev-install: local-setup 47 | helm upgrade -i $(RELEASE_NAME) -n $(NAMESPACE) --create-namespace charts/signoz 48 | 49 | re-install: delete install 50 | 51 | purge: delete delete-namespace 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SigNoz Helm Chart 2 | 3 | SigNoz helm chart ready to be deployed on Kubernetes using [Kubernetes Helm](https://github.com/helm/helm). 4 | 5 | ## TL;DR 6 | 7 | ```bash 8 | $ helm repo add signoz https://charts.signoz.io 9 | $ helm install -n platform --create-namespace my-release signoz/signoz 10 | ``` 11 | 12 | ## Before you begin 13 | 14 | ### Setup a Kubernetes Cluster 15 | 16 | The quickest way to setup a staging/production Kubernetes cluster is with [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/), 17 | [AWS Elastic Kubernetes Service](https://aws.amazon.com/eks/) or [Azure Kubernetes Service](https://azure.microsoft.com/en-us/services/kubernetes-service/) 18 | using their respective quick-start guides. 19 | 20 | For setting up Kubernetes on other cloud platforms, bare-metal servers, or local machine refer to the Kubernetes 21 | [getting started guide](https://kubernetes.io/docs/setup/). 22 | 23 | ### Install kubectl 24 | 25 | The [Kubernetes](https://kubernetes.io/) command-line tool, `kubectl`, allows you to 26 | run commands against Kubernetes clusters. You can use kubectl to deploy applications, 27 | inspect and manage cluster resources, and view logs. 28 | 29 | To install `kubectl` follow the instructions [here](https://kubernetes.io/docs/tasks/tools/install-kubectl/). 30 | 31 | ### Install Helm 32 | 33 | [Helm](https://helm.sh/) is a tool for managing Kubernetes charts. Charts are packages 34 | of pre-configured Kubernetes resources. 35 | 36 | To install Helm follow the instructions [here](https://helm.sh/docs/intro/install/). 37 | 38 | ### Add SigNoz Repository 39 | 40 | To add the SigNoz helm repository: 41 | 42 | ```bash 43 | $ helm repo add signoz https://charts.signoz.io 44 | ``` 45 | 46 | ### Usage 47 | 48 | See the [README of SigNoz helm chart](./charts/signoz/README.md). 49 | 50 | ### Contribute the Chart 51 | 52 | See the [instructions here to contribute](./CONTRIBUTING.md). 53 | 54 | # License 55 | 56 | MIT License 57 | 58 | Copyright (c) 2022 SigNoz 59 | -------------------------------------------------------------------------------- /charts/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | 25 | unittests/ 26 | -------------------------------------------------------------------------------- /charts/clickhouse/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | # helm-unittest 25 | tests/ -------------------------------------------------------------------------------- /charts/clickhouse/Chart.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: zookeeper 3 | repository: oci://registry-1.docker.io/bitnamicharts 4 | version: 11.4.2 5 | digest: sha256:5e51e39bdcf08cc2b073b5a22bf41e2d57fe90928c636842a5921abe053d48b3 6 | generated: "2023-06-14T16:04:27.789249288+05:30" 7 | -------------------------------------------------------------------------------- /charts/clickhouse/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: clickhouse 3 | description: A Helm chart for ClickHouse 4 | type: application 5 | version: 24.1.16 6 | appVersion: "24.1.2" 7 | icon: https://github.com/ClickHouse/clickhouse-docs/raw/84f38d893eb7e561c7296279d7953b6a508ec413/static/img/clickhouse-logo.svg 8 | sources: 9 | - https://github.com/SigNoz/charts 10 | - https://github.com/ClickHouse/ClickHouse 11 | dependencies: 12 | - name: zookeeper 13 | repository: oci://registry-1.docker.io/bitnamicharts 14 | version: 11.4.2 15 | condition: zookeeper.enabled 16 | maintainers: 17 | - name: SigNoz 18 | email: hello@signoz.io 19 | url: https://signoz.io 20 | - name: prashant-shahi 21 | email: prashant@signoz.io 22 | url: https://prashantshahi.dev 23 | -------------------------------------------------------------------------------- /charts/clickhouse/README.md: -------------------------------------------------------------------------------- 1 | # Clickhouse 2 | 3 | This helmchart is being installed as subchart/dependecy for signoz helmchart with default values. 4 | 5 | ### Usage recommendation 6 | 7 | In case you are not using a well-know reserved private IP address range that are whitelisted by default for your deployment environment (like for minikube environment), eg: 8 | - 10.0.0.0/8 9 | - 100.64.0.0/10 10 | - 172.16.0.0/12 11 | - 192.0.0.0/24 12 | - 198.18.0.0/15 13 | - 192.168.0.0/16 14 | 15 | You must whitelist IP address range used for your enviroment (eg. kubernetes nodes IPs) manually in Signoz values chart. 16 | 17 | ```yaml 18 | clickhouse: 19 | allowedNetworkIps: 20 | - "192.173.0.0/16" 21 | ``` 22 | 23 | Otherwise you'll be getting error message like: 24 | 25 | ``` 26 | Failed to initialize ClickHouse: error connecting to primary db: code: 516, 27 | message: admin: Authentication failed: password is incorrect, or there is no user with such name 28 | ``` 29 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/_helper.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | 3 | {{/* 4 | Expand the name of the chart. 5 | */}} 6 | {{- define "clickhouse.name" -}} 7 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 8 | {{- end -}} 9 | 10 | {{/* 11 | Create a default fully qualified app name. 12 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 13 | If release name contains chart name it will be used as a full name. 14 | */}} 15 | {{- define "clickhouse.fullname" -}} 16 | {{- if .Values.fullnameOverride -}} 17 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 18 | {{- else -}} 19 | {{- $name := default .Chart.Name .Values.nameOverride -}} 20 | {{- if contains $name .Release.Name -}} 21 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 24 | {{- end -}} 25 | {{- end -}} 26 | {{- end -}} 27 | 28 | {{/* 29 | Create chart name and version as used by the chart label. 30 | */}} 31 | {{- define "clickhouse.chart" -}} 32 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 33 | {{- end -}} 34 | 35 | {{/* 36 | Common labels 37 | */}} 38 | {{- define "clickhouse.labels" -}} 39 | helm.sh/chart: {{ include "clickhouse.chart" . }} 40 | {{ include "clickhouse.selectorLabels" . }} 41 | {{- if .Chart.AppVersion }} 42 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 43 | {{- end }} 44 | app.kubernetes.io/managed-by: {{ .Release.Service }} 45 | {{- end -}} 46 | 47 | {{/* 48 | Selector labels 49 | */}} 50 | {{- define "clickhouse.selectorLabels" -}} 51 | app.kubernetes.io/name: {{ include "clickhouse.name" . }} 52 | app.kubernetes.io/instance: {{ .Release.Name }} 53 | app.kubernetes.io/component: {{ default "clickhouse" .Values.name }} 54 | {{- end -}} 55 | 56 | {{/* 57 | Create the name of the service account to use 58 | */}} 59 | {{- define "clickhouse.serviceAccountName" -}} 60 | {{- if .Values.serviceAccount.create -}} 61 | {{ default (include "clickhouse.fullname" .) .Values.serviceAccount.name }} 62 | {{- else -}} 63 | {{ default "default" .Values.serviceAccount.name }} 64 | {{- end -}} 65 | {{- end -}} 66 | 67 | {{/* 68 | Set zookeeper host 69 | */}} 70 | {{- define "clickhouse.zookeeper.servicename" -}} 71 | {{- if .Values.zookeeper.fullnameOverride -}} 72 | {{- .Values.zookeeper.fullnameOverride | trunc 63 | trimSuffix "-" -}} 73 | {{- else if .Values.zookeeper.nameOverride -}} 74 | {{- printf "%s-%s" .Release.Name .Values.zookeeper.nameOverride | trunc 63 | trimSuffix "-" -}} 75 | {{- else -}} 76 | {{- printf "%s-%s" .Release.Name "zookeeper" | trunc 63 | trimSuffix "-" -}} 77 | {{- end -}} 78 | {{- end -}} 79 | 80 | {{/* 81 | Set zookeeper port 82 | */}} 83 | {{- define "clickhouse.zookeeper.port" -}} 84 | {{- default 2181 }} 85 | {{- end }} 86 | 87 | {{/* 88 | Return suffix part of the headless service 89 | */}} 90 | {{- define "clickhouse.zookeeper.headlessSvcSuffix" -}} 91 | {{- $namespace := .Values.zookeeper.namespaceOverride }} 92 | {{- $clusterDomain := default "cluster.local" .Values.global.clusterDomain }} 93 | {{- $name := printf "%s-headless" (include "clickhouse.zookeeper.servicename" .) }} 94 | {{- if and $namespace (ne $namespace .Values.namespace) }} 95 | {{- printf "%s.%s.svc.%s" $name $namespace $clusterDomain }} 96 | {{- else -}} 97 | {{- $name }} 98 | {{- end }} 99 | {{- end }} 100 | 101 | {{/* 102 | Return the initContainers image name 103 | */}} 104 | {{- define "clickhouse.initContainers.init.image" -}} 105 | {{- $registryName := default .Values.initContainers.init.image.registry .Values.global.imageRegistry -}} 106 | {{- $repositoryName := .Values.initContainers.init.image.repository -}} 107 | {{- $tag := .Values.initContainers.init.image.tag | toString -}} 108 | {{- if $registryName -}} 109 | {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} 110 | {{- else -}} 111 | {{- printf "%s:%s" $repositoryName $tag -}} 112 | {{- end -}} 113 | {{- end -}} 114 | 115 | {{/* 116 | Return the initContainers image name for UDF 117 | */}} 118 | {{- define "clickhouse.initContainers.udf.image" -}} 119 | {{- $registryName := default .Values.initContainers.udf.image.registry .Values.global.imageRegistry -}} 120 | {{- $repositoryName := .Values.initContainers.udf.image.repository -}} 121 | {{- $tag := .Values.initContainers.udf.image.tag | toString -}} 122 | {{- if $registryName -}} 123 | {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} 124 | {{- else -}} 125 | {{- printf "%s:%s" $repositoryName $tag -}} 126 | {{- end -}} 127 | {{- end -}} 128 | 129 | {{/* 130 | Return the proper clickhouse image name 131 | */}} 132 | {{- define "clickhouse.image" -}} 133 | {{- $registryName := default .Values.image.registry .Values.global.imageRegistry -}} 134 | {{- $repositoryName := .Values.image.repository -}} 135 | {{- $tag := .Values.image.tag | toString -}} 136 | {{- if $registryName -}} 137 | {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} 138 | {{- else -}} 139 | {{- printf "%s:%s" $repositoryName $tag -}} 140 | {{- end -}} 141 | {{- end -}} 142 | 143 | {{/* 144 | Return the proper exporter image name 145 | */}} 146 | {{- define "logs.system.image" -}} 147 | {{- $registryName := default .Values.logs.system.image.registry .Values.global.imageRegistry -}} 148 | {{- $repositoryName := .Values.logs.system.image.repository -}} 149 | {{- $tag := .Values.logs.system.image.tag | toString -}} 150 | {{- if $registryName -}} 151 | {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} 152 | {{- else -}} 153 | {{- printf "%s:%s" $repositoryName $tag -}} 154 | {{- end -}} 155 | {{- end -}} 156 | 157 | {{/* 158 | Return `nodePort: null` if service type is ClusterIP 159 | */}} 160 | {{- define "service.ifClusterIP" -}} 161 | {{- if (eq . "ClusterIP") -}} 162 | nodePort: null 163 | {{- end -}} 164 | {{- end -}} 165 | 166 | {{/* 167 | Return the proper Image Registry Secret Names. 168 | */}} 169 | {{- define "clickhouse.imagePullSecrets" -}} 170 | {{- if or .Values.global.imagePullSecrets .Values.imagePullSecrets }} 171 | imagePullSecrets: 172 | {{- range .Values.global.imagePullSecrets }} 173 | - name: {{ . }} 174 | {{- end }} 175 | {{- range .Values.imagePullSecrets }} 176 | - name: {{ . }} 177 | {{- end }} 178 | {{- end }} 179 | {{- end }} 180 | 181 | {{/* 182 | Return service account annotations of ClickHouse instance. 183 | */}} 184 | {{- define "clickhouse.serviceAccountAnnotations" -}} 185 | {{- $annotations := dict }} 186 | {{- if .Values.serviceAccount.create }} 187 | {{- $annotations = merge $annotations .Values.serviceAccount.annotations }} 188 | {{- end }} 189 | {{- if and .Values.coldStorage.enabled .Values.coldStorage.role.enabled }} 190 | {{- $annotations = merge $annotations .Values.coldStorage.role.annotations }} 191 | {{- end -}} 192 | annotations: 193 | {{- toYaml $annotations | nindent 2 }} 194 | {{- end }} 195 | 196 | {{/* 197 | Create a default fully qualified app name for clickhouseOperator. 198 | */}} 199 | {{- define "clickhouseOperator.fullname" -}} 200 | {{- printf "%s-%s" (include "clickhouse.fullname" .) .Values.clickhouseOperator.name | trunc 63 | trimSuffix "-" -}} 201 | {{- end -}} 202 | 203 | {{/* 204 | Return namespace of clickhouse 205 | */}} 206 | {{- define "clickhouse.namespace" -}} 207 | {{- default .Release.Namespace .Values.namespace -}} 208 | {{- end -}} 209 | 210 | {{/* 211 | Return list of files and contents. 212 | */}} 213 | {{- define "clickhouse.files" -}} 214 | {{- range $key,$value := .Values.files }} 215 | {{ $key }}: {{ $value | toYaml }} 216 | {{- end }} 217 | {{- end }} 218 | 219 | {{/* 220 | Common labels 221 | */}} 222 | {{- define "clickhouseOperator.labels" -}} 223 | helm.sh/chart: {{ include "clickhouse.chart" . }} 224 | {{ include "clickhouseOperator.selectorLabels" . }} 225 | {{- if .Chart.AppVersion }} 226 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 227 | {{- end }} 228 | app.kubernetes.io/managed-by: {{ .Release.Service }} 229 | clickhouse.altinity.com/chop: {{ .Values.clickhouseOperator.version }} 230 | {{- end -}} 231 | 232 | {{/* 233 | Selector labels 234 | */}} 235 | {{- define "clickhouseOperator.selectorLabels" -}} 236 | app.kubernetes.io/name: {{ include "clickhouse.name" . }} 237 | app.kubernetes.io/instance: {{ .Release.Name }} 238 | app.kubernetes.io/component: {{ .Values.clickhouseOperator.name }} 239 | {{- end -}} 240 | 241 | {{/* 242 | Return the proper clickhouseOperator image name 243 | */}} 244 | {{- define "clickhouseOperator.image" -}} 245 | {{- $registryName := default .Values.clickhouseOperator.image.registry .Values.global.imageRegistry -}} 246 | {{- $repositoryName := .Values.clickhouseOperator.image.repository -}} 247 | {{- $tag := default .Values.clickhouseOperator.version .Values.clickhouseOperator.image.tag | toString -}} 248 | {{- if $registryName -}} 249 | {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} 250 | {{- else -}} 251 | {{- printf "%s:%s" $repositoryName $tag -}} 252 | {{- end -}} 253 | {{- end -}} 254 | 255 | {{/* 256 | Create the name of the service account to use 257 | */}} 258 | {{- define "clickhouseOperator.serviceAccountName" -}} 259 | {{- if .Values.clickhouseOperator.serviceAccount.create -}} 260 | {{ default (include "clickhouseOperator.fullname" .) .Values.clickhouseOperator.serviceAccount.name }} 261 | {{- else -}} 262 | {{ default "default" .Values.clickhouseOperator.serviceAccount.name }} 263 | {{- end -}} 264 | {{- end -}} 265 | 266 | {{/* 267 | Return the proper Image Registry Secret Names. 268 | */}} 269 | {{- define "clickhouseOperator.imagePullSecrets" -}} 270 | {{- if or .Values.global.imagePullSecrets .Values.clickhouseOperator.imagePullSecrets }} 271 | imagePullSecrets: 272 | {{- range .Values.global.imagePullSecrets }} 273 | - name: {{ . }} 274 | {{- end }} 275 | {{- range .Values.clickhouseOperator.imagePullSecrets }} 276 | - name: {{ . }} 277 | {{- end }} 278 | {{- end }} 279 | {{- end }} 280 | 281 | {{/* 282 | Create a default fully qualified app name for metricsExporter. 283 | */}} 284 | {{- define "metricsExporter.fullname" -}} 285 | {{- printf "%s-%s" (include "clickhouse.fullname" .) .Values.clickhouseOperator.metricsExporter.name | trunc 63 | trimSuffix "-" -}} 286 | {{- end -}} 287 | 288 | {{/* 289 | Return the proper metricsExporter image name 290 | */}} 291 | {{- define "metricsExporter.image" -}} 292 | {{- $registryName := default .Values.clickhouseOperator.metricsExporter.image.registry .Values.global.imageRegistry -}} 293 | {{- $repositoryName := .Values.clickhouseOperator.metricsExporter.image.repository -}} 294 | {{- $tag := default .Values.clickhouseOperator.version .Values.clickhouseOperator.metricsExporter.image.tag | toString -}} 295 | {{- if $registryName -}} 296 | {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} 297 | {{- else -}} 298 | {{- printf "%s:%s" $repositoryName $tag -}} 299 | {{- end -}} 300 | {{- end -}} 301 | 302 | {{/* 303 | Return common environment variables for ClickHouse Operator 304 | */}} 305 | {{- define "clickhouseOperator.commonEnv" -}} 306 | # Pod-specific 307 | # spec.nodeName: ip-172-20-52-62.ec2.internal 308 | - name: OPERATOR_POD_NODE_NAME 309 | valueFrom: 310 | fieldRef: 311 | fieldPath: spec.nodeName 312 | # metadata.name: clickhouse-operator-6f87589dbb-ftcsf 313 | - name: OPERATOR_POD_NAME 314 | valueFrom: 315 | fieldRef: 316 | fieldPath: metadata.name 317 | # metadata.namespace: kube-system 318 | - name: OPERATOR_POD_NAMESPACE 319 | valueFrom: 320 | fieldRef: 321 | fieldPath: metadata.namespace 322 | # status.podIP: 100.96.3.2 323 | - name: OPERATOR_POD_IP 324 | valueFrom: 325 | fieldRef: 326 | fieldPath: status.podIP 327 | # spec.serviceAccount: {{ include "clickhouseOperator.fullname" . }} 328 | # spec.serviceAccountName: {{ include "clickhouseOperator.fullname" . }} 329 | - name: OPERATOR_POD_SERVICE_ACCOUNT 330 | valueFrom: 331 | fieldRef: 332 | fieldPath: spec.serviceAccountName 333 | 334 | # Container-specific 335 | - name: OPERATOR_CONTAINER_CPU_REQUEST 336 | valueFrom: 337 | resourceFieldRef: 338 | containerName: operator 339 | resource: requests.cpu 340 | - name: OPERATOR_CONTAINER_CPU_LIMIT 341 | valueFrom: 342 | resourceFieldRef: 343 | containerName: operator 344 | resource: limits.cpu 345 | - name: OPERATOR_CONTAINER_MEM_REQUEST 346 | valueFrom: 347 | resourceFieldRef: 348 | containerName: operator 349 | resource: requests.memory 350 | - name: OPERATOR_CONTAINER_MEM_LIMIT 351 | valueFrom: 352 | resourceFieldRef: 353 | containerName: operator 354 | resource: limits.memory 355 | {{- end }} 356 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-instance/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ include "clickhouse.fullname" . }}-custom-functions 5 | namespace: {{ .Values.namespace | default .Release.Namespace }} 6 | labels: 7 | {{- include "clickhouse.labels" . | nindent 4 }} 8 | data: 9 | custom-functions.xml: | 10 | 11 | 12 | executable 13 | histogramQuantile 14 | Float64 15 | 16 | Array(Float64) 17 | buckets 18 | 19 | 20 | Array(Float64) 21 | counts 22 | 23 | 24 | Float64 25 | quantile 26 | 27 | CSV 28 | ./histogramQuantile 29 | 30 | 31 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-instance/exporter-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.logs.system.enabled }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ include "clickhouse.fullname" . }}-logs-system-config 6 | namespace: {{ .Values.namespace | default .Release.Namespace }} 7 | labels: 8 | {{- include "clickhouse.labels" . | nindent 4 }} 9 | data: 10 | config.yaml: |- 11 | {{- toYaml .Values.logs.system.config | nindent 4 }} 12 | {{- end }} -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-instance/scripts-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ include "clickhouse.fullname" . }}-scripts 5 | namespace: {{ .Values.namespace | default .Release.Namespace }} 6 | labels: 7 | {{- include "clickhouse.labels" . | nindent 4 }} 8 | data: 9 | wait-until-ready.sh: | 10 | #!/bin/bash 11 | 12 | # Delay between attempts in seconds 13 | DELAY=10 14 | # Default host and port 15 | HOST="localhost" 16 | PORT="8123" 17 | 18 | echo "Waiting for Clickhouse to become ready..." 19 | 20 | while true; do 21 | response=$(wget --spider -S "http://${HOST}:${PORT}/ping" 2>&1) 22 | exit_code=$? 23 | 24 | if [ $exit_code -eq 0 ]; then 25 | echo "Clickhouse is ready!" 26 | exit 0 27 | else 28 | echo "Clickhouse is not ready yet. Retrying in ${DELAY} seconds..." 29 | sleep $DELAY 30 | fi 31 | done 32 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-instance/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if or .Values.coldStorage.role.enabled .Values.serviceAccount.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "clickhouse.serviceAccountName" . }} 6 | namespace: {{ include "clickhouse.namespace" . }} 7 | labels: 8 | {{- include "clickhouse.labels" . | nindent 4 }} 9 | {{- include "clickhouse.serviceAccountAnnotations" . | nindent 2 }} 10 | {{- include "clickhouse.imagePullSecrets" . }} 11 | {{- end }} 12 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-instance/storage-class.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.installCustomStorageClass -}} 2 | 3 | {{- if hasPrefix "gcp" .Values.global.cloud -}} 4 | # 5 | # GCP resizable storage class 6 | # 7 | apiVersion: storage.k8s.io/v1 8 | kind: StorageClass 9 | metadata: 10 | name: gce-resizable 11 | provisioner: kubernetes.io/gce-pd 12 | parameters: 13 | type: pd-standard 14 | fstype: ext4 15 | replication-type: none 16 | reclaimPolicy: Retain 17 | allowVolumeExpansion: true 18 | 19 | {{- else if hasPrefix "aws" .Values.global.cloud -}} 20 | # 21 | # AWS resizable storage class 22 | # 23 | apiVersion: storage.k8s.io/v1 24 | kind: StorageClass 25 | metadata: 26 | name: gp2-resizable 27 | provisioner: kubernetes.io/aws-ebs 28 | parameters: 29 | type: gp2 30 | reclaimPolicy: Retain 31 | allowVolumeExpansion: true 32 | {{- end -}} 33 | {{- end }} 34 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/configmaps/etc-confd-files.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ include "clickhouseOperator.fullname" . }}-etc-confd-files 5 | namespace: {{ .Values.namespace | default .Release.Namespace }} 6 | labels: 7 | {{- include "clickhouseOperator.labels" . | nindent 4 }} 8 | data: {{ tpl (toYaml .Values.clickhouseOperator.configs.confdFiles) . | nindent 2 }} 9 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/configmaps/etc-configd-files.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ include "clickhouseOperator.fullname" . }}-etc-configd-files 5 | namespace: {{ .Values.namespace | default .Release.Namespace }} 6 | labels: 7 | {{- include "clickhouseOperator.labels" . | nindent 4 }} 8 | data: 9 | 01-clickhouse-01-listen.xml: | 10 | 11 | 12 | :: 13 | 0.0.0.0 14 | 1 15 | 16 | 01-clickhouse-02-logger.xml: | 17 | 18 | 19 | {{- with .Values.clickhouseOperator.logger }} 20 | 21 | {{ .level }} 22 | 23 | json 24 | 25 | /var/log/clickhouse-server/clickhouse-server.log 26 | /var/log/clickhouse-server/clickhouse-server.err.log 27 | {{ .size }} 28 | {{ .count }} 29 | 30 | {{ .console }} 31 | {{- end }} 32 | 33 | 34 | 01-clickhouse-03-query_log.xml: | 35 | 36 | 37 | system 38 | query_log
39 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.queryLog.ttl }} day 40 | {{ .Values.clickhouseOperator.queryLog.flushInterval }} 41 |
42 |
43 | 01-clickhouse-04-part_log.xml: | 44 | 45 | 46 | system 47 | part_log
48 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.partLog.ttl }} day 49 | {{ .Values.clickhouseOperator.partLog.flushInterval }} 50 |
51 |
52 | 01-clickhouse-05-trace_log.xml: |- 53 | 54 | 55 | system 56 | trace_log
57 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.traceLog.ttl }} day 58 | {{ .Values.clickhouseOperator.traceLog.flushInterval }} 59 |
60 |
61 | 62 | 01-clickhouse-06-asynchronous_insert_log.xml: | 63 | 64 | 65 | system 66 | asynchronous_insert_log
67 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.asynchronousInsertLog.ttl }} day 68 | {{ .Values.clickhouseOperator.asynchronousInsertLog.flushInterval }} 69 |
70 |
71 | 01-clickhouse-07-asynchronous_metric_log.xml: | 72 | 73 | 74 | system 75 | asynchronous_metric_log
76 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.asynchronousMetricLog.ttl }} day 77 | {{ .Values.clickhouseOperator.asynchronousMetricLog.flushInterval }} 78 |
79 |
80 | 01-clickhouse-08-backup_log.xml: | 81 | 82 | 83 | system 84 | backup_log
85 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.backupLog.ttl }} day 86 | {{ .Values.clickhouseOperator.backupLog.flushInterval }} 87 |
88 |
89 | 01-clickhouse-09-blob_storage_log.xml: | 90 | 91 | 92 | system 93 | blob_storage_log
94 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.blobStorageLog.ttl }} day 95 | {{ .Values.clickhouseOperator.blobStorageLog.flushInterval }} 96 |
97 |
98 | 01-clickhouse-10-crash_log.xml: | 99 | 100 | 101 | system 102 | crash_log
103 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.crashLog.ttl }} day 104 | {{ .Values.clickhouseOperator.crashLog.flushInterval }} 105 |
106 |
107 | 01-clickhouse-11-metric_log.xml: | 108 | 109 | 110 | system 111 | metric_log
112 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.metricLog.ttl }} day 113 | {{ .Values.clickhouseOperator.metricLog.flushInterval }} 114 |
115 |
116 | 01-clickhouse-12-query_thread_log.xml: | 117 | 118 | 119 | system 120 | query_thread_log
121 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.queryThreadLog.ttl }} day 122 | {{ .Values.clickhouseOperator.queryThreadLog.flushInterval }} 123 |
124 |
125 | 01-clickhouse-13-query_views_log.xml: | 126 | 127 | 128 | system 129 | query_views_log
130 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.queryViewsLog.ttl }} day 131 | {{ .Values.clickhouseOperator.queryViewsLog.flushInterval }} 132 |
133 |
134 | 01-clickhouse-14-session_log.xml: | 135 | 136 | 137 | system 138 | session_log
139 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.sessionLog.ttl }} day 140 | {{ .Values.clickhouseOperator.sessionLog.flushInterval }} 141 |
142 |
143 | 01-clickhouse-15-zookeeper_log.xml: | 144 | 145 | 146 | system 147 | zookeeper_log
148 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.zookeeperLog.ttl }} day 149 | {{ .Values.clickhouseOperator.zookeeperLog.flushInterval }} 150 |
151 |
152 | 01-clickhouse-16-processors_profile_log.xml: | 153 | 154 | 155 | system 156 | processors_profile_log
157 | Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval {{ .Values.clickhouseOperator.processorsProfileLog.ttl }} day 158 | {{ .Values.clickhouseOperator.processorsProfileLog.flushInterval }} 159 |
160 |
161 | 162 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/configmaps/etc-templatesd-files.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ include "clickhouseOperator.fullname" . }}-etc-templatesd-files 5 | namespace: {{ .Values.namespace | default .Release.Namespace }} 6 | labels: 7 | {{- include "clickhouseOperator.labels" . | nindent 4 }} 8 | data: 9 | 001-templates.json.example: | 10 | { 11 | "apiVersion": "clickhouse.altinity.com/v1", 12 | "kind": "ClickHouseInstallationTemplate", 13 | "metadata": { 14 | "name": "01-default-volumeclaimtemplate" 15 | }, 16 | "spec": { 17 | "templates": { 18 | "volumeClaimTemplates": [ 19 | { 20 | "name": "chi-default-volume-claim-template", 21 | "spec": { 22 | "accessModes": [ 23 | "ReadWriteOnce" 24 | ], 25 | "resources": { 26 | "requests": { 27 | "storage": "2Gi" 28 | } 29 | } 30 | } 31 | } 32 | ], 33 | "podTemplates": [ 34 | { 35 | "name": "chi-default-oneperhost-pod-template", 36 | "distribution": "OnePerHost", 37 | "spec": { 38 | "containers" : [ 39 | { 40 | "name": "clickhouse", 41 | "image": "clickhouse/clickhouse-server:22.3", 42 | "ports": [ 43 | { 44 | "name": "http", 45 | "containerPort": 8123 46 | }, 47 | { 48 | "name": "client", 49 | "containerPort": 9000 50 | }, 51 | { 52 | "name": "interserver", 53 | "containerPort": 9009 54 | } 55 | ] 56 | } 57 | ] 58 | } 59 | } 60 | ] 61 | } 62 | } 63 | } 64 | default-pod-template.yaml.example: | 65 | apiVersion: "clickhouse.altinity.com/v1" 66 | kind: "ClickHouseInstallationTemplate" 67 | metadata: 68 | name: "default-oneperhost-pod-template" 69 | spec: 70 | templates: 71 | podTemplates: 72 | - name: default-oneperhost-pod-template 73 | distribution: "OnePerHost" 74 | default-storage-template.yaml.example: | 75 | apiVersion: "clickhouse.altinity.com/v1" 76 | kind: "ClickHouseInstallationTemplate" 77 | metadata: 78 | name: "default-storage-template-2Gi" 79 | spec: 80 | templates: 81 | volumeClaimTemplates: 82 | - name: default-storage-template-2Gi 83 | spec: 84 | accessModes: 85 | - ReadWriteOnce 86 | resources: 87 | requests: 88 | storage: 2Gi 89 | readme: |- 90 | Templates in this folder are packaged with an operator and available via 'useTemplate' 91 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/configmaps/etc-usersd-files.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ include "clickhouseOperator.fullname" . }}-etc-usersd-files 5 | namespace: {{ .Values.namespace | default .Release.Namespace }} 6 | labels: 7 | {{- include "clickhouseOperator.labels" . | nindent 4 }} 8 | data: 9 | 01-clickhouse-user.xml: | 10 | 11 | 12 | 13 | 14 | 127.0.0.1 15 | 16 | {{ .Values.clickhouseOperator.secret.password | sha256sum }} 17 | {{ .Values.clickhouseOperator.secret.username }} 18 | default 19 | 20 | 21 | 22 | 23 | 0 24 | 1 25 | 10 26 | 27 | 28 | 29 | 02-clickhouse-default-profile.xml: | 30 | 31 | 32 | 33 | 1 34 | 1000 35 | 1 36 | 1 37 | 38 | 39 | 40 | 03-database-ordinary.xml: | 41 | 42 | 43 | 44 | Ordinary 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/deployment.yaml: -------------------------------------------------------------------------------- 1 | kind: Deployment 2 | apiVersion: apps/v1 3 | metadata: 4 | name: {{ include "clickhouseOperator.fullname" . }} 5 | namespace: {{ include "clickhouse.namespace" . }} 6 | labels: 7 | {{- include "clickhouseOperator.labels" . | nindent 4 }} 8 | {{- if .Values.clickhouseOperator.labels }} 9 | {{- toYaml .Values.clickhouseOperator.labels | nindent 4 }} 10 | {{- end }} 11 | {{- if .Values.clickhouseOperator.annotations }} 12 | annotations: 13 | {{- toYaml .Values.clickhouseOperator.annotations | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | replicas: 1 17 | selector: 18 | matchLabels: 19 | {{- include "clickhouseOperator.selectorLabels" . | nindent 6 }} 20 | template: 21 | metadata: 22 | annotations: 23 | {{- with .Values.clickhouseOperator.podAnnotations }} 24 | {{- toYaml . | nindent 8 }} 25 | {{- end }} 26 | checksum/files: {{ include (print $.Template.BasePath "/clickhouse-operator/configmaps/etc-files.yaml") . | sha256sum }} 27 | checksum/confd-files: {{ include (print $.Template.BasePath "/clickhouse-operator/configmaps/etc-confd-files.yaml") . | sha256sum }} 28 | checksum/configd-files: {{ include (print $.Template.BasePath "/clickhouse-operator/configmaps/etc-configd-files.yaml") . | sha256sum }} 29 | checksum/templatesd-files: {{ include (print $.Template.BasePath "/clickhouse-operator/configmaps/etc-templatesd-files.yaml") . | sha256sum }} 30 | checksum/usersd-files: {{ include (print $.Template.BasePath "/clickhouse-operator/configmaps/etc-usersd-files.yaml") . | sha256sum }} 31 | labels: 32 | {{- include "clickhouseOperator.selectorLabels" . | nindent 8 }} 33 | {{- if .Values.clickhouseOperator.podLabels }} 34 | {{- toYaml .Values.clickhouseOperator.podLabels | nindent 8 }} 35 | {{- end }} 36 | spec: 37 | {{- include "clickhouseOperator.imagePullSecrets" . | indent 6 }} 38 | serviceAccountName: {{ include "clickhouseOperator.serviceAccountName" . }} 39 | priorityClassName: {{ .Values.clickhouseOperator.priorityClassName | quote }} 40 | {{- with .Values.clickhouseOperator.nodeSelector }} 41 | nodeSelector: 42 | {{- toYaml . | nindent 8 }} 43 | {{- end }} 44 | {{- with .Values.clickhouseOperator.affinity }} 45 | affinity: 46 | {{- toYaml . | nindent 8 }} 47 | {{- end }} 48 | {{- with .Values.clickhouseOperator.tolerations }} 49 | tolerations: 50 | {{- toYaml . | nindent 8 }} 51 | {{- end }} 52 | {{- with .Values.clickhouseOperator.topologySpreadConstraints }} 53 | topologySpreadConstraints: {{ toYaml . | nindent 8 }} 54 | {{- end }} 55 | securityContext: 56 | {{- toYaml .Values.clickhouseOperator.podSecurityContext | nindent 8 }} 57 | volumes: 58 | - name: etc-clickhouse-operator-folder 59 | configMap: 60 | name: {{ include "clickhouseOperator.fullname" . }}-etc-files 61 | - name: etc-clickhouse-operator-confd-folder 62 | configMap: 63 | name: {{ include "clickhouseOperator.fullname" . }}-etc-confd-files 64 | - name: etc-clickhouse-operator-configd-folder 65 | configMap: 66 | name: {{ include "clickhouseOperator.fullname" . }}-etc-configd-files 67 | - name: etc-clickhouse-operator-templatesd-folder 68 | configMap: 69 | name: {{ include "clickhouseOperator.fullname" . }}-etc-templatesd-files 70 | - name: etc-clickhouse-operator-usersd-folder 71 | configMap: 72 | name: {{ include "clickhouseOperator.fullname" . }}-etc-usersd-files 73 | containers: 74 | - name: operator 75 | image: {{ template "clickhouseOperator.image" . }} 76 | imagePullPolicy: {{ .Values.clickhouseOperator.image.pullPolicy }} 77 | volumeMounts: 78 | - name: etc-clickhouse-operator-folder 79 | mountPath: /etc/clickhouse-operator 80 | - name: etc-clickhouse-operator-confd-folder 81 | mountPath: /etc/clickhouse-operator/conf.d 82 | - name: etc-clickhouse-operator-configd-folder 83 | mountPath: /etc/clickhouse-operator/config.d 84 | - name: etc-clickhouse-operator-templatesd-folder 85 | mountPath: /etc/clickhouse-operator/templates.d 86 | - name: etc-clickhouse-operator-usersd-folder 87 | mountPath: /etc/clickhouse-operator/users.d 88 | env: 89 | {{- include "clickhouseOperator.commonEnv" . | nindent 12 }} 90 | {{- with .Values.clickhouseOperator.env }} 91 | {{- toYaml . | nindent 12 }} 92 | {{- end }} 93 | resources: 94 | {{- toYaml .Values.clickhouseOperator.resources | nindent 12 }} 95 | 96 | - name: metrics-exporter 97 | image: {{ include "metricsExporter.image" . }} 98 | imagePullPolicy: {{ .Values.clickhouseOperator.metricsExporter.image.pullPolicy }} 99 | volumeMounts: 100 | - name: etc-clickhouse-operator-folder 101 | mountPath: /etc/clickhouse-operator 102 | - name: etc-clickhouse-operator-confd-folder 103 | mountPath: /etc/clickhouse-operator/conf.d 104 | - name: etc-clickhouse-operator-configd-folder 105 | mountPath: /etc/clickhouse-operator/config.d 106 | - name: etc-clickhouse-operator-templatesd-folder 107 | mountPath: /etc/clickhouse-operator/templates.d 108 | - name: etc-clickhouse-operator-usersd-folder 109 | mountPath: /etc/clickhouse-operator/users.d 110 | env: 111 | {{- include "clickhouseOperator.commonEnv" . | nindent 12 }} 112 | {{- with .Values.clickhouseOperator.metricsExporter.env }} 113 | {{- toYaml . | nindent 12 }} 114 | {{- end }} 115 | ports: 116 | - containerPort: {{ .Values.clickhouseOperator.metricsExporter.service.port }} 117 | name: metrics 118 | resources: 119 | {{- toYaml .Values.clickhouseOperator.metricsExporter.resources | nindent 12 }} 120 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/namespace.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.namespace (ne .Values.namespace .Release.Namespace) }} 2 | apiVersion: v1 3 | kind: Namespace 4 | metadata: 5 | name: {{ include "clickhouse.namespace" . }} 6 | {{- end }} 7 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | name: {{ include "clickhouseOperator.fullname" . }} 5 | namespace: {{ include "clickhouse.namespace" . }} 6 | labels: 7 | {{- include "clickhouseOperator.labels" . | nindent 4 }} 8 | rules: 9 | - apiGroups: 10 | - "" 11 | resources: 12 | - configmaps 13 | - services 14 | - persistentvolumeclaims 15 | - secrets 16 | verbs: 17 | - get 18 | - list 19 | - patch 20 | - update 21 | - watch 22 | - create 23 | - delete 24 | - apiGroups: 25 | - "" 26 | resources: 27 | - endpoints 28 | verbs: 29 | - get 30 | - list 31 | - watch 32 | - apiGroups: 33 | - "" 34 | resources: 35 | - events 36 | verbs: 37 | - create 38 | - apiGroups: 39 | - "" 40 | resources: 41 | - persistentvolumes 42 | - pods 43 | verbs: 44 | - get 45 | - list 46 | - patch 47 | - update 48 | - watch 49 | - apiGroups: 50 | - apps 51 | resources: 52 | - statefulsets 53 | verbs: 54 | - get 55 | - list 56 | - patch 57 | - update 58 | - watch 59 | - create 60 | - delete 61 | - apiGroups: 62 | - apps 63 | resources: 64 | - replicasets 65 | verbs: 66 | - get 67 | - patch 68 | - update 69 | - delete 70 | - apiGroups: 71 | - apps 72 | resourceNames: 73 | - {{ include "clickhouseOperator.fullname" . }} 74 | resources: 75 | - deployments 76 | verbs: 77 | - get 78 | - patch 79 | - update 80 | - delete 81 | - apiGroups: 82 | - policy 83 | resources: 84 | - poddisruptionbudgets 85 | verbs: 86 | - get 87 | - list 88 | - patch 89 | - update 90 | - watch 91 | - create 92 | - delete 93 | - apiGroups: 94 | - clickhouse.altinity.com 95 | resources: 96 | - clickhouseinstallations 97 | verbs: 98 | - get 99 | - patch 100 | - update 101 | - delete 102 | - apiGroups: 103 | - clickhouse.altinity.com 104 | resources: 105 | - clickhouseinstallations 106 | - clickhouseinstallationtemplates 107 | - clickhouseoperatorconfigurations 108 | verbs: 109 | - get 110 | - list 111 | - watch 112 | - apiGroups: 113 | - clickhouse.altinity.com 114 | resources: 115 | - clickhouseinstallations/finalizers 116 | - clickhouseinstallationtemplates/finalizers 117 | - clickhouseoperatorconfigurations/finalizers 118 | verbs: 119 | - update 120 | - apiGroups: 121 | - clickhouse.altinity.com 122 | resources: 123 | - clickhouseinstallations/status 124 | - clickhouseinstallationtemplates/status 125 | - clickhouseoperatorconfigurations/status 126 | verbs: 127 | - get 128 | - update 129 | - patch 130 | - create 131 | - delete 132 | - apiGroups: 133 | - "" 134 | resources: 135 | - secrets 136 | verbs: 137 | - get 138 | - list 139 | - apiGroups: 140 | - apiextensions.k8s.io 141 | resources: 142 | - customresourcedefinitions 143 | verbs: 144 | - get 145 | - list 146 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/rolebinding.yaml: -------------------------------------------------------------------------------- 1 | # Setup RoleBinding between Role and ServiceAccount. 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: RoleBinding 4 | metadata: 5 | name: {{ include "clickhouseOperator.fullname" . }} 6 | namespace: {{ include "clickhouse.namespace" . }} 7 | labels: 8 | {{- include "clickhouseOperator.labels" . | nindent 4 }} 9 | roleRef: 10 | apiGroup: rbac.authorization.k8s.io 11 | kind: Role 12 | name: {{ include "clickhouseOperator.fullname" . }} 13 | subjects: 14 | - kind: ServiceAccount 15 | {{- if .Values.clickhouseOperator.serviceAccount.create }} 16 | name: {{ include "clickhouseOperator.fullname" . }} 17 | {{- else }} 18 | name: {{ .Values.clickhouseOperator.serviceAccount.name }} 19 | {{- end }} 20 | namespace: {{ include "clickhouse.namespace" . }} 21 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.clickhouseOperator.secret.create -}} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: {{ include "clickhouseOperator.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: {{ include "clickhouseOperator.labels" . | nindent 4 }} 8 | type: Opaque 9 | data: 10 | username: {{ .Values.clickhouseOperator.secret.username | b64enc }} 11 | password: {{ .Values.clickhouseOperator.secret.password | b64enc }} 12 | {{- end -}} 13 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/service.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: {{ include "clickhouseOperator.fullname" . }}-metrics 5 | namespace: {{ include "clickhouse.namespace" . }} 6 | labels: 7 | {{- include "clickhouseOperator.labels" . | nindent 4 }} 8 | {{- with .Values.clickhouseOperator.metricsExporter.service }} 9 | {{- if .annotations }} 10 | annotations: 11 | {{- toYaml .annotations | nindent 4 }} 12 | {{- end }} 13 | spec: 14 | type: {{ .type }} 15 | ports: 16 | - port: {{ .port }} 17 | name: {{ include "clickhouseOperator.fullname" $ }}-metrics 18 | selector: 19 | {{- include "clickhouseOperator.selectorLabels" $ | nindent 4 }} 20 | {{- end }} 21 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.clickhouseOperator.serviceAccount.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "clickhouseOperator.serviceAccountName" . }} 6 | namespace: {{ include "clickhouse.namespace" . }} 7 | labels: 8 | {{- include "clickhouseOperator.labels" . | nindent 4 }} 9 | {{- with .Values.clickhouseOperator.serviceAccount.annotations }} 10 | annotations: 11 | {{- toYaml . | nindent 4 }} 12 | {{- end }} 13 | {{- include "clickhouseOperator.imagePullSecrets" . }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /charts/clickhouse/templates/clickhouse-operator/servicemonitor.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.clickhouseOperator.serviceMonitor.enabled }} 2 | apiVersion: monitoring.coreos.com/v1 3 | kind: ServiceMonitor 4 | metadata: 5 | name: {{ include "clickhouseOperator.fullname" . }}-metrics 6 | namespace: {{ include "clickhouse.namespace" . }} 7 | labels: 8 | {{- include "clickhouseOperator.labels" . | nindent 4 }} 9 | {{- if .Values.clickhouseOperator.serviceMonitor.additionalLabels }} 10 | {{- toYaml .Values.clickhouseOperator.serviceMonitor.additionalLabels | nindent 4 }} 11 | {{- end }} 12 | spec: 13 | endpoints: 14 | - port: {{ include "clickhouseOperator.fullname" $ }}-metrics 15 | path: /metrics 16 | scheme: http 17 | honorLabels: true 18 | selector: 19 | matchLabels: 20 | {{- include "clickhouseOperator.selectorLabels" $ | nindent 6 }} 21 | {{- with .Values.clickhouseOperator.serviceMonitor.interval }} 22 | interval: {{ . }} 23 | {{- end }} 24 | {{- with .Values.clickhouseOperator.serviceMonitor.scrapeTimeout }} 25 | scrapeTimeout: {{ . }} 26 | {{- end }} 27 | {{- with .Values.clickhouseOperator.serviceMonitor.relabelings }} 28 | relabelings: 29 | {{- toYaml . | nindent 4 }} 30 | {{- end }} 31 | {{- with .Values.clickhouseOperator.serviceMonitor.metricRelabelings }} 32 | metricRelabelings: 33 | {{- toYaml . | nindent 4 }} 34 | {{- end }} 35 | {{- end }} 36 | -------------------------------------------------------------------------------- /charts/clickhouse/tests/clickhouse-instance_default_test.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json 2 | suite: clickhouse-instance_default_test.yaml 3 | templates: 4 | - templates/clickhouse-instance/clickhouse-instance.yaml 5 | release: 6 | name: clickhouse 7 | namespace: signoz 8 | tests: 9 | - it: should have format_schema_path setting 10 | asserts: 11 | - equal: 12 | path: spec.configuration.settings.format_schema_path 13 | value: "/etc/clickhouse-server/config.d/" 14 | - it: should have user_defined_executable_functions_config setting 15 | asserts: 16 | - equal: 17 | path: spec.configuration.settings.user_defined_executable_functions_config 18 | value: "/etc/clickhouse-server/functions/custom-functions.xml" 19 | - it: should have user_scripts_path setting 20 | asserts: 21 | - equal: 22 | path: spec.configuration.settings.user_scripts_path 23 | value: "/var/lib/clickhouse/user_scripts/" 24 | - it: should have allow_experimental_window_functions profile 25 | asserts: 26 | - equal: 27 | path: spec.configuration.profiles.default/allow_experimental_window_functions 28 | value: "1" 29 | - it: should have allow_nondeterministic_mutations profile 30 | asserts: 31 | - equal: 32 | path: spec.configuration.profiles.default/allow_nondeterministic_mutations 33 | value: "1" 34 | - it: should have events.proto file 35 | asserts: 36 | - exists: 37 | path: spec.configuration.files["events.proto"] 38 | - it: should have zookeeper nodes 39 | set: 40 | zookeeper.enabled: true 41 | asserts: 42 | - equal: 43 | path: spec.configuration.zookeeper.nodes[0].host 44 | value: "clickhouse-zookeeper-0.clickhouse-zookeeper-headless" 45 | - equal: 46 | path: spec.configuration.zookeeper.nodes[0].port 47 | value: 2181 48 | - it: should have histogramQuantile script in the first initContainer 49 | asserts: 50 | - equal: 51 | path: spec.templates.podTemplates[*].spec.initContainers[0].name 52 | value: "clickhouse-udf-init" 53 | -------------------------------------------------------------------------------- /charts/clickhouse/tests/clickhouse-instance_sidecar_test.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json 2 | suite: clickhouse-instance_sidecar_test.yaml 3 | templates: 4 | - templates/clickhouse-instance/clickhouse-instance.yaml 5 | release: 6 | name: clickhouse 7 | namespace: signoz 8 | tests: 9 | - it: There should be 1 extra container, for a total of 2. 10 | set: 11 | extraContainers: 12 | - name: clickhouse-backup 13 | image: altinity/clickhouse-backup:latest 14 | imagePullPolicy: Always 15 | args: 16 | - "server" 17 | ports: 18 | - name: backup-rest 19 | containerPort: 7171 20 | asserts: 21 | - lengthEqual: 22 | path: spec.templates.podTemplates[0].spec.containers 23 | count: 2 24 | - contains: 25 | any: true 26 | path: spec.templates.podTemplates[0].spec.containers 27 | content: 28 | name: clickhouse-backup 29 | image: altinity/clickhouse-backup:latest 30 | imagePullPolicy: Always 31 | args: 32 | - "server" 33 | ports: 34 | - name: backup-rest 35 | containerPort: 7171 36 | -------------------------------------------------------------------------------- /charts/clickhouse/tests/clickhouse-instance_volume_test.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json 2 | suite: clickhouse-instance_volume_test.yaml 3 | templates: 4 | - templates/clickhouse-instance/clickhouse-instance.yaml 5 | release: 6 | name: clickhouse 7 | namespace: signoz 8 | tests: 9 | - it: should have 3 volumes with persistence.enabled=true 10 | set: 11 | persistence: 12 | enabled: true 13 | size: 10Gi 14 | asserts: 15 | - contains: 16 | path: spec.templates.podTemplates[0].spec.volumes 17 | count: 1 18 | content: 19 | name: shared-binary-volume 20 | emptyDir: {} 21 | - contains: 22 | path: spec.templates.podTemplates[0].spec.volumes 23 | count: 1 24 | content: 25 | name: custom-functions-volume 26 | configMap: 27 | name: clickhouse-custom-functions 28 | - contains: 29 | path: spec.templates.podTemplates[0].spec.volumes 30 | count: 1 31 | content: 32 | name: scripts 33 | configMap: 34 | name: clickhouse-scripts 35 | - it: should have 3 volumes with persistence.enabled=false and templates.volumeClaimTemplates not empty 36 | set: 37 | persistence: 38 | enabled: false 39 | templates: 40 | volumeClaimTemplates: 41 | - name: does-not-matter 42 | resources: 43 | requests: 44 | storage: 1Gi 45 | asserts: 46 | - contains: 47 | path: spec.templates.podTemplates[0].spec.volumes 48 | count: 1 49 | content: 50 | name: shared-binary-volume 51 | emptyDir: {} 52 | - contains: 53 | path: spec.templates.podTemplates[0].spec.volumes 54 | count: 1 55 | content: 56 | name: custom-functions-volume 57 | configMap: 58 | name: clickhouse-custom-functions 59 | - contains: 60 | path: spec.templates.podTemplates[0].spec.volumes 61 | count: 1 62 | content: 63 | name: scripts 64 | configMap: 65 | name: clickhouse-scripts 66 | - it: should have data-volumeclaim-template when persistence.enabled=true 67 | set: 68 | persistence: 69 | enabled: true 70 | size: 10Gi 71 | asserts: 72 | - contains: 73 | path: spec.templates.volumeClaimTemplates 74 | count: 1 75 | content: 76 | name: data-volumeclaim-template 77 | reclaimPolicy: Retain 78 | spec: 79 | accessModes: 80 | - ReadWriteOnce 81 | resources: 82 | requests: 83 | storage: 10Gi 84 | - contains: 85 | path: spec.templates.podTemplates[0].spec.containers[0].volumeMounts 86 | count: 1 87 | content: 88 | name: data-volumeclaim-template 89 | mountPath: /var/lib/clickhouse 90 | - it: should have data-volumeclaim-template when persistence.enabled=true and templates.volumeClaimTemplates is not empty 91 | set: 92 | persistence: 93 | enabled: true 94 | size: 10Gi 95 | storageClass: storage-class 96 | templates: 97 | volumeClaimTemplates: 98 | - name: does-not-matter 99 | asserts: 100 | - contains: 101 | path: spec.templates.volumeClaimTemplates 102 | count: 1 103 | content: 104 | name: data-volumeclaim-template 105 | reclaimPolicy: Retain 106 | spec: 107 | accessModes: 108 | - ReadWriteOnce 109 | resources: 110 | requests: 111 | storage: 10Gi 112 | storageClassName: storage-class 113 | - contains: 114 | path: spec.templates.podTemplates[0].spec.containers[0].volumeMounts 115 | count: 1 116 | content: 117 | name: data-volumeclaim-template 118 | mountPath: /var/lib/clickhouse 119 | - it: should be same as persistence.enabled=false with templates.volumeClaimTemplates and additionalVolumeMounts 120 | set: 121 | persistence: 122 | enabled: false 123 | templates: 124 | volumeClaimTemplates: 125 | - name: data-volumeclaim-template 126 | accessModes: 127 | - ReadWriteOnce 128 | resources: 129 | requests: 130 | storage: 10Gi 131 | storageClassName: storage-class 132 | additionalVolumeMounts: 133 | - mountPath: /var/lib/clickhouse 134 | name: data-volumeclaim-template 135 | asserts: 136 | - contains: 137 | path: spec.templates.volumeClaimTemplates 138 | count: 1 139 | content: 140 | name: data-volumeclaim-template 141 | reclaimPolicy: Retain 142 | spec: 143 | accessModes: 144 | - ReadWriteOnce 145 | resources: 146 | requests: 147 | storage: 10Gi 148 | storageClassName: storage-class 149 | - contains: 150 | path: spec.templates.podTemplates[0].spec.containers[0].volumeMounts 151 | count: 1 152 | content: 153 | name: data-volumeclaim-template 154 | mountPath: /var/lib/clickhouse 155 | - notContains: 156 | path: spec.templates.podTemplates[0].spec.volumes 157 | content: 158 | name: data-volume 159 | - notContains: 160 | path: spec.templates.podTemplates[0].spec.containers[0].volumeMounts 161 | content: 162 | name: data-volume 163 | - it: should have multiple custom templates.volumeClaimTemplates 164 | set: 165 | persistence: 166 | enabled: false 167 | templates: 168 | volumeClaimTemplates: 169 | - name: default-0 170 | accessModes: 171 | - ReadWriteOnce 172 | resources: 173 | requests: 174 | storage: 10Gi 175 | storageClassName: storage-class-0 176 | - name: default-1 177 | accessModes: 178 | - ReadWriteOnce 179 | resources: 180 | requests: 181 | storage: 20Gi 182 | storageClassName: storage-class-1 183 | asserts: 184 | - contains: 185 | path: spec.templates.volumeClaimTemplates 186 | count: 1 187 | content: 188 | name: default-0 189 | reclaimPolicy: Retain 190 | spec: 191 | accessModes: 192 | - ReadWriteOnce 193 | resources: 194 | requests: 195 | storage: 10Gi 196 | storageClassName: storage-class-0 197 | - contains: 198 | path: spec.templates.volumeClaimTemplates 199 | count: 1 200 | content: 201 | name: default-1 202 | reclaimPolicy: Retain 203 | spec: 204 | accessModes: 205 | - ReadWriteOnce 206 | resources: 207 | requests: 208 | storage: 20Gi 209 | storageClassName: storage-class-1 210 | - notContains: 211 | path: spec.templates.podTemplates[0].spec.volumes 212 | content: 213 | name: data-volume 214 | - notContains: 215 | path: spec.templates.podTemplates[0].spec.containers[0].volumeMounts 216 | content: 217 | name: data-volume 218 | - it: should have empty dir when persistence.enabled=false and templates.volumeClaimTemplates is empty 219 | set: 220 | persistence: 221 | enabled: false 222 | templates: 223 | volumeClaimTemplates: [] 224 | asserts: 225 | - notExists: 226 | path: spec.templates.volumeClaimTemplates 227 | - contains: 228 | path: spec.templates.podTemplates[0].spec.volumes 229 | count: 1 230 | content: 231 | name: data-volume 232 | emptyDir: {} 233 | - contains: 234 | path: spec.templates.podTemplates[0].spec.containers[0].volumeMounts 235 | count: 1 236 | content: 237 | name: data-volume 238 | mountPath: /var/lib/clickhouse 239 | - it: should have configmap when logs.system.enabled=true 240 | set: 241 | logs: 242 | system: 243 | enabled: true 244 | asserts: 245 | - contains: 246 | path: spec.templates.podTemplates[0].spec.volumes 247 | count: 1 248 | content: 249 | name: logs-system-config 250 | configMap: 251 | name: clickhouse-logs-system-config 252 | - contains: 253 | path: spec.templates.podTemplates[0].spec.containers[1].volumeMounts 254 | count: 1 255 | content: 256 | name: logs-system-config 257 | mountPath: /conf 258 | -------------------------------------------------------------------------------- /charts/k8s-infra/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /charts/k8s-infra/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: k8s-infra 3 | description: Helm chart for collecting metrics and logs in K8s 4 | type: application 5 | version: 0.13.0 6 | appVersion: "0.109.0" 7 | home: https://signoz.io 8 | icon: https://signoz.io/img/SigNozLogo-orange.svg 9 | keywords: 10 | - SigNoz 11 | - OpenTelemetry 12 | - apm 13 | - monitoring 14 | - logs 15 | sources: 16 | - https://github.com/signoz/charts 17 | - https://github.com/open-telemetry/opentelemetry-collector-contrib 18 | maintainers: 19 | - name: SigNoz 20 | email: hello@signoz.io 21 | url: https://signoz.io 22 | - name: prashant-shahi 23 | email: prashant@signoz.io 24 | url: https://prashantshahi.dev 25 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | You have just deployed k8s-infra chart: 2 | 3 | - otel-agent version: '{{ .Values.otelAgent.image.tag }}' 4 | - otel-deployment version: '{{ .Values.otelDeployment.image.tag }}' 5 | 6 | {{- if not .Values.otelAgent.configMap.create }} 7 | [WARNING] otel-agent "configMap" will not be created and "otelAgent.config" will not take effect. 8 | {{ end }} 9 | 10 | {{- if not .Values.otelDeployment.configMap.create }} 11 | [WARNING] otel-deployment "configMap" will not be created and "otelDeployment.config" will not take effect. 12 | {{ end }} 13 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/apikey-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (not .Values.apiKeyExistingSecretName) .Values.signozApiKey }} 2 | apiVersion: v1 3 | kind: Secret 4 | type: Opaque 5 | metadata: 6 | name: {{ include "k8s-infra.fullname" . }}-apikey-secret 7 | namespace: {{ include "k8s-infra.namespace" . }} 8 | labels: 9 | {{- include "k8s-infra.labels" . | nindent 4 }} 10 | annotations: 11 | "helm.sh/hook": "pre-install,pre-upgrade" 12 | "helm.sh/hook-delete-policy": "before-hook-creation" 13 | data: 14 | signoz-apikey: {{ .Values.signozApiKey | b64enc | quote }} 15 | {{- end }} 16 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/apikey-self-telemetry-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (not .Values.presets.selfTelemetry.apiKeyExistingSecretName) .Values.presets.selfTelemetry.signozApiKey }} 2 | apiVersion: v1 3 | kind: Secret 4 | type: Opaque 5 | metadata: 6 | name: {{ include "k8s-infra.fullname" . }}-self-telemetry-apikey-secret 7 | namespace: {{ include "k8s-infra.namespace" . }} 8 | labels: 9 | {{- include "k8s-infra.labels" . | nindent 4 }} 10 | annotations: 11 | "helm.sh/hook": "pre-install,pre-upgrade" 12 | "helm.sh/hook-delete-policy": "before-hook-creation" 13 | data: 14 | signoz-apikey: {{ .Values.presets.selfTelemetry.signozApiKey | b64enc | quote }} 15 | {{- end }} 16 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/namespace.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.namespace (ne .Values.namespace .Release.Namespace) }} 2 | apiVersion: v1 3 | kind: Namespace 4 | metadata: 5 | name: {{ include "k8s-infra.namespace" . }} 6 | {{- end }} 7 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-agent/clusterrole.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.otelAgent.clusterRole.create .Values.otelAgent.enabled -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: {{ include "otelAgent.clusterRoleName" . }} 6 | namespace: {{ include "k8s-infra.namespace" . }} 7 | {{- with .Values.otelAgent.clusterRole.annotations }} 8 | annotations: 9 | {{- toYaml . | nindent 4 }} 10 | {{- end }} 11 | rules: 12 | {{ toYaml .Values.otelAgent.clusterRole.rules | nindent 2 -}} 13 | {{- end }} 14 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-agent/clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.otelAgent.clusterRole.create .Values.otelAgent.enabled -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRoleBinding 4 | metadata: 5 | name: {{ include "otelAgent.clusterRoleBindingName" . }} 6 | namespace: {{ include "k8s-infra.namespace" . }} 7 | roleRef: 8 | apiGroup: rbac.authorization.k8s.io 9 | kind: ClusterRole 10 | name: {{ include "otelAgent.clusterRoleName" . }} 11 | subjects: 12 | - name: {{ include "otelAgent.serviceAccountName" . }} 13 | kind: ServiceAccount 14 | namespace: {{ include "k8s-infra.namespace" . }} 15 | {{- end }} 16 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-agent/configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelAgent.enabled -}} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ include "otelAgent.fullname" . }} 6 | namespace: {{ include "k8s-infra.namespace" . }} 7 | labels: 8 | {{- include "otelAgent.labels" . | nindent 4 }} 9 | data: 10 | otel-agent-config.yaml: |- 11 | {{- include "otelAgent.config" . | nindent 4 }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-agent/daemonset.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelAgent.enabled -}} 2 | apiVersion: apps/v1 3 | kind: DaemonSet 4 | metadata: 5 | name: {{ include "otelAgent.fullname" . }} 6 | namespace: {{ include "k8s-infra.namespace" . }} 7 | labels: 8 | {{- include "otelAgent.labels" . | nindent 4 }} 9 | {{- if .Values.otelAgent.annotations }} 10 | annotations: 11 | {{ toYaml .Values.otelAgent.annotations | nindent 4 }} 12 | {{- end }} 13 | spec: 14 | selector: 15 | matchLabels: 16 | {{- include "otelAgent.selectorLabels" . | nindent 6 }} 17 | minReadySeconds: {{ .Values.otelAgent.minReadySeconds }} 18 | template: 19 | metadata: 20 | annotations: 21 | {{- with .Values.otelAgent.podAnnotations }} 22 | {{- toYaml . | nindent 8 }} 23 | {{- end }} 24 | checksum/config: {{ include (print $.Template.BasePath "/otel-agent/configmap.yaml") . | sha256sum }} 25 | labels: 26 | {{- include "otelAgent.selectorLabels" . | nindent 8 }} 27 | spec: 28 | {{- include "otelAgent.imagePullSecrets" . | indent 6 }} 29 | serviceAccountName: {{ include "otelAgent.serviceAccountName" . }} 30 | securityContext: 31 | {{- toYaml .Values.otelAgent.podSecurityContext | nindent 8 }} 32 | priorityClassName: {{ .Values.otelAgent.priorityClassName | quote }} 33 | {{- with .Values.otelAgent.nodeSelector }} 34 | nodeSelector: 35 | {{- toYaml . | nindent 8 }} 36 | {{- end }} 37 | {{- with .Values.otelAgent.affinity }} 38 | affinity: 39 | {{- toYaml . | nindent 8 }} 40 | {{- end }} 41 | {{- with .Values.otelAgent.tolerations }} 42 | tolerations: 43 | {{- toYaml . | nindent 8 }} 44 | {{- end }} 45 | volumes: 46 | - name: otel-agent-config-vol 47 | configMap: 48 | name: {{ include "otelAgent.fullname" . }} 49 | - name: varlog 50 | hostPath: 51 | path: /var/log 52 | {{- if ne .Values.global.cloud "gcp/autogke" }} 53 | - name: varlibdockercontainers 54 | hostPath: 55 | path: /var/lib/docker/containers 56 | {{- if eq .Values.presets.hostMetrics.enabled true }} 57 | - name: hostfs 58 | hostPath: 59 | path: / 60 | {{- end }} 61 | {{- end }} 62 | {{- if .Values.otelTlsSecrets.enabled }} 63 | - name: {{ include "k8s-infra.fullname" . }}-agent-secrets-vol 64 | secret: 65 | secretName: {{ include "k8s-infra.otelTlsSecretName" . }} 66 | items: 67 | - key: cert.pem 68 | path: cert.pem 69 | - key: key.pem 70 | path: key.pem 71 | {{- end }} 72 | {{- with .Values.otelAgent.extraVolumes }} 73 | {{- toYaml . | nindent 8 }} 74 | {{- end }} 75 | containers: 76 | - name: {{ include "otelAgent.fullname" . }} 77 | image: {{ include "otelAgent.image" . }} 78 | imagePullPolicy: {{ .Values.otelAgent.image.pullPolicy }} 79 | ports: 80 | {{- range $key, $port := .Values.otelAgent.ports }} 81 | {{- if $port.enabled }} 82 | - name: {{ $key }} 83 | containerPort: {{ $port.containerPort }} 84 | protocol: {{ $port.protocol }} 85 | {{- if and $port.hostPort (ne $.Values.global.cloud "gcp/autogke") }} 86 | hostPort: {{ $port.hostPort }} 87 | {{- end }} 88 | {{- end }} 89 | {{- end }} 90 | {{- with .Values.otelAgent.command.name }} 91 | command: 92 | - {{ . | quote }} 93 | {{- end }} 94 | args: 95 | {{- if .Values.otelAgent.configMap.create }} 96 | - "--config=/conf/otel-agent-config.yaml" 97 | {{- end }} 98 | {{- range .Values.otelAgent.command.extraArgs }} 99 | - {{ . | quote }} 100 | {{- end }} 101 | env: 102 | {{- include "snippet.otlp-env" . | nindent 12 }} 103 | {{- include "snippet.k8s-env" . | nindent 12 }} 104 | - name: SIGNOZ_COMPONENT 105 | value: {{ default "otel-agent" .Values.otelAgent.name }} 106 | - name: OTEL_RESOURCE_ATTRIBUTES 107 | {{- $attribs := "signoz.component=$(SIGNOZ_COMPONENT),k8s.cluster.name=$(K8S_CLUSTER_NAME),k8s.node.name=$(K8S_NODE_NAME),host.name=$(K8S_NODE_NAME)" }} 108 | {{- if .Values.presets.resourceDetection.envResourceAttributes }} 109 | {{- $attribs = printf "%s,%s" $attribs .Values.presets.resourceDetection.envResourceAttributes }} 110 | {{- end }} 111 | value: {{ $attribs | quote }} 112 | {{- include "renderAdditionalEnv" .Values.otelAgent.additionalEnvs | nindent 12 }} 113 | securityContext: 114 | {{- toYaml .Values.otelAgent.securityContext | nindent 12 }} 115 | volumeMounts: 116 | - name: otel-agent-config-vol 117 | mountPath: /conf 118 | - name: varlog 119 | mountPath: /var/log 120 | readOnly: true 121 | {{- if ne .Values.global.cloud "gcp/autogke" }} 122 | - name: varlibdockercontainers 123 | mountPath: /var/lib/docker/containers 124 | readOnly: true 125 | {{- if eq .Values.presets.hostMetrics.enabled true }} 126 | - name: hostfs 127 | mountPath: /hostfs 128 | readOnly: true 129 | mountPropagation: HostToContainer 130 | {{- end }} 131 | {{- end }} 132 | {{- if .Values.otelTlsSecrets.enabled }} 133 | - name: {{ include "k8s-infra.fullname" . }}-agent-secrets-vol 134 | mountPath: {{ default "/secrets" .Values.otelTlsSecrets.path }} 135 | {{- end }} 136 | {{- with .Values.otelAgent.extraVolumeMounts }} 137 | {{- toYaml . | nindent 12 }} 138 | {{- end }} 139 | {{- if .Values.otelAgent.livenessProbe.enabled }} 140 | livenessProbe: 141 | {{- with .Values.otelAgent.livenessProbe }} 142 | httpGet: 143 | port: {{ .port }} 144 | path: {{ .path }} 145 | initialDelaySeconds: {{ .initialDelaySeconds }} 146 | periodSeconds: {{ .periodSeconds }} 147 | timeoutSeconds: {{ .timeoutSeconds }} 148 | successThreshold: {{ .successThreshold }} 149 | failureThreshold: {{ .failureThreshold }} 150 | {{- end }} 151 | {{- else if .Values.otelAgent.customLivenessProbe }} 152 | livenessProbe: {{- toYaml .Values.otelAgent.customLivenessProbe | nindent 12 }} 153 | {{- end }} 154 | {{- if .Values.otelAgent.readinessProbe.enabled }} 155 | readinessProbe: 156 | {{- with .Values.otelAgent.readinessProbe }} 157 | httpGet: 158 | port: {{ .port }} 159 | path: {{ .path }} 160 | initialDelaySeconds: {{ .initialDelaySeconds }} 161 | periodSeconds: {{ .periodSeconds }} 162 | timeoutSeconds: {{ .timeoutSeconds }} 163 | successThreshold: {{ .successThreshold }} 164 | failureThreshold: {{ .failureThreshold }} 165 | {{- end }} 166 | {{- else if .Values.otelAgent.customReadinessProbe }} 167 | readinessProbe: {{- toYaml .Values.otelAgent.customReadinessProbe | nindent 12 }} 168 | {{- end }} 169 | resources: 170 | {{- toYaml .Values.otelAgent.resources | nindent 12 }} 171 | {{- end }} 172 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-agent/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.otelAgent.ingress.enabled .Values.otelAgent.enabled -}} 2 | {{- $fullName := include "otelAgent.fullname" . -}} 3 | {{- $ingressApiIsStable := eq (include "ingress.isStable" .) "true" -}} 4 | {{- $ingressSupportsPathType := eq (include "ingress.supportsPathType" .) "true" -}} 5 | {{- $ingressSupportsClassName := and .Values.otelAgent.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) -}} 6 | apiVersion: {{ include "ingress.apiVersion" . }} 7 | kind: Ingress 8 | metadata: 9 | name: {{ $fullName }} 10 | namespace: {{ include "k8s-infra.namespace" . }} 11 | labels: 12 | {{- include "otelAgent.labels" . | nindent 4 }} 13 | {{- with .Values.otelAgent.ingress.annotations }} 14 | annotations: 15 | {{- toYaml . | nindent 4 }} 16 | {{- end }} 17 | spec: 18 | {{- if $ingressSupportsClassName }} 19 | ingressClassName: {{ .Values.otelAgent.ingress.className }} 20 | {{- end }} 21 | {{- if .Values.otelAgent.ingress.tls }} 22 | tls: 23 | {{- range .Values.otelAgent.ingress.tls }} 24 | - hosts: 25 | {{- range .hosts }} 26 | - {{ . | quote }} 27 | {{- end }} 28 | secretName: {{ .secretName }} 29 | {{- end }} 30 | {{- end }} 31 | rules: 32 | {{- range .Values.otelAgent.ingress.hosts }} 33 | - host: {{ .host | quote }} 34 | http: 35 | paths: 36 | {{- range .paths }} 37 | - path: {{ .path }} 38 | {{- if $ingressSupportsPathType }} 39 | pathType: {{ .pathType }} 40 | {{- end }} 41 | backend: 42 | {{- if $ingressApiIsStable }} 43 | service: 44 | name: {{ $fullName }} 45 | port: 46 | number: {{ .port }} 47 | {{- else }} 48 | serviceName: {{ $fullName }} 49 | servicePort: {{ .port }} 50 | {{- end }} 51 | {{- end }} 52 | {{- end }} 53 | {{- end }} 54 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-agent/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelAgent.enabled -}} 2 | {{- $serviceSupportsTrafficPolicy := (semverCompare ">=1.26-0" .Capabilities.KubeVersion.GitVersion) -}} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "otelAgent.fullname" . }} 7 | namespace: {{ include "k8s-infra.namespace" . }} 8 | labels: 9 | {{- include "otelAgent.labels" . | nindent 4 }} 10 | {{- with .Values.otelAgent }} 11 | {{- if .service.annotations }} 12 | annotations: 13 | {{- toYaml .service.annotations | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | type: {{ .service.type }} 17 | ports: 18 | {{- include "otel.portsConfig" . | nindent 4 }} 19 | selector: 20 | {{- include "otelAgent.selectorLabels" $ | nindent 4 }} 21 | {{- if $serviceSupportsTrafficPolicy }} 22 | internalTrafficPolicy: {{ .service.internalTrafficPolicy }} 23 | {{- end }} 24 | {{- end }} 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-agent/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.otelAgent.serviceAccount.create .Values.otelAgent.enabled -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "otelAgent.serviceAccountName" . }} 6 | namespace: {{ include "k8s-infra.namespace" . }} 7 | labels: 8 | {{- include "otelAgent.labels" . | nindent 4 }} 9 | {{- with .Values.otelAgent.serviceAccount.annotations }} 10 | annotations: 11 | {{- toYaml . | nindent 4 }} 12 | {{- end }} 13 | {{- include "otelAgent.imagePullSecrets" . }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-agent/tests/test-connection.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelAgent.enabled -}} 2 | {{- $healthCheckPort := index .Values.otelAgent.ports "health-check" -}} 3 | apiVersion: v1 4 | kind: Pod 5 | metadata: 6 | name: "{{ include "otelAgent.fullname" . }}-test-connection" 7 | namespace: {{ include "k8s-infra.namespace" . }} 8 | annotations: 9 | "helm.sh/hook": test 10 | spec: 11 | containers: 12 | - name: wget 13 | image: {{ default "docker.io" .Values.global.imageRegistry }}/busybox:1.35 14 | command: ['wget'] 15 | args: ['{{ include "otelAgent.fullname" . }}:{{ $healthCheckPort.servicePort }}'] 16 | restartPolicy: Never 17 | {{- end -}} 18 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-deployment/clusterrole.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.otelDeployment.clusterRole.create .Values.otelDeployment.enabled -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: {{ include "otelDeployment.clusterRoleName" . }} 6 | namespace: {{ include "k8s-infra.namespace" . }} 7 | {{- with .Values.otelDeployment.clusterRole.annotations }} 8 | annotations: 9 | {{- toYaml . | nindent 4 }} 10 | {{- end }} 11 | rules: 12 | {{- toYaml .Values.otelDeployment.clusterRole.rules | nindent 2 }} 13 | {{- end }} 14 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-deployment/clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.otelDeployment.clusterRole.create .Values.otelDeployment.enabled -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRoleBinding 4 | metadata: 5 | name: {{ include "otelDeployment.clusterRoleBindingName" . }} 6 | namespace: {{ include "k8s-infra.namespace" . }} 7 | roleRef: 8 | apiGroup: rbac.authorization.k8s.io 9 | kind: ClusterRole 10 | name: {{ include "otelDeployment.clusterRoleName" . }} 11 | subjects: 12 | - name: {{ include "otelDeployment.serviceAccountName" . }} 13 | kind: ServiceAccount 14 | namespace: {{ include "k8s-infra.namespace" . }} 15 | {{- end }} 16 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-deployment/configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelDeployment.enabled -}} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ include "otelDeployment.fullname" . }} 6 | namespace: {{ include "k8s-infra.namespace" . }} 7 | labels: 8 | {{- include "otelDeployment.labels" . | nindent 4 }} 9 | data: 10 | otel-deployment-config.yaml: |- 11 | {{- include "otelDeployment.config" . | nindent 4 }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-deployment/deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelDeployment.enabled -}} 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: {{ include "otelDeployment.fullname" . }} 6 | namespace: {{ include "k8s-infra.namespace" . }} 7 | labels: 8 | {{- include "otelDeployment.labels" . | nindent 4 }} 9 | {{- if .Values.otelDeployment.annotations }} 10 | annotations: 11 | {{ toYaml .Values.otelDeployment.annotations | nindent 4 }} 12 | {{- end }} 13 | spec: 14 | selector: 15 | matchLabels: 16 | {{- include "otelDeployment.selectorLabels" . | nindent 6 }} 17 | minReadySeconds: {{ .Values.otelDeployment.minReadySeconds }} 18 | progressDeadlineSeconds: {{ .Values.otelDeployment.progressDeadlineSeconds }} 19 | replicas: {{ .Values.otelDeployment.replicaCount }} 20 | template: 21 | metadata: 22 | annotations: 23 | {{- with .Values.otelDeployment.podAnnotations }} 24 | {{- toYaml . | nindent 8 }} 25 | {{- end }} 26 | checksum/config: {{ include (print $.Template.BasePath "/otel-deployment/configmap.yaml") . | sha256sum }} 27 | labels: 28 | {{- include "otelDeployment.selectorLabels" . | nindent 8 }} 29 | spec: 30 | {{- include "otelDeployment.imagePullSecrets" . | indent 6 }} 31 | serviceAccountName: {{ include "otelDeployment.serviceAccountName" . }} 32 | securityContext: 33 | {{- toYaml .Values.otelDeployment.podSecurityContext | nindent 8 }} 34 | priorityClassName: {{ .Values.otelDeployment.priorityClassName | quote }} 35 | {{- with .Values.otelDeployment.nodeSelector }} 36 | nodeSelector: 37 | {{- toYaml . | nindent 8 }} 38 | {{- end }} 39 | {{- with .Values.otelDeployment.affinity }} 40 | affinity: 41 | {{- toYaml . | nindent 8 }} 42 | {{- end }} 43 | {{- with .Values.otelDeployment.tolerations }} 44 | tolerations: 45 | {{- toYaml . | nindent 8 }} 46 | {{- end }} 47 | {{- with .Values.otelDeployment.topologySpreadConstraints }} 48 | topologySpreadConstraints: 49 | {{- toYaml . | nindent 8 }} 50 | {{- end }} 51 | volumes: 52 | - name: otel-deployment-config-vol 53 | configMap: 54 | name: {{ include "otelDeployment.fullname" . }} 55 | {{- if .Values.otelTlsSecrets.enabled }} 56 | - name: {{ include "k8s-infra.fullname" . }}-deployment-secrets-vol 57 | secret: 58 | secretName: {{ include "k8s-infra.otelTlsSecretName" . }} 59 | items: 60 | - key: cert.pem 61 | path: cert.pem 62 | - key: key.pem 63 | path: key.pem 64 | {{- end }} 65 | {{- with .Values.otelDeployment.extraVolumes }} 66 | {{- toYaml . | nindent 8 }} 67 | {{- end }} 68 | containers: 69 | - name: {{ template "otelDeployment.fullname" . }} 70 | image: {{ template "otelDeployment.image" . }} 71 | imagePullPolicy: {{ .Values.otelDeployment.image.pullPolicy }} 72 | ports: 73 | {{- range $key, $port := .Values.otelDeployment.ports }} 74 | {{- if $port.enabled }} 75 | - name: {{ $key }} 76 | containerPort: {{ $port.containerPort }} 77 | protocol: {{ $port.protocol }} 78 | {{- end }} 79 | {{- end }} 80 | {{- with .Values.otelDeployment.command.name }} 81 | command: 82 | - {{ . | quote }} 83 | {{- end }} 84 | args: 85 | {{- if .Values.otelDeployment.configMap.create }} 86 | - "--config=/conf/otel-deployment-config.yaml" 87 | {{- end }} 88 | {{- range .Values.otelDeployment.command.extraArgs }} 89 | - {{ . | quote }} 90 | {{- end }} 91 | securityContext: 92 | {{- toYaml .Values.otelDeployment.securityContext | nindent 12 }} 93 | env: 94 | {{- include "snippet.otlp-env" . | nindent 12 }} 95 | {{- include "snippet.k8s-env" . | nindent 12 }} 96 | - name: SIGNOZ_COMPONENT 97 | value: {{ default "otel-deployment" .Values.otelDeployment.name }} 98 | - name: OTEL_RESOURCE_ATTRIBUTES 99 | value: signoz.component=$(SIGNOZ_COMPONENT),k8s.cluster.name=$(K8S_CLUSTER_NAME) 100 | {{- include "renderAdditionalEnv" .Values.otelDeployment.additionalEnvs | nindent 12 }} 101 | volumeMounts: 102 | - name: otel-deployment-config-vol 103 | mountPath: /conf 104 | {{- if .Values.otelTlsSecrets.enabled }} 105 | - name: {{ include "k8s-infra.fullname" . }}-deployment-secrets-vol 106 | mountPath: {{ default "/secrets" .Values.otelTlsSecrets.path }} 107 | {{- end }} 108 | {{- with .Values.otelDeployment.extraVolumeMounts }} 109 | {{- toYaml . | nindent 12 }} 110 | {{- end }} 111 | {{- if .Values.otelDeployment.livenessProbe.enabled }} 112 | livenessProbe: 113 | {{- with .Values.otelDeployment.livenessProbe }} 114 | httpGet: 115 | port: {{ .port }} 116 | path: {{ .path }} 117 | initialDelaySeconds: {{ .initialDelaySeconds }} 118 | periodSeconds: {{ .periodSeconds }} 119 | timeoutSeconds: {{ .timeoutSeconds }} 120 | successThreshold: {{ .successThreshold }} 121 | failureThreshold: {{ .failureThreshold }} 122 | {{- end }} 123 | {{- else if .Values.otelDeployment.customLivenessProbe }} 124 | livenessProbe: 125 | {{- toYaml .Values.otelDeployment.customLivenessProbe | nindent 12 }} 126 | {{- end }} 127 | {{- if .Values.otelDeployment.readinessProbe.enabled }} 128 | readinessProbe: 129 | {{- with .Values.otelDeployment.readinessProbe }} 130 | httpGet: 131 | port: {{ .port }} 132 | path: {{ .path }} 133 | initialDelaySeconds: {{ .initialDelaySeconds }} 134 | periodSeconds: {{ .periodSeconds }} 135 | timeoutSeconds: {{ .timeoutSeconds }} 136 | successThreshold: {{ .successThreshold }} 137 | failureThreshold: {{ .failureThreshold }} 138 | {{- end }} 139 | {{- else if .Values.otelDeployment.customReadinessProbe }} 140 | readinessProbe: 141 | {{- toYaml .Values.otelDeployment.customReadinessProbe | nindent 12 }} 142 | {{- end }} 143 | resources: 144 | {{- toYaml .Values.otelDeployment.resources | nindent 12 }} 145 | {{- end }} 146 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-deployment/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.otelDeployment.ingress.enabled .Values.otelDeployment.enabled -}} 2 | {{- $fullName := include "otelDeployment.fullname" . -}} 3 | {{- $ingressApiIsStable := eq (include "ingress.isStable" .) "true" -}} 4 | {{- $ingressSupportsPathType := eq (include "ingress.supportsPathType" .) "true" -}} 5 | {{- $ingressSupportsClassName := and .Values.otelDeployment.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) -}} 6 | apiVersion: {{ include "ingress.apiVersion" . }} 7 | kind: Ingress 8 | metadata: 9 | name: {{ $fullName }} 10 | namespace: {{ include "k8s-infra.namespace" . }} 11 | labels: 12 | {{- include "otelDeployment.labels" . | nindent 4 }} 13 | {{- with .Values.otelDeployment.ingress.annotations }} 14 | annotations: 15 | {{- toYaml . | nindent 4 }} 16 | {{- end }} 17 | spec: 18 | {{- if $ingressSupportsClassName }} 19 | ingressClassName: {{ .Values.otelDeployment.ingress.className }} 20 | {{- end }} 21 | {{- if .Values.otelDeployment.ingress.tls }} 22 | tls: 23 | {{- range .Values.otelDeployment.ingress.tls }} 24 | - hosts: 25 | {{- range .hosts }} 26 | - {{ . | quote }} 27 | {{- end }} 28 | secretName: {{ .secretName }} 29 | {{- end }} 30 | {{- end }} 31 | rules: 32 | {{- range .Values.otelDeployment.ingress.hosts }} 33 | - host: {{ .host | quote }} 34 | http: 35 | paths: 36 | {{- range .paths }} 37 | - path: {{ .path }} 38 | {{- if $ingressSupportsPathType }} 39 | pathType: {{ .pathType }} 40 | {{- end }} 41 | backend: 42 | {{- if $ingressApiIsStable }} 43 | service: 44 | name: {{ $fullName }} 45 | port: 46 | number: {{ .port }} 47 | {{- else }} 48 | serviceName: {{ $fullName }} 49 | servicePort: {{ .port }} 50 | {{- end }} 51 | {{- end }} 52 | {{- end }} 53 | {{- end }} 54 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-deployment/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelDeployment.enabled -}} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: {{ include "otelDeployment.fullname" . }} 6 | namespace: {{ include "k8s-infra.namespace" . }} 7 | labels: 8 | {{- include "otelDeployment.labels" . | nindent 4 }} 9 | {{- with .Values.otelDeployment }} 10 | {{- if .service.annotations }} 11 | annotations: 12 | {{- toYaml .service.annotations | nindent 4 }} 13 | {{- end }} 14 | spec: 15 | type: {{ .service.type }} 16 | ports: 17 | {{- include "otel.portsConfig" . | nindent 4 }} 18 | selector: 19 | {{- include "otelDeployment.selectorLabels" $ | nindent 4 }} 20 | {{- end }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-deployment/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.otelDeployment.serviceAccount.create .Values.otelDeployment.enabled -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "otelDeployment.serviceAccountName" . }} 6 | namespace: {{ include "k8s-infra.namespace" . }} 7 | labels: 8 | {{- include "otelDeployment.labels" . | nindent 4 }} 9 | {{- with .Values.otelDeployment.serviceAccount.annotations }} 10 | annotations: 11 | {{- toYaml . | nindent 4 }} 12 | {{- end }} 13 | {{- include "otelDeployment.imagePullSecrets" . }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/otel-deployment/tests/test-connection.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelDeployment.enabled -}} 2 | {{- $healthCheckPort := index .Values.otelDeployment.ports "health-check" -}} 3 | apiVersion: v1 4 | kind: Pod 5 | metadata: 6 | name: "{{ include "otelDeployment.fullname" . }}-test-connection" 7 | namespace: {{ include "k8s-infra.namespace" . }} 8 | labels: 9 | {{- include "otelDeployment.labels" . | nindent 4 }} 10 | annotations: 11 | "helm.sh/hook": test 12 | spec: 13 | containers: 14 | - name: wget 15 | image: {{ default "docker.io" .Values.global.imageRegistry }}/busybox:1.35 16 | command: ['wget'] 17 | args: ['{{ include "otelDeployment.fullname" . }}:{{ $healthCheckPort.servicePort }}'] 18 | restartPolicy: Never 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /charts/k8s-infra/templates/tls-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (not .Values.otelTlsSecrets.existingSecretName) .Values.otelTlsSecrets.enabled }} 2 | apiVersion: v1 3 | kind: Secret 4 | type: Opaque 5 | metadata: 6 | name: {{ include "k8s-infra.fullname" . }}-tls-secrets 7 | namespace: {{ include "k8s-infra.namespace" . }} 8 | labels: 9 | {{- include "k8s-infra.labels" . | nindent 4 }} 10 | annotations: 11 | "helm.sh/hook": "pre-install,pre-upgrade" 12 | "helm.sh/hook-delete-policy": "before-hook-creation" 13 | data: 14 | {{- with .Values.otelTlsSecrets }} 15 | cert.pem: {{ .certificate | b64enc }} 16 | key.pem: {{ .key | b64enc }} 17 | {{- if .ca }} 18 | ca.pem: {{ .ca | b64enc }} 19 | {{- end }} 20 | {{- end }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /charts/k8s-infra/tests/otel-agent_log_collection_test.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json 2 | suite: otel-agent_log_collection_test.yaml 3 | templates: 4 | - otel-agent/configmap.yaml 5 | release: 6 | name: k8s-infra 7 | namespace: signoz 8 | set: 9 | presets: 10 | prometheus: 11 | enabled: false 12 | loggingExporter: 13 | enabled: false 14 | otlpExporter: 15 | enabled: false 16 | logsCollection: 17 | enabled: true 18 | hostMetrics: 19 | enabled: false 20 | kubeletMetrics: 21 | enabled: false 22 | kubernetesAttributes: 23 | enabled: false 24 | clusterMetrics: 25 | enabled: false 26 | resourceDetection: 27 | enabled: false 28 | k8sEvents: 29 | enabled: false 30 | 31 | tests: 32 | - it: should configure the log collection correctly 33 | asserts: 34 | - equal: 35 | path: data["otel-agent-config.yaml"] 36 | value: |- 37 | exporters: {} 38 | extensions: 39 | health_check: 40 | endpoint: 0.0.0.0:13133 41 | pprof: 42 | endpoint: localhost:1777 43 | zpages: 44 | endpoint: localhost:55679 45 | processors: 46 | batch: 47 | send_batch_size: 10000 48 | timeout: 200ms 49 | receivers: 50 | filelog/k8s: 51 | exclude: 52 | - /var/log/pods/signoz_k8s-infra*-signoz-*/*/*.log 53 | - /var/log/pods/signoz_k8s-infra*-k8s-infra-*/*/*.log 54 | - /var/log/pods/kube-system_*/*/*.log 55 | - /var/log/pods/*_hotrod*_*/*/*.log 56 | - /var/log/pods/*_locust*_*/*/*.log 57 | include: 58 | - /var/log/pods/*/*/*.log 59 | include_file_name: false 60 | include_file_path: true 61 | operators: 62 | - id: container-parser 63 | type: container 64 | start_at: end 65 | otlp: 66 | protocols: 67 | grpc: 68 | endpoint: 0.0.0.0:4317 69 | max_recv_msg_size_mib: 4 70 | http: 71 | endpoint: 0.0.0.0:4318 72 | service: 73 | extensions: 74 | - health_check 75 | - zpages 76 | - pprof 77 | pipelines: {} 78 | telemetry: 79 | logs: 80 | encoding: json 81 | metrics: 82 | address: 0.0.0.0:8888 -------------------------------------------------------------------------------- /charts/k8s-infra/tests/otel-agent_self_telemetry_enable_otlp_test.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json 2 | suite: otel-agent_self_telemetry_enable_otlp_test.yaml 3 | templates: 4 | - otel-agent/configmap.yaml 5 | release: 6 | name: k8s-infra 7 | namespace: signoz 8 | set: 9 | otelCollectorEndpoint: otelendpoint:443 10 | signozApiKey: signozapikey 11 | presets: 12 | selfTelemetry: 13 | endpoint: selftelemetryhost:443 14 | signozApiKey: selftelemetryapikey 15 | traces: 16 | enabled: true 17 | metrics: 18 | enabled: true 19 | logs: 20 | enabled: true 21 | # Disable other presets to focus on selfTelemetry 22 | prometheus: 23 | enabled: false 24 | loggingExporter: 25 | enabled: false 26 | otlpExporter: 27 | enabled: true 28 | logsCollection: 29 | enabled: false 30 | hostMetrics: 31 | enabled: false 32 | kubeletMetrics: 33 | enabled: false 34 | kubernetesAttributes: 35 | enabled: false 36 | clusterMetrics: 37 | enabled: false 38 | resourceDetection: 39 | enabled: false 40 | k8sEvents: 41 | enabled: false 42 | 43 | tests: 44 | - it: should configure self telemetry with traces, metrics and logs 45 | asserts: 46 | - equal: 47 | path: data["otel-agent-config.yaml"] 48 | value: |- 49 | exporters: 50 | otlp: 51 | endpoint: ${env:OTEL_EXPORTER_OTLP_ENDPOINT} 52 | headers: 53 | signoz-access-token: ${env:SIGNOZ_API_KEY} 54 | tls: 55 | insecure: ${env:OTEL_EXPORTER_OTLP_INSECURE} 56 | insecure_skip_verify: ${env:OTEL_EXPORTER_OTLP_INSECURE_SKIP_VERIFY} 57 | otlphttp/self_telemetry: 58 | endpoint: http://selftelemetryhost:443 59 | headers: 60 | signoz-access-token: ${env:SIGNOZ_SELF_TELEMETRY_API_KEY} 61 | tls: 62 | insecure: true 63 | insecure_skip_verify: true 64 | extensions: 65 | health_check: 66 | endpoint: 0.0.0.0:13133 67 | pprof: 68 | endpoint: localhost:1777 69 | zpages: 70 | endpoint: localhost:55679 71 | processors: 72 | batch: 73 | send_batch_size: 10000 74 | timeout: 200ms 75 | filter/non_error_logs: 76 | logs: 77 | log_record: 78 | - not IsMatch(body, ".*error.*") 79 | receivers: 80 | filelog/self_logs: 81 | include: 82 | - /var/log/pods/signoz_k8s-infra*-k8s-infra-*/*/*.log 83 | include_file_name: false 84 | include_file_path: true 85 | operators: 86 | - id: container-parser 87 | type: container 88 | start_at: end 89 | otlp: 90 | protocols: 91 | grpc: 92 | endpoint: 0.0.0.0:4317 93 | max_recv_msg_size_mib: 4 94 | http: 95 | endpoint: 0.0.0.0:4318 96 | service: 97 | extensions: 98 | - health_check 99 | - zpages 100 | - pprof 101 | pipelines: 102 | logs: 103 | exporters: 104 | - otlp 105 | processors: 106 | - batch 107 | receivers: 108 | - otlp 109 | logs/self_logs: 110 | exporters: 111 | - otlphttp/self_telemetry 112 | processors: 113 | - filter/non_error_logs 114 | receivers: 115 | - filelog/self_logs 116 | metrics: 117 | exporters: 118 | - otlp 119 | processors: 120 | - batch 121 | receivers: 122 | - otlp 123 | traces: 124 | exporters: 125 | - otlp 126 | processors: 127 | - batch 128 | receivers: 129 | - otlp 130 | telemetry: 131 | logs: 132 | encoding: json 133 | metrics: 134 | address: 0.0.0.0:8888 135 | level: detailed 136 | readers: 137 | - periodic: 138 | exporter: 139 | otlp: 140 | compression: gzip 141 | endpoint: http://selftelemetryhost:443 142 | headers: 143 | signoz-access-token: ${env:SIGNOZ_SELF_TELEMETRY_API_KEY} 144 | insecure: true 145 | protocol: http/protobuf 146 | resource: 147 | k8s.cluster.name: ${env:K8S_CLUSTER_NAME} 148 | k8s.container.name: ${env:K8S_CONTAINER_NAME} 149 | k8s.namespace.name: ${env:K8S_NAMESPACE} 150 | k8s.node.name: ${env:K8S_NODE_NAME} 151 | k8s.pod.name: ${env:K8S_POD_NAME} 152 | traces: 153 | processors: 154 | - batch: 155 | exporter: 156 | otlp: 157 | compression: gzip 158 | endpoint: http://selftelemetryhost:443 159 | headers: 160 | signoz-access-token: ${env:SIGNOZ_SELF_TELEMETRY_API_KEY} 161 | insecure: true 162 | protocol: http/protobuf 163 | propagators: 164 | - tracecontext 165 | - b3 -------------------------------------------------------------------------------- /charts/k8s-infra/tests/otel-agent_self_telemetry_test.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json 2 | suite: otel-agent_self_telemetry_test.yaml 3 | templates: 4 | - otel-agent/configmap.yaml 5 | release: 6 | name: k8s-infra 7 | namespace: signoz 8 | set: 9 | presets: 10 | selfTelemetry: 11 | endpoint: myhost:443 12 | signozApiKey: myapikey 13 | traces: 14 | enabled: true 15 | metrics: 16 | enabled: true 17 | logs: 18 | enabled: true 19 | # Disable other presets to focus on selfTelemetry 20 | prometheus: 21 | enabled: false 22 | loggingExporter: 23 | enabled: false 24 | otlpExporter: 25 | enabled: false 26 | logsCollection: 27 | enabled: false 28 | hostMetrics: 29 | enabled: false 30 | kubeletMetrics: 31 | enabled: false 32 | kubernetesAttributes: 33 | enabled: false 34 | clusterMetrics: 35 | enabled: false 36 | resourceDetection: 37 | enabled: false 38 | k8sEvents: 39 | enabled: false 40 | 41 | tests: 42 | - it: should configure self telemetry with traces, metrics and logs 43 | asserts: 44 | - equal: 45 | path: data["otel-agent-config.yaml"] 46 | value: |- 47 | exporters: 48 | otlphttp/self_telemetry: 49 | endpoint: http://myhost:443 50 | headers: 51 | signoz-access-token: ${env:SIGNOZ_SELF_TELEMETRY_API_KEY} 52 | tls: 53 | insecure: true 54 | insecure_skip_verify: true 55 | extensions: 56 | health_check: 57 | endpoint: 0.0.0.0:13133 58 | pprof: 59 | endpoint: localhost:1777 60 | zpages: 61 | endpoint: localhost:55679 62 | processors: 63 | batch: 64 | send_batch_size: 10000 65 | timeout: 200ms 66 | filter/non_error_logs: 67 | logs: 68 | log_record: 69 | - not IsMatch(body, ".*error.*") 70 | receivers: 71 | filelog/self_logs: 72 | include: 73 | - /var/log/pods/signoz_k8s-infra*-k8s-infra-*/*/*.log 74 | include_file_name: false 75 | include_file_path: true 76 | operators: 77 | - id: container-parser 78 | type: container 79 | start_at: end 80 | otlp: 81 | protocols: 82 | grpc: 83 | endpoint: 0.0.0.0:4317 84 | max_recv_msg_size_mib: 4 85 | http: 86 | endpoint: 0.0.0.0:4318 87 | service: 88 | extensions: 89 | - health_check 90 | - zpages 91 | - pprof 92 | pipelines: 93 | logs/self_logs: 94 | exporters: 95 | - otlphttp/self_telemetry 96 | processors: 97 | - filter/non_error_logs 98 | receivers: 99 | - filelog/self_logs 100 | telemetry: 101 | logs: 102 | encoding: json 103 | metrics: 104 | address: 0.0.0.0:8888 105 | level: detailed 106 | readers: 107 | - periodic: 108 | exporter: 109 | otlp: 110 | compression: gzip 111 | endpoint: http://myhost:443 112 | headers: 113 | signoz-access-token: ${env:SIGNOZ_SELF_TELEMETRY_API_KEY} 114 | insecure: true 115 | protocol: http/protobuf 116 | resource: 117 | k8s.cluster.name: ${env:K8S_CLUSTER_NAME} 118 | k8s.container.name: ${env:K8S_CONTAINER_NAME} 119 | k8s.namespace.name: ${env:K8S_NAMESPACE} 120 | k8s.node.name: ${env:K8S_NODE_NAME} 121 | k8s.pod.name: ${env:K8S_POD_NAME} 122 | traces: 123 | processors: 124 | - batch: 125 | exporter: 126 | otlp: 127 | compression: gzip 128 | endpoint: http://myhost:443 129 | headers: 130 | signoz-access-token: ${env:SIGNOZ_SELF_TELEMETRY_API_KEY} 131 | insecure: true 132 | protocol: http/protobuf 133 | propagators: 134 | - tracecontext 135 | - b3 -------------------------------------------------------------------------------- /charts/k8s-infra/tests/otel-deployment_prometheus_test.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json 2 | suite: otel-deployment_prometheus_test.yaml 3 | templates: 4 | - otel-deployment/configmap.yaml 5 | release: 6 | name: k8s-infra 7 | namespace: signoz 8 | set: 9 | presets: 10 | prometheus: 11 | enabled: true 12 | annotationsPrefix: "signoz.io" 13 | scrapeInterval: 60s 14 | loggingExporter: 15 | enabled: true 16 | otlpExporter: 17 | enabled: false 18 | logsCollection: 19 | enabled: false 20 | hostMetrics: 21 | enabled: false 22 | kubeletMetrics: 23 | enabled: false 24 | kubernetesAttributes: 25 | enabled: false 26 | clusterMetrics: 27 | enabled: false 28 | resourceDetection: 29 | enabled: true 30 | k8sEvents: 31 | enabled: false 32 | tests: 33 | - it: should have otel-deployment configuration in otel-deployment-config.yaml 34 | asserts: 35 | - exists: 36 | path: data["otel-deployment-config.yaml"] 37 | - it: should have prometheus/scraper receiver with signoz.io annotations prefix 38 | asserts: 39 | - equal: 40 | path: data["otel-deployment-config.yaml"] 41 | value: |- 42 | exporters: 43 | logging: 44 | sampling_initial: 2 45 | sampling_thereafter: 500 46 | verbosity: basic 47 | extensions: 48 | health_check: 49 | endpoint: 0.0.0.0:13133 50 | pprof: 51 | endpoint: localhost:1777 52 | zpages: 53 | endpoint: localhost:55679 54 | processors: 55 | batch: 56 | send_batch_size: 10000 57 | timeout: 1s 58 | resourcedetection: 59 | detectors: 60 | - env 61 | override: false 62 | timeout: 2s 63 | receivers: 64 | prometheus/scraper: 65 | config: 66 | scrape_configs: 67 | - job_name: signoz-scraper 68 | kubernetes_sd_configs: 69 | - role: pod 70 | relabel_configs: 71 | - action: keep 72 | regex: true 73 | source_labels: 74 | - __meta_kubernetes_pod_annotation_signoz_io_scrape 75 | - action: replace 76 | regex: (.+) 77 | source_labels: 78 | - __meta_kubernetes_pod_annotation_signoz_io_path 79 | target_label: __metrics_path__ 80 | - action: replace 81 | separator: ':' 82 | source_labels: 83 | - __meta_kubernetes_pod_ip 84 | - __meta_kubernetes_pod_annotation_signoz_io_port 85 | target_label: __address__ 86 | - replacement: signoz-scraper 87 | target_label: job_name 88 | - action: replace 89 | source_labels: 90 | - __meta_kubernetes_pod_label_app_kubernetes_io_name 91 | target_label: signoz_k8s_name 92 | - action: replace 93 | source_labels: 94 | - __meta_kubernetes_pod_label_app_kubernetes_io_instance 95 | target_label: signoz_k8s_instance 96 | - action: replace 97 | source_labels: 98 | - __meta_kubernetes_pod_label_app_kubernetes_io_component 99 | target_label: signoz_k8s_component 100 | - action: replace 101 | source_labels: 102 | - __meta_kubernetes_namespace 103 | target_label: k8s_namespace_name 104 | - action: replace 105 | source_labels: 106 | - __meta_kubernetes_pod_name 107 | target_label: k8s_pod_name 108 | - action: replace 109 | source_labels: 110 | - __meta_kubernetes_pod_uid 111 | target_label: k8s_pod_uid 112 | - action: replace 113 | source_labels: 114 | - __meta_kubernetes_pod_node_name 115 | target_label: k8s_node_name 116 | - action: replace 117 | source_labels: 118 | - __meta_kubernetes_pod_ready 119 | target_label: k8s_pod_ready 120 | - action: replace 121 | source_labels: 122 | - __meta_kubernetes_pod_phase 123 | target_label: k8s_pod_phase 124 | scrape_interval: 60s 125 | service: 126 | extensions: 127 | - health_check 128 | - zpages 129 | - pprof 130 | pipelines: 131 | metrics/scraper: 132 | exporters: 133 | - logging 134 | processors: 135 | - resourcedetection 136 | - batch 137 | receivers: 138 | - prometheus/scraper 139 | telemetry: 140 | logs: 141 | encoding: json 142 | metrics: 143 | address: 0.0.0.0:8888 144 | -------------------------------------------------------------------------------- /charts/k8s-infra/tests/otel-deployment_self_telemetry_test.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json 2 | suite: otel-deployment_self_telemetry_test.yaml 3 | templates: 4 | - otel-deployment/configmap.yaml 5 | release: 6 | name: k8s-infra 7 | namespace: signoz 8 | set: 9 | presets: 10 | selfTelemetry: 11 | traces: 12 | enabled: true 13 | metrics: 14 | enabled: true 15 | logs: 16 | enabled: true 17 | # Disable other presets to focus on selfTelemetry 18 | prometheus: 19 | enabled: false 20 | loggingExporter: 21 | enabled: false 22 | otlpExporter: 23 | enabled: false 24 | logsCollection: 25 | enabled: false 26 | hostMetrics: 27 | enabled: false 28 | kubeletMetrics: 29 | enabled: false 30 | kubernetesAttributes: 31 | enabled: false 32 | clusterMetrics: 33 | enabled: false 34 | resourceDetection: 35 | enabled: false 36 | k8sEvents: 37 | enabled: false 38 | 39 | tests: 40 | - it: should configure self telemetry with traces, metrics. No logs required for deployment 41 | asserts: 42 | - equal: 43 | path: data["otel-deployment-config.yaml"] 44 | value: |- 45 | exporters: {} 46 | extensions: 47 | health_check: 48 | endpoint: 0.0.0.0:13133 49 | pprof: 50 | endpoint: localhost:1777 51 | zpages: 52 | endpoint: localhost:55679 53 | processors: 54 | batch: 55 | send_batch_size: 10000 56 | timeout: 1s 57 | receivers: {} 58 | service: 59 | extensions: 60 | - health_check 61 | - zpages 62 | - pprof 63 | pipelines: {} 64 | telemetry: 65 | logs: 66 | encoding: json 67 | metrics: 68 | address: 0.0.0.0:8888 69 | level: detailed 70 | readers: 71 | - periodic: 72 | exporter: 73 | otlp: 74 | compression: gzip 75 | endpoint: http://${env:OTEL_EXPORTER_OTLP_ENDPOINT} 76 | headers: 77 | signoz-access-token: ${env:SIGNOZ_SELF_TELEMETRY_API_KEY} 78 | insecure: ${env:OTEL_EXPORTER_OTLP_INSECURE} 79 | protocol: http/protobuf 80 | resource: 81 | k8s.cluster.name: ${env:K8S_CLUSTER_NAME} 82 | k8s.container.name: ${env:K8S_CONTAINER_NAME} 83 | k8s.namespace.name: ${env:K8S_NAMESPACE} 84 | k8s.node.name: ${env:K8S_NODE_NAME} 85 | k8s.pod.name: ${env:K8S_POD_NAME} 86 | traces: 87 | processors: 88 | - batch: 89 | exporter: 90 | otlp: 91 | compression: gzip 92 | endpoint: http://${env:OTEL_EXPORTER_OTLP_ENDPOINT} 93 | headers: 94 | signoz-access-token: ${env:SIGNOZ_SELF_TELEMETRY_API_KEY} 95 | insecure: ${env:OTEL_EXPORTER_OTLP_INSECURE} 96 | protocol: http/protobuf 97 | propagators: 98 | - tracecontext 99 | - b3 -------------------------------------------------------------------------------- /charts/signoz-otel-gateway/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /charts/signoz-otel-gateway/Chart.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: postgresql 3 | repository: https://charts.bitnami.com/bitnami 4 | version: 15.0.0 5 | digest: sha256:565cf5a1350794bca648c3f1e3dd374908e478fc9994caeae4564d72220e56bb 6 | generated: "2024-06-06T21:47:55.218828+05:30" 7 | -------------------------------------------------------------------------------- /charts/signoz-otel-gateway/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: signoz-otel-gateway 3 | description: A Helm chart for deploying SigNoz Opentelemetry Gateway 4 | type: application 5 | version: 0.0.1 6 | appVersion: "v0.0.16" 7 | home: https://signoz.io/ 8 | icon: https://signoz.io/img/SigNozLogo-orange.svg 9 | dependencies: 10 | - name: postgresql 11 | version: 15.0.0 12 | repository: https://charts.bitnami.com/bitnami 13 | condition: postgresql.enabled 14 | maintainers: 15 | - name: SigNoz 16 | email: devops@signoz.io 17 | url: https://signoz.io 18 | - name: prashant-shahi 19 | email: prashant@signoz.io 20 | url: https://prashantshahi.dev 21 | -------------------------------------------------------------------------------- /charts/signoz-otel-gateway/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Expand the name of the chart. 3 | */}} 4 | {{- define "signoz-otel-gateway.name" -}} 5 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 6 | {{- end }} 7 | 8 | {{/* 9 | Create a default fully qualified app name. 10 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 11 | If release name contains chart name it will be used as a full name. 12 | */}} 13 | {{- define "signoz-otel-gateway.fullname" -}} 14 | {{- if .Values.fullnameOverride }} 15 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 16 | {{- else }} 17 | {{- $name := default .Chart.Name .Values.nameOverride }} 18 | {{- if contains $name .Release.Name }} 19 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 20 | {{- else }} 21 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 22 | {{- end }} 23 | {{- end }} 24 | {{- end }} 25 | 26 | {{/* 27 | Create chart name and version as used by the chart label. 28 | */}} 29 | {{- define "signoz-otel-gateway.chart" -}} 30 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 31 | {{- end }} 32 | 33 | {{/* 34 | Common labels 35 | */}} 36 | {{- define "signoz-otel-gateway.labels" -}} 37 | helm.sh/chart: {{ include "signoz-otel-gateway.chart" . }} 38 | {{ include "signoz-otel-gateway.selectorLabels" . }} 39 | {{- if .Chart.AppVersion }} 40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 41 | {{- end }} 42 | app.kubernetes.io/managed-by: {{ .Release.Service }} 43 | {{- end }} 44 | 45 | {{/* 46 | Selector labels 47 | */}} 48 | {{- define "signoz-otel-gateway.selectorLabels" -}} 49 | app.kubernetes.io/name: {{ include "signoz-otel-gateway.name" . }} 50 | app.kubernetes.io/instance: {{ .Release.Name }} 51 | {{- end }} 52 | 53 | {{/* 54 | Create the name of the service account to use 55 | */}} 56 | {{- define "signoz-otel-gateway.serviceAccountName" -}} 57 | {{- if .Values.serviceAccount.create }} 58 | {{- default (include "signoz-otel-gateway.fullname" .) .Values.serviceAccount.name }} 59 | {{- else }} 60 | {{- default "default" .Values.serviceAccount.name }} 61 | {{- end }} 62 | {{- end }} 63 | 64 | {{/* 65 | Create a list of all ports 66 | */}} 67 | {{- define "signoz-otel-gateway.ports" -}} 68 | {{- $serviceType := deepCopy .Values.service.type -}} 69 | {{- $ports := deepCopy .Values.service.ports -}} 70 | {{- range $key, $port := $ports -}} 71 | {{- if $port.enabled }} 72 | - name: {{ $key }} 73 | port: {{ $port.servicePort }} 74 | targetPort: {{ $key }} 75 | protocol: {{ $port.protocol }} 76 | {{- if (eq $serviceType "ClusterIP") }} 77 | nodePort: null 78 | {{- else if (eq $serviceType "NodePort") }} 79 | nodePort: {{ $port.nodePort }} 80 | {{- end }} 81 | {{- end -}} 82 | {{- end -}} 83 | {{- end -}} 84 | 85 | {{/* 86 | Create config map 87 | */}} 88 | {{- define "signoz-otel-gateway.config" -}} 89 | {{- $config := omit .Values.config "create" -}} 90 | {{- range $key, $value := $config }} 91 | {{- $fmted := $value | toString }} 92 | {{- if not (eq $fmted "") }} 93 | {{ $key }}: {{ $fmted | toYaml }} 94 | {{- end }} 95 | {{- end }} 96 | {{- end -}} 97 | 98 | 99 | {{- define "secretkeyref" -}} 100 | valueFrom: 101 | secretKeyRef: 102 | name: {{ .name }} 103 | key: {{ .key }} 104 | {{- end -}} 105 | 106 | {{- define "fieldkeyref" -}} 107 | valueFrom: 108 | fieldRef: 109 | apiVersion: v1 110 | fieldPath: {{ .path }} 111 | {{- end -}} 112 | 113 | {{/* 114 | Create env 115 | */}} 116 | {{- define "signoz-otel-gateway.env" -}} 117 | {{/* 118 | ====== GENERATED ENVIRONMENT VARIABLES ====== 119 | */}} 120 | {{- $genEnv := dict -}} 121 | {{- $_ := set $genEnv "SIGNOZ_COMPONENT" "signoz-otel-gateway" -}} 122 | {{- $_ := set $genEnv "OTEL_SERVICE_NAME" "signoz-otel-gateway" -}} 123 | {{- $_ := set $genEnv "OTEL_RESOURCE_ATTRIBUTES" "signoz.component=$(SIGNOZ_COMPONENT),k8s.pod.uid=$(K8S_POD_UID),k8s.pod.ip=$(K8S_POD_IP)" -}} 124 | {{/* 125 | ====== FIELD ENVIRONMENT VARIABLES ====== 126 | */}} 127 | {{- $fieldEnv := dict -}} 128 | {{- range $key, $value := (dict "K8S_NODE_NAME" "spec.nodeName" "K8S_POD_IP" "status.podIP" "K8S_POD_NAME" "metadata.name" "K8S_POD_UID" "metadata.uid" "K8S_NAMESPACE" "metadata.namespace") -}} 129 | {{- $_ := set $fieldEnv $key (include "fieldkeyref" (dict "path" $value)) -}} 130 | {{- end -}} 131 | 132 | {{/* 133 | ====== SECRET ENVIRONMENT VARIABLES ====== 134 | */}} 135 | {{- $prefix := (include "signoz-otel-gateway.fullname" .) }} 136 | {{- $secretEnv := dict -}} 137 | {{- if .Values.externalSecrets.create -}} 138 | {{- range $key, $value := .Values.externalSecrets.secrets -}} 139 | {{- if $value.env -}} 140 | {{- range $ikey, $ivalue := $value.env -}} 141 | {{- $_ := set $secretEnv (upper (printf "OTELGATEWAY_%s" $ikey)) (include "secretkeyref" (dict "name" (printf "%s-%s" $prefix $key) "key" $ivalue)) -}} 142 | {{- end -}} 143 | {{- end -}} 144 | {{- end -}} 145 | {{- end -}} 146 | {{/* 147 | ====== USER ENVIRONMENT VARIABLES ====== 148 | */}} 149 | {{- $userEnv := dict -}} 150 | {{- range $key, $val := .Values.env }} 151 | {{- $upper := upper $key -}} 152 | {{- $var := printf "OTELGATEWAY_%s" $upper -}} 153 | {{- $_ := set $userEnv $var $val -}} 154 | {{- end -}} 155 | 156 | {{/* 157 | ====== MERGE AND RENDER ENV BLOCK ====== 158 | */}} 159 | 160 | {{- $completeEnv := mergeOverwrite $genEnv $fieldEnv $userEnv $secretEnv -}} 161 | {{- template "signoz-otel-gateway.renderEnv" $completeEnv -}} 162 | 163 | {{- end -}} 164 | 165 | {{/* 166 | Given a dictionary of variable=value pairs including value and valueFrom, render a container env block. 167 | Environment variables are sorted alphabetically 168 | */}} 169 | {{- define "signoz-otel-gateway.renderEnv" -}} 170 | 171 | {{- $dict := . -}} 172 | 173 | {{- range keys . | sortAlpha }} 174 | {{- $val := pluck . $dict | first -}} 175 | {{- $valueType := printf "%T" $val -}} 176 | {{ if eq $valueType "map[string]interface {}" }} 177 | - name: {{ . }} 178 | {{ toYaml $val | indent 2 -}} 179 | {{- else if eq $valueType "string" }} 180 | {{- if regexMatch "valueFrom" $val }} 181 | - name: {{ . }} 182 | {{ $val | indent 2 }} 183 | {{- else }} 184 | - name: {{ . }} 185 | value: {{ $val | quote }} 186 | {{- end }} 187 | {{- else }} 188 | - name: {{ . }} 189 | value: {{ $val | quote }} 190 | {{- end }} 191 | {{- end -}} 192 | 193 | {{- end -}} 194 | -------------------------------------------------------------------------------- /charts/signoz-otel-gateway/templates/config.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.config.create }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ include "signoz-otel-gateway.fullname" . }} 6 | labels: 7 | {{- include "signoz-otel-gateway.labels" . | nindent 4 }} 8 | data: 9 | config.yaml: |- 10 | {{- omit .Values.config "create" | toYaml | nindent 4 }} 11 | {{- end }} -------------------------------------------------------------------------------- /charts/signoz-otel-gateway/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ include "signoz-otel-gateway.fullname" . }} 5 | labels: 6 | {{- include "signoz-otel-gateway.labels" . | nindent 4 }} 7 | spec: 8 | replicas: {{ .Values.replicaCount }} 9 | selector: 10 | matchLabels: 11 | {{- include "signoz-otel-gateway.selectorLabels" . | nindent 6 }} 12 | template: 13 | metadata: 14 | annotations: 15 | checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }} 16 | {{- with .Values.podAnnotations }} 17 | {{- toYaml . | nindent 8 }} 18 | {{- end }} 19 | labels: 20 | {{- include "signoz-otel-gateway.labels" . | nindent 8 }} 21 | {{- with .Values.podLabels }} 22 | {{- toYaml . | nindent 8 }} 23 | {{- end }} 24 | spec: 25 | {{- with .Values.imagePullSecrets }} 26 | imagePullSecrets: 27 | {{- toYaml . | nindent 8 }} 28 | {{- end }} 29 | serviceAccountName: {{ include "signoz-otel-gateway.serviceAccountName" . }} 30 | securityContext: 31 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 32 | initContainers: 33 | - name: migrate 34 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" 35 | imagePullPolicy: {{ .Values.image.pullPolicy }} 36 | command: 37 | - /usr/local/bin/otelgateway 38 | args: 39 | - migrate 40 | env: 41 | {{- include "signoz-otel-gateway.env" . | nindent 12 }} 42 | containers: 43 | - name: gateway 44 | securityContext: 45 | {{- toYaml .Values.securityContext | nindent 12 }} 46 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" 47 | imagePullPolicy: {{ .Values.image.pullPolicy }} 48 | ports: 49 | {{- range $key, $port := .Values.service.ports }} 50 | {{- if $port.enabled }} 51 | - name: {{ $key }} 52 | containerPort: {{ $port.containerPort }} 53 | protocol: {{ $port.protocol }} 54 | {{- end }} 55 | {{- end }} 56 | command: 57 | - /usr/local/bin/otelgateway 58 | args: 59 | - collector 60 | {{- if .Values.config.create }} 61 | - --config=file:/conf/config.yaml 62 | {{- end }} 63 | {{- range .Values.args }} 64 | - {{ . | quote }} 65 | {{- end }} 66 | env: 67 | {{- include "signoz-otel-gateway.env" . | nindent 12 }} 68 | livenessProbe: 69 | {{- toYaml .Values.livenessProbe | nindent 12 }} 70 | readinessProbe: 71 | {{- toYaml .Values.readinessProbe | nindent 12 }} 72 | resources: 73 | {{- toYaml .Values.resources | nindent 12 }} 74 | volumeMounts: 75 | {{- if .Values.config.create }} 76 | - name: config 77 | mountPath: /conf 78 | {{- end }} 79 | {{- with .Values.volumeMounts }} 80 | {{- toYaml . | nindent 12 }} 81 | {{- end }} 82 | volumes: 83 | - name: config 84 | configMap: 85 | name: {{ include "signoz-otel-gateway.fullname" . }} 86 | {{- with .Values.volumes }} 87 | {{- toYaml . | nindent 8 }} 88 | {{- end }} 89 | {{- with .Values.nodeSelector }} 90 | nodeSelector: 91 | {{- toYaml . | nindent 8 }} 92 | {{- end }} 93 | {{- with .Values.affinity }} 94 | affinity: 95 | {{- toYaml . | nindent 8 }} 96 | {{- end }} 97 | {{- with .Values.tolerations }} 98 | tolerations: 99 | {{- toYaml . | nindent 8 }} 100 | {{- end }} 101 | -------------------------------------------------------------------------------- /charts/signoz-otel-gateway/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- $genericConfig := dict -}} 2 | {{- $_ := set $genericConfig "fullName" (include "signoz-otel-gateway.fullname" .) -}} 3 | {{- $_ := set $genericConfig "namespace" .Release.Namespace -}} 4 | {{- $_ := set $genericConfig "labels" (include "signoz-otel-gateway.labels" .) -}} 5 | 6 | {{- range $key, $value := .Values.ingress }} 7 | {{- $config := mustDeepCopy $genericConfig -}} 8 | {{- $_ := set $config "name" $value.name -}} 9 | {{- $_ := set $config "annotations" $value.annotations -}} 10 | {{- $_ := set $config "ingressClassName" $value.ingressClassName -}} 11 | {{- $_ := set $config "hosts" $value.hosts -}} 12 | {{- $_ := set $config "paths" $value.paths -}} 13 | {{- $_ := set $config "tls" $value.tls -}} 14 | {{- include "signoz-otel-gateway.ingress" $config -}} 15 | {{- end }} 16 | 17 | 18 | {{- define "signoz-otel-gateway.ingress" }} 19 | --- 20 | apiVersion: networking.k8s.io/v1 21 | kind: Ingress 22 | metadata: 23 | name: {{ .fullName }}-{{ .name }} 24 | labels: 25 | {{- .labels | nindent 4 }} 26 | {{- with .annotations }} 27 | annotations: 28 | {{- range $key, $value := . }} 29 | {{ $key }}: {{ $value | quote }} 30 | {{- end }} 31 | {{- end }} 32 | spec: 33 | ingressClassName: {{ .ingressClassName }} 34 | {{- with .tls }} 35 | tls: 36 | {{- toYaml . | nindent 4 }} 37 | {{- end }} 38 | rules: 39 | {{- range .hosts }} 40 | - host: {{ .host | quote }} 41 | http: 42 | paths: 43 | {{- range .paths }} 44 | - path: {{ .path }} 45 | pathType: {{ .pathType }} 46 | backend: 47 | service: 48 | name: {{ $.fullName }} 49 | port: 50 | number: {{ .port }} 51 | {{- end }} 52 | {{- end }} 53 | {{- end }} 54 | -------------------------------------------------------------------------------- /charts/signoz-otel-gateway/templates/secrets.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.externalSecrets.create }} 2 | 3 | {{- $genericConfig := dict -}} 4 | {{- $_ := set $genericConfig "fullName" (include "signoz-otel-gateway.fullname" .) -}} 5 | {{- $_ := set $genericConfig "namespace" .Release.Namespace -}} 6 | {{- $_ := set $genericConfig "labels" (include "signoz-otel-gateway.labels" .) -}} 7 | {{- $_ := set $genericConfig "secretStoreKind" .Values.externalSecrets.secretStoreRef.kind -}} 8 | {{- $_ := set $genericConfig "secretStoreName" .Values.externalSecrets.secretStoreRef.name -}} 9 | 10 | {{- range $key, $value := .Values.externalSecrets.secrets }} 11 | {{- $config := mustDeepCopy $genericConfig -}} 12 | {{- $_ := set $config "name" $key -}} 13 | {{- $_ := set $config "dataFrom" $value.dataFrom -}} 14 | {{- include "signoz-otel-gateway.secret" $config -}} 15 | {{- end }} 16 | 17 | {{- end }} 18 | 19 | {{- define "signoz-otel-gateway.secret" }} 20 | --- 21 | apiVersion: external-secrets.io/v1beta1 22 | kind: ExternalSecret 23 | metadata: 24 | name: {{ .fullName }}-{{ .name }} 25 | namespace: {{ .namespace }} 26 | labels: 27 | {{- .labels | nindent 4 }} 28 | spec: 29 | secretStoreRef: 30 | kind: {{ required "externalSecrets.secretStoreRef.kind is required" .secretStoreKind }} 31 | name: {{ required "externalSecrets.secretStoreRef.name is required" .secretStoreName }} 32 | target: 33 | name: {{ .fullName }}-{{ .name }} 34 | creationPolicy: Owner 35 | dataFrom: 36 | - extract: 37 | key: {{ .dataFrom | required "externalSecrets.secrets.dataFrom is required" }} 38 | {{- end }} 39 | -------------------------------------------------------------------------------- /charts/signoz-otel-gateway/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | {{- if .Values.service.annotations }} 5 | annotations: 6 | {{- range $key, $value := .Values.service.annotations }} 7 | {{ $key }}: {{ $value | quote }} 8 | {{- end }} 9 | {{- end }} 10 | name: {{ include "signoz-otel-gateway.fullname" . }} 11 | labels: 12 | {{- include "signoz-otel-gateway.labels" . | nindent 4 }} 13 | spec: 14 | type: {{ .Values.service.type }} 15 | ports: 16 | {{- include "signoz-otel-gateway.ports" . | indent 4 }} 17 | selector: 18 | {{- include "signoz-otel-gateway.selectorLabels" . | nindent 4 }} 19 | -------------------------------------------------------------------------------- /charts/signoz-otel-gateway/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "signoz-otel-gateway.serviceAccountName" . }} 6 | labels: 7 | {{- include "signoz-otel-gateway.labels" . | nindent 4 }} 8 | {{- with .Values.serviceAccount.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | automountServiceAccountToken: {{ .Values.serviceAccount.automount }} 13 | {{- end }} 14 | -------------------------------------------------------------------------------- /charts/signoz-otel-gateway/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for signoz-otel-gateway. 2 | replicaCount: 1 3 | image: 4 | repository: docker.io/signoz/signoz-otel-gateway 5 | pullPolicy: IfNotPresent 6 | # Overrides the image tag whose default is the chart appVersion. 7 | tag: "" 8 | imagePullSecrets: [] 9 | nameOverride: "" 10 | fullnameOverride: "" 11 | serviceAccount: 12 | # Specifies whether a service account should be created 13 | create: true 14 | # Automatically mount a ServiceAccount's API credentials? 15 | automount: true 16 | # Annotations to add to the service account 17 | annotations: {} 18 | # The name of the service account to use. 19 | # If not set and create is true, a name is generated using the fullname template 20 | name: "" 21 | podAnnotations: {} 22 | podLabels: {} 23 | podSecurityContext: {} 24 | # fsGroup: 2000 25 | 26 | securityContext: {} 27 | # capabilities: 28 | # drop: 29 | # - ALL 30 | # readOnlyRootFilesystem: true 31 | # runAsNonRoot: true 32 | # runAsUser: 1000 33 | 34 | service: 35 | type: ClusterIP 36 | annotations: {} 37 | ports: 38 | healthz: 39 | enabled: true 40 | containerPort: 13133 41 | servicePort: 13133 42 | protocol: TCP 43 | signoz-admin: 44 | enabled: true 45 | containerPort: 8001 46 | servicePort: 8001 47 | protocol: TCP 48 | otlp-grpc: 49 | enabled: true 50 | containerPort: 4317 51 | servicePort: 4317 52 | protocol: TCP 53 | otlp-http: 54 | enabled: true 55 | containerPort: 4318 56 | servicePort: 4318 57 | protocol: TCP 58 | metrics: 59 | enabled: true 60 | containerPort: 8888 61 | servicePort: 8888 62 | protocol: TCP 63 | httplog-heroku: 64 | enabled: true 65 | containerPort: 8081 66 | servicePort: 8081 67 | protocol: TCP 68 | httplog-json: 69 | enabled: true 70 | containerPort: 8082 71 | servicePort: 8082 72 | protocol: TCP 73 | resources: {} 74 | # We usually recommend not to specify default resources and to leave this as a conscious 75 | # choice for the user. This also increases chances charts run on environments with little 76 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 77 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 78 | # limits: 79 | # cpu: 100m 80 | # memory: 128Mi 81 | # requests: 82 | # cpu: 100m 83 | # memory: 128Mi 84 | 85 | livenessProbe: 86 | httpGet: 87 | path: /healthz 88 | port: 13133 89 | initialDelaySeconds: 5 90 | periodSeconds: 10 91 | timeoutSeconds: 5 92 | failureThreshold: 6 93 | successThreshold: 1 94 | readinessProbe: 95 | httpGet: 96 | path: /healthz 97 | port: 13133 98 | initialDelaySeconds: 5 99 | periodSeconds: 10 100 | timeoutSeconds: 5 101 | failureThreshold: 6 102 | successThreshold: 1 103 | # Additional volumes on the output Deployment definition. 104 | volumes: [] 105 | # - name: foo 106 | # secret: 107 | # secretName: mysecret 108 | # optional: false 109 | 110 | # Additional volumeMounts on the output Deployment definition. 111 | volumeMounts: [] 112 | # - name: foo 113 | # mountPath: "/etc/foo" 114 | # readOnly: true 115 | 116 | nodeSelector: {} 117 | tolerations: [] 118 | affinity: {} 119 | # Define env as key value pairs 120 | env: {} 121 | args: {} 122 | # - 123 | 124 | config: 125 | # Create the config map 126 | create: true 127 | # Set the values of the config map 128 | # extensions: 129 | # health_check: 130 | # receivers: 131 | # otlp: 132 | # protocols: 133 | # grpc: 134 | # endpoint: 0.0.0.0:4317 135 | # include_metadata: true 136 | # max_recv_msg_size_mib: 16 137 | # http: 138 | # cors: 139 | # allowed_origins: 140 | # - '*' 141 | # endpoint: 0.0.0.0:4318 142 | # include_metadata: true 143 | # processors: 144 | # batch: 145 | # send_batch_max_size: 10000 146 | # send_batch_size: 10000 147 | # timeout: 10s 148 | # memory_limiter: null 149 | # exporters: 150 | # debug: {} 151 | # service: 152 | # extensions: 153 | # - health_check 154 | # pipelines: 155 | # logs: 156 | # exporters: 157 | # - debug 158 | # processors: 159 | # - memory_limiter 160 | # - batch 161 | # receivers: 162 | # - otlp 163 | # metrics: 164 | # exporters: 165 | # - debug 166 | # processors: 167 | # - memory_limiter 168 | # - batch 169 | # receivers: 170 | # - otlp 171 | # traces: 172 | # exporters: 173 | # - debug 174 | # processors: 175 | # - memory_limiter 176 | # - batch 177 | # receivers: 178 | # - otlp 179 | 180 | externalSecrets: 181 | # Add integration with external secrets 182 | create: false 183 | secretStoreRef: 184 | kind: ClusterSecretStore 185 | name: cluster-secret-store 186 | # Add secrets here 187 | # secrets: 188 | # # Name of the secret to be created 189 | # secret-1: 190 | # # Name of the secret in the cluster store, for example, in secrets manager 191 | # dataFrom: name-of-secret 192 | # env: 193 | # # The env variable to mount it as: the key from the secret to use 194 | # postgres_host: host 195 | 196 | ingress: 197 | - name: healthz 198 | ingressClassName: nginx 199 | annotations: {} 200 | hosts: 201 | - host: gateway.example.com 202 | paths: 203 | - path: /healthz 204 | pathType: ImplementationSpecific 205 | port: 13133 206 | tls: 207 | - secretName: gateway-tls 208 | hosts: 209 | - gateway.example.com 210 | - name: http 211 | ingressClassName: nginx 212 | annotations: {} 213 | hosts: 214 | - host: gateway.example.com 215 | paths: 216 | - path: /v1/logs 217 | pathType: ImplementationSpecific 218 | port: 4318 219 | - path: /v1/metrics 220 | pathType: ImplementationSpecific 221 | port: 4318 222 | - path: /v1/traces 223 | pathType: ImplementationSpecific 224 | port: 4318 225 | - host: gateway.example.com 226 | paths: 227 | - path: /logs/json 228 | pathType: ImplementationSpecific 229 | port: 8082 230 | - host: gateway.example.com 231 | paths: 232 | - path: /logs/heroku 233 | pathType: ImplementationSpecific 234 | port: 8081 235 | - name: grpc 236 | ingressClassName: nginx 237 | annotations: 238 | nginx.ingress.kubernetes.io/backend-protocol: "GRPC" 239 | hosts: 240 | - host: gateway.example.com 241 | paths: 242 | - path: /opentelemetry.proto.collector.logs.v1.LogsService/Export 243 | pathType: ImplementationSpecific 244 | port: 4317 245 | - path: /opentelemetry.proto.collector.metrics.v1.MetricsService/Export 246 | pathType: ImplementationSpecific 247 | port: 4317 248 | - path: /opentelemetry.proto.collector.trace.v1.TraceService/Export 249 | pathType: ImplementationSpecific 250 | port: 4317 251 | postgresql: 252 | enabled: false 253 | auth: 254 | username: otelgateway 255 | password: password 256 | database: otelgateway 257 | image: 258 | tag: 15.0.0 259 | service: 260 | ports: 261 | postgresql: "5432" 262 | -------------------------------------------------------------------------------- /charts/signoz/Chart.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: clickhouse 3 | repository: https://charts.signoz.io 4 | version: 24.1.15 5 | - name: signoz-otel-gateway 6 | repository: https://charts.signoz.io 7 | version: 0.0.1 8 | digest: sha256:6e9bc26aaa42990986a4564c9209f1d469e2d227f40eec8f153c3258753aea94 9 | generated: "2025-01-29T18:12:34.847081+05:30" 10 | -------------------------------------------------------------------------------- /charts/signoz/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: signoz 3 | version: 0.83.2 4 | appVersion: "v0.86.2" 5 | description: SigNoz Observability Platform Helm Chart 6 | type: application 7 | home: https://signoz.io/ 8 | icon: https://signoz.io/img/SigNozLogo-orange.svg 9 | keywords: 10 | - SigNoz 11 | - opentelemetry 12 | - apm 13 | - monitoring 14 | - distributed tracing 15 | - distributed logging 16 | sources: 17 | - https://github.com/signoz/charts 18 | - https://github.com/signoz/signoz 19 | - https://github.com/signoz/signoz-otel-collector 20 | dependencies: 21 | - name: clickhouse 22 | repository: https://charts.signoz.io 23 | condition: clickhouse.enabled 24 | version: 24.1.15 25 | - name: signoz-otel-gateway 26 | repository: https://charts.signoz.io 27 | condition: signoz-otel-gateway.enabled 28 | version: 0.0.1 29 | maintainers: 30 | - name: SigNoz 31 | email: hello@signoz.io 32 | url: https://signoz.io 33 | - name: prashant-shahi 34 | email: prashant@signoz.io 35 | url: https://prashantshahi.dev 36 | -------------------------------------------------------------------------------- /charts/signoz/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | 1. You have just deployed SigNoz cluster: 2 | 3 | - signoz version: '{{ .Values.signoz.image.tag }}' 4 | - otel-collector version: '{{ .Values.otelCollector.image.tag }}' 5 | 6 | 2. Get the application URL by running these commands: 7 | 8 | {{- if .Values.signoz.ingress.enabled -}} 9 | {{- range $host := .Values.signoz.ingress.hosts }} 10 | 11 | {{- range .paths }} 12 | http{{ if $.Values.signoz.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} 13 | {{- end }} 14 | 15 | {{- end }} 16 | {{- else if contains "NodePort" .Values.signoz.service.type }} 17 | 18 | export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "signoz.fullname" . }}) 19 | export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") 20 | echo http://$NODE_IP:$NODE_PORT 21 | 22 | {{- else if contains "LoadBalancer" .Values.signoz.service.type }} 23 | 24 | NOTE: It may take a few minutes for the LoadBalancer IP to be available. 25 | You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "signoz.fullname" . }}' 26 | export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "signoz.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") 27 | echo http://$SERVICE_IP:{{ .Values.signoz.service.port }} 28 | 29 | {{- else if contains "ClusterIP" .Values.signoz.service.type }} 30 | 31 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ .Chart.Name }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component={{ .Values.signoz.name }}" -o jsonpath="{.items[0].metadata.name}") 32 | echo "Visit http://127.0.0.1:{{ .Values.signoz.service.port }} to use your application" 33 | kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME {{ .Values.signoz.service.port }}:{{ .Values.signoz.service.port }} 34 | 35 | {{- end }} 36 | 37 | {{- if .Release.IsUpgrade }} 38 | NOTES: 39 | - We no longer bundle K8s-Infra chart with the SigNoz chart installation. For any existing set up, please install k8s-infra chart separately with the relevant override values. 40 | - OtelCollectorMetrics is no longer bundled with the SigNoz chart and has been removed. See https://github.com/SigNoz/charts/issues/593 for more details. 41 | - Frontend is deprecated and has been removed as it is now bundled with the signoz component. See https://github.com/SigNoz/signoz/issues/6762 for more details. 42 | {{- end }} -------------------------------------------------------------------------------- /charts/signoz/templates/_clickhouse.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Common ClickHouse ENV variables and helpers used by SigNoz 3 | */}} 4 | 5 | {{- define "schemamigrator.url" -}} 6 | {{- if .Values.clickhouse.enabled -}} 7 | {{- printf "%v:%v" ( include "clickhouse.servicename" . ) ( include "clickhouse.tcpPort" . ) -}} 8 | {{- else -}} 9 | {{- printf "%v:%v" ( required "externalClickhouse.host is required if not clickhouse.enabled" .Values.externalClickhouse.host ) ( default 9000 .Values.externalClickhouse.tcpPort ) -}} 10 | {{- end -}} 11 | {{- end -}} 12 | 13 | {{- define "snippet.clickhouse-env" }} 14 | {{- if .Values.clickhouse.enabled -}} 15 | - name: CLICKHOUSE_HOST 16 | value: {{ include "clickhouse.servicename" . }} 17 | - name: CLICKHOUSE_PORT 18 | value: {{ include "clickhouse.tcpPort" . | quote }} 19 | - name: CLICKHOUSE_HTTP_PORT 20 | value: {{ include "clickhouse.httpPort" . | quote }} 21 | - name: CLICKHOUSE_CLUSTER 22 | value: {{ .Values.clickhouse.cluster | quote }} 23 | - name: CLICKHOUSE_DATABASE 24 | value: {{ default "signoz_metrics" .Values.clickhouse.database | quote }} 25 | - name: CLICKHOUSE_TRACE_DATABASE 26 | value: {{ default "signoz_traces" .Values.clickhouse.traceDatabase | quote }} 27 | - name: CLICKHOUSE_LOG_DATABASE 28 | value: {{ default "signoz_logs" .Values.clickhouse.logDatabase | quote }} 29 | - name: CLICKHOUSE_USER 30 | value: {{ .Values.clickhouse.user | quote }} 31 | - name: CLICKHOUSE_PASSWORD 32 | value: {{ .Values.clickhouse.password | quote }} 33 | - name: CLICKHOUSE_SECURE 34 | value: {{ .Values.clickhouse.secure | quote }} 35 | - name: CLICKHOUSE_VERIFY 36 | value: {{ .Values.clickhouse.verify | quote }} 37 | {{- else -}} 38 | - name: CLICKHOUSE_HOST 39 | value: {{ required "externalClickhouse.host is required if not clickhouse.enabled" .Values.externalClickhouse.host | quote }} 40 | - name: CLICKHOUSE_PORT 41 | value: {{ default 9000 .Values.externalClickhouse.tcpPort | quote }} 42 | - name: CLICKHOUSE_HTTP_PORT 43 | value: {{ default 8123 .Values.externalClickhouse.httpPort | quote }} 44 | - name: CLICKHOUSE_CLUSTER 45 | value: {{ required "externalClickhouse.cluster is required if not clickhouse.enabled" .Values.externalClickhouse.cluster | quote }} 46 | - name: CLICKHOUSE_DATABASE 47 | value: {{ default "signoz_metrics" .Values.externalClickhouse.database | quote }} 48 | - name: CLICKHOUSE_TRACE_DATABASE 49 | value: {{ default "signoz_traces" .Values.externalClickhouse.traceDatabase | quote }} 50 | - name: CLICKHOUSE_LOG_DATABASE 51 | value: {{ default "signoz_logs" .Values.externalClickhouse.logDatabase | quote }} 52 | - name: CLICKHOUSE_USER 53 | value: {{ .Values.externalClickhouse.user | quote }} 54 | {{- if .Values.externalClickhouse.existingSecret }} 55 | - name: CLICKHOUSE_PASSWORD 56 | valueFrom: 57 | secretKeyRef: 58 | name: {{ include "clickhouse.secretName" . }} 59 | key: {{ include "clickhouse.secretPasswordKey" . }} 60 | {{- else }} 61 | - name: CLICKHOUSE_PASSWORD 62 | value: {{ .Values.externalClickhouse.password | quote }} 63 | {{- end }} 64 | - name: CLICKHOUSE_SECURE 65 | value: {{ .Values.externalClickhouse.secure | quote }} 66 | - name: CLICKHOUSE_VERIFY 67 | value: {{ .Values.externalClickhouse.verify | quote }} 68 | {{- end }} 69 | {{- end }} 70 | 71 | {{/* 72 | Minimized ClickHouse ENV variables for user credentials 73 | */}} 74 | {{- define "snippet.clickhouse-credentials" }} 75 | {{ if .Values.clickhouse.enabled -}} 76 | - name: CLICKHOUSE_HOST 77 | value: {{ include "clickhouse.servicename" . }} 78 | - name: CLICKHOUSE_PORT 79 | value: {{ include "clickhouse.tcpPort" . | quote }} 80 | - name: CLICKHOUSE_HTTP_PORT 81 | value: {{ include "clickhouse.httpPort" . | quote }} 82 | - name: CLICKHOUSE_CLUSTER 83 | value: {{ .Values.clickhouse.cluster | quote }} 84 | - name: CLICKHOUSE_USER 85 | value: {{ .Values.clickhouse.user | quote }} 86 | - name: CLICKHOUSE_PASSWORD 87 | value: {{ .Values.clickhouse.password | quote }} 88 | - name: CLICKHOUSE_SECURE 89 | value: {{ .Values.clickhouse.secure | quote }} 90 | {{- else -}} 91 | - name: CLICKHOUSE_HOST 92 | value: {{ required "externalClickhouse.host is required if not clickhouse.enabled" .Values.externalClickhouse.host | quote }} 93 | - name: CLICKHOUSE_PORT 94 | value: {{ default 9000 .Values.externalClickhouse.tcpPort | quote }} 95 | - name: CLICKHOUSE_HTTP_PORT 96 | value: {{ default 8123 .Values.externalClickhouse.httpPort | quote }} 97 | - name: CLICKHOUSE_CLUSTER 98 | value: {{ required "externalClickhouse.cluster is required if not clickhouse.enabled" .Values.externalClickhouse.cluster | quote }} 99 | - name: CLICKHOUSE_USER 100 | value: {{ .Values.externalClickhouse.user | quote }} 101 | {{- if .Values.externalClickhouse.existingSecret }} 102 | - name: CLICKHOUSE_PASSWORD 103 | valueFrom: 104 | secretKeyRef: 105 | name: {{ include "clickhouse.secretName" . }} 106 | key: {{ include "clickhouse.secretPasswordKey" . }} 107 | {{- else }} 108 | - name: CLICKHOUSE_PASSWORD 109 | value: {{ .Values.externalClickhouse.password | quote }} 110 | {{- end }} 111 | - name: CLICKHOUSE_SECURE 112 | value: {{ .Values.externalClickhouse.secure | quote }} 113 | {{- end }} 114 | {{- end }} 115 | 116 | {* 117 | ------ CLICKHOUSE ------ 118 | *} 119 | 120 | {{/* 121 | Set Clickhouse tcp port 122 | */}} 123 | {{- define "clickhouse.tcpPort" -}} 124 | {{- if .Values.clickhouse.enabled }} 125 | {{- default 9000 .Values.clickhouse.service.tcpPort }} 126 | {{- else }} 127 | {{- default 9000 .Values.externalClickhouse.tcpPort }} 128 | {{- end }} 129 | {{- end -}} 130 | 131 | {{/* 132 | Set Clickhouse http port 133 | */}} 134 | {{- define "clickhouse.httpPort" -}} 135 | {{- if .Values.clickhouse.enabled }} 136 | {{- default 8123 .Values.clickhouse.service.httpPort }} 137 | {{- else }} 138 | {{- default 8123 .Values.externalClickhouse.httpPort }} 139 | {{- end }} 140 | {{- end -}} 141 | 142 | {{/* 143 | Return true if a secret object for ClickHouse should be created 144 | */}} 145 | {{- define "clickhouse.createSecret" -}} 146 | {{- if and (not .Values.clickhouse.enabled) (not .Values.externalClickhouse.existingSecret) .Values.externalClickhouse.password }} 147 | {{- true -}} 148 | {{- end -}} 149 | {{- end -}} 150 | 151 | {{/* 152 | Return the ClickHouse secret name 153 | */}} 154 | {{- define "clickhouse.secretName" -}} 155 | {{- if .Values.externalClickhouse.existingSecret }} 156 | {{- .Values.externalClickhouse.existingSecret | quote -}} 157 | {{- else -}} 158 | {{- printf "%s-external" ( include "clickhouse.servicename" .) -}} 159 | {{- end -}} 160 | {{- end -}} 161 | 162 | {{/* 163 | Return the ClickHouse secret key 164 | */}} 165 | {{- define "clickhouse.secretPasswordKey" -}} 166 | {{- if .Values.externalClickhouse.existingSecret }} 167 | {{- required "You need to provide existingSecretPasswordKey when an existingSecret is specified in externalClickhouse" .Values.externalClickhouse.existingSecretPasswordKey | quote }} 168 | {{- else -}} 169 | {{- printf "clickhouse-password" -}} 170 | {{- end -}} 171 | {{- end -}} 172 | 173 | {{/* 174 | Return the external ClickHouse password 175 | */}} 176 | {{- define "clickhouse.externalPasswordKey" -}} 177 | {{- if .Values.externalClickhouse.password }} 178 | {{- required "externalClickhouse.password is required if using external clickhouse" .Values.externalClickhouse.password -}} 179 | {{- end -}} 180 | {{- end -}} 181 | 182 | {{/* 183 | Return the ClickHouse http URL 184 | */}} 185 | {{- define "clickhouse.httpUrl" -}} 186 | {{- $httpUrl := "" -}} 187 | {{- $httpPrefix := "" -}} 188 | {{- if .Values.clickhouse.enabled }} 189 | {{- $httpUrl = printf "%s:%s" (include "clickhouse.servicename" .) (include "clickhouse.httpPort" .) }} 190 | {{- if .Values.clickhouse.secure }} 191 | {{- $httpPrefix = "https://" }} 192 | {{- end }} 193 | {{- else }} 194 | {{- $httpUrl = printf "%s:%s" (required "externalClickhouse.host is required if using external clickhouse" .Values.externalClickhouse.host) ( include "clickhouse.httpPort" .) }} 195 | {{- if .Values.externalClickhouse.secure }} 196 | {{- $httpPrefix = "https://" }} 197 | {{- end }} 198 | {{- end }} 199 | {{- printf "%s%s" $httpPrefix $httpUrl }} 200 | {{- end -}} 201 | 202 | {{/* 203 | Return the ClickHouse Metrics URL 204 | */}} 205 | {{- define "clickhouse.metricsUrl" -}} 206 | {{- if .Values.clickhouse.enabled -}} 207 | tcp://{{ .Values.clickhouse.user }}:{{ .Values.clickhouse.password }}@{{ include "clickhouse.servicename" . }}:{{ include "clickhouse.tcpPort" . }}/{{ .Values.clickhouse.database -}} 208 | {{- else -}} 209 | tcp://{{ .Values.externalClickhouse.user }}:{{ include "clickhouse.externalPasswordKey" . }}@{{- required "externalClickhouse.host is required if using external clickhouse" .Values.externalClickhouse.host }}:{{ include "clickhouse.tcpPort" . }}/{{ .Values.externalClickhouse.database -}} 210 | {{- end -}} 211 | {{- end -}} 212 | 213 | {{/* 214 | Return the ClickHouse Traces URL 215 | */}} 216 | {{- define "clickhouse.tracesUrl" -}} 217 | {{- if .Values.clickhouse.enabled -}} 218 | tcp://{{ .Values.clickhouse.user }}:{{ .Values.clickhouse.password }}@{{ include "clickhouse.servicename" . }}:{{ include "clickhouse.tcpPort" . }}/{{ .Values.clickhouse.traceDatabase -}} 219 | {{- else -}} 220 | tcp://{{ .Values.externalClickhouse.user }}:$(CLICKHOUSE_PASSWORD)@{{ required "externalClickhouse.host is required if using external clickhouse" .Values.externalClickhouse.host }}:{{ include "clickhouse.tcpPort" . }}/{{ .Values.externalClickhouse.traceDatabase -}} 221 | {{- end -}} 222 | {{- end -}} 223 | 224 | {{- define "clickhouse.clickHouseUrl" -}} 225 | {{- if .Values.clickhouse.enabled -}} 226 | {{- include "clickhouse.servicename" . }}:{{ include "clickhouse.tcpPort" . }}/?username={{ .Values.clickhouse.user }}&password={{ .Values.clickhouse.password -}} 227 | {{- else -}} 228 | {{- required "externalClickhouse.host is required if using external clickhouse" .Values.externalClickhouse.host }}:{{ include "clickhouse.tcpPort" . }}/?username={{ .Values.externalClickhouse.user }}&password=$(CLICKHOUSE_PASSWORD) 229 | {{- end -}} 230 | {{- end -}} -------------------------------------------------------------------------------- /charts/signoz/templates/otel-collector/clusterrole.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelCollector.clusterRole.create -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: {{ include "otelCollector.clusterRoleName" . }} 6 | namespace: {{ include "signoz.namespace" . }} 7 | {{- with .Values.otelCollector.clusterRole.annotations }} 8 | annotations: 9 | {{- toYaml . | nindent 4 }} 10 | {{- end }} 11 | rules: {{ toYaml .Values.otelCollector.clusterRole.rules | nindent 2 -}} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /charts/signoz/templates/otel-collector/clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelCollector.clusterRole.create -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRoleBinding 4 | metadata: 5 | name: {{ include "otelCollector.clusterRoleBindingName" . }} 6 | namespace: {{ include "signoz.namespace" . }} 7 | roleRef: 8 | apiGroup: rbac.authorization.k8s.io 9 | kind: ClusterRole 10 | name: {{ include "otelCollector.clusterRoleName" . }} 11 | subjects: 12 | - name: {{ include "otelCollector.serviceAccountName" . }} 13 | kind: ServiceAccount 14 | namespace: {{ include "signoz.namespace" . }} 15 | {{- end }} 16 | -------------------------------------------------------------------------------- /charts/signoz/templates/otel-collector/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ include "otelCollector.fullname" . }} 5 | labels: 6 | {{- include "otelCollector.labels" . | nindent 4 }} 7 | data: 8 | otel-collector-config.yaml: |- 9 | {{- toYaml .Values.otelCollector.config | nindent 4 }} 10 | otel-collector-opamp-config.yaml: |- 11 | server_endpoint: "ws://{{ include "signoz.fullname" . }}:4320/v1/opamp" 12 | -------------------------------------------------------------------------------- /charts/signoz/templates/otel-collector/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ include "otelCollector.fullname" . }} 5 | labels: 6 | {{- include "otelCollector.labels" . | nindent 4 }} 7 | {{- if .Values.otelCollector.annotations }} 8 | annotations: 9 | {{ toYaml .Values.otelCollector.annotations | nindent 4 }} 10 | {{- end }} 11 | spec: 12 | selector: 13 | matchLabels: 14 | {{- include "otelCollector.selectorLabels" . | nindent 6 }} 15 | minReadySeconds: {{ .Values.otelCollector.minReadySeconds }} 16 | progressDeadlineSeconds: {{ .Values.otelCollector.progressDeadlineSeconds }} 17 | {{- if not .Values.otelCollector.autoscaling.enabled }} 18 | replicas: {{ .Values.otelCollector.replicaCount }} 19 | {{- end }} 20 | template: 21 | metadata: 22 | annotations: 23 | {{- with .Values.otelCollector.podAnnotations }} 24 | {{- toYaml . | nindent 8 }} 25 | {{- end }} 26 | checksum/config: {{ include (print $.Template.BasePath "/otel-collector/configmap.yaml") . | sha256sum }} 27 | labels: 28 | {{- include "otelCollector.selectorLabels" . | nindent 8 }} 29 | {{- with .Values.otelCollector.podLabels }} 30 | {{- toYaml . | nindent 8 }} 31 | {{- end }} 32 | spec: 33 | {{- with .Values.otelCollector.imagePullSecrets }} 34 | imagePullSecrets: 35 | {{- range . }} 36 | - name: {{ . | quote }} 37 | {{- end }} 38 | {{- end }} 39 | serviceAccountName: {{ include "otelCollector.serviceAccountName" . }} 40 | priorityClassName: {{ .Values.otelCollector.priorityClassName | quote }} 41 | {{- with .Values.otelCollector.nodeSelector }} 42 | nodeSelector: 43 | {{- toYaml . | nindent 8 }} 44 | {{- end }} 45 | {{- with .Values.otelCollector.affinity }} 46 | affinity: 47 | {{- toYaml . | nindent 8 }} 48 | {{- end }} 49 | {{- with .Values.otelCollector.tolerations }} 50 | tolerations: 51 | {{- toYaml . | nindent 8 }} 52 | {{- end }} 53 | {{- with .Values.otelCollector.topologySpreadConstraints }} 54 | topologySpreadConstraints: {{ toYaml . | nindent 8 }} 55 | {{- end }} 56 | securityContext: 57 | {{- toYaml .Values.otelCollector.podSecurityContext | nindent 8 }} 58 | # todo: add k8s-wait-for initContainer here 59 | # this initContainer waits for the schema migrator job to finish 60 | initContainers: 61 | {{- if .Values.schemaMigrator.enabled }} 62 | - name: "{{ include "otelCollector.fullname" . }}-migrate-init" 63 | image: {{ include "schemaMigrator.initContainers.wait.image" . }} 64 | imagePullPolicy: {{ .Values.schemaMigrator.initContainers.wait.image.pullPolicy }} 65 | args: 66 | - "job" 67 | {{- if .Release.IsInstall }} 68 | - "{{ include "schemaMigrator.fullname" . }}-sync-init" 69 | {{- else }} 70 | - "{{ include "schemaMigrator.fullname" . }}-sync" 71 | {{- end }} 72 | {{- end }} 73 | {{- if .Values.otelCollector.initContainers.init.enabled }} 74 | - name: {{ include "otelCollector.fullname" . }}-init 75 | image: {{ include "otelCollector.initContainers.init.image" . }} 76 | imagePullPolicy: {{ .Values.otelCollector.initContainers.init.image.pullPolicy }} 77 | env: 78 | {{- include "snippet.clickhouse-credentials" . | nindent 12 }} 79 | {{- with .Values.otelCollector.initContainers.init.command }} 80 | command: 81 | - sh 82 | - -c 83 | - until wget --user "${CLICKHOUSE_USER}:${CLICKHOUSE_PASSWORD}" --spider -q {{ include "clickhouse.httpUrl" $ }}{{ .endpoint }}; do echo -e "{{ .waitMessage }}"; sleep {{ .delay }}; done; echo -e "{{ .doneMessage }}"; 84 | {{- end }} 85 | resources: 86 | {{- toYaml .Values.otelCollector.initContainers.init.resources | nindent 12 }} 87 | {{- end }} 88 | containers: 89 | - name: collector 90 | image: {{ template "otelCollector.image" . }} 91 | imagePullPolicy: {{ .Values.otelCollector.image.pullPolicy }} 92 | ports: 93 | {{- range $key, $port := .Values.otelCollector.ports }} 94 | {{- if $port.enabled }} 95 | - name: {{ $key }} 96 | containerPort: {{ $port.containerPort }} 97 | protocol: {{ $port.protocol }} 98 | {{- end }} 99 | {{- end }} 100 | {{- with .Values.otelCollector.command.name }} 101 | command: 102 | - {{ . | quote }} 103 | {{- end }} 104 | args: 105 | {{- if .Values.otelCollector.configMap.create }} 106 | - "--config=/conf/otel-collector-config.yaml" 107 | - "--manager-config=/conf/otel-collector-opamp-config.yaml" 108 | - "--copy-path=/var/tmp/collector-config.yaml" 109 | {{- end }} 110 | {{- range .Values.otelCollector.command.extraArgs }} 111 | - {{ . | quote }} 112 | {{- end }} 113 | {{- with .Values.otelCollector.securityContext }} 114 | securityContext: 115 | {{- toYaml . | nindent 12 }} 116 | {{- end }} 117 | env: 118 | {{- include "snippet.clickhouse-env" . | nindent 12 }} 119 | {{- include "snippet.k8s-env" . | nindent 12 }} 120 | - name: LOW_CARDINAL_EXCEPTION_GROUPING 121 | value: {{ default "false" .Values.otelCollector.lowCardinalityExceptionGrouping | quote }} 122 | {{- range $key, $val := .Values.otelCollector.additionalEnvs }} 123 | - name: {{ $key }} 124 | value: {{ $val | toYaml }} 125 | {{- end }} 126 | volumeMounts: 127 | - name: otel-collector-config-vol 128 | mountPath: /conf 129 | {{- if .Values.otelCollector.extraVolumeMounts }} 130 | {{ toYaml .Values.otelCollector.extraVolumeMounts | nindent 12 }} 131 | {{- end }} 132 | # - name: otel-collector-secrets 133 | # mountPath: /secrets 134 | {{- if .Values.otelCollector.livenessProbe.enabled }} 135 | livenessProbe: 136 | httpGet: 137 | port: {{ .Values.otelCollector.livenessProbe.port }} 138 | path: {{ .Values.otelCollector.livenessProbe.path }} 139 | initialDelaySeconds: {{ .Values.otelCollector.livenessProbe.initialDelaySeconds }} 140 | periodSeconds: {{ .Values.otelCollector.livenessProbe.periodSeconds }} 141 | timeoutSeconds: {{ .Values.otelCollector.livenessProbe.timeoutSeconds }} 142 | successThreshold: {{ .Values.otelCollector.livenessProbe.successThreshold }} 143 | failureThreshold: {{ .Values.otelCollector.livenessProbe.failureThreshold }} 144 | {{- else if .Values.otelCollector.customLivenessProbe }} 145 | livenessProbe: {{- toYaml .Values.otelCollector.customLivenessProbe | nindent 12 }} 146 | {{- end }} 147 | {{- if .Values.otelCollector.readinessProbe.enabled }} 148 | readinessProbe: 149 | httpGet: 150 | port: {{ .Values.otelCollector.readinessProbe.port }} 151 | path: {{ .Values.otelCollector.readinessProbe.path }} 152 | initialDelaySeconds: {{ .Values.otelCollector.readinessProbe.initialDelaySeconds }} 153 | periodSeconds: {{ .Values.otelCollector.readinessProbe.periodSeconds }} 154 | timeoutSeconds: {{ .Values.otelCollector.readinessProbe.timeoutSeconds }} 155 | successThreshold: {{ .Values.otelCollector.readinessProbe.successThreshold }} 156 | failureThreshold: {{ .Values.otelCollector.readinessProbe.failureThreshold }} 157 | {{- else if .Values.otelCollector.customReadinessProbe }} 158 | readinessProbe: {{- toYaml .Values.otelCollector.customReadinessProbe | nindent 12 }} 159 | {{- end }} 160 | resources: 161 | {{- toYaml .Values.otelCollector.resources | nindent 12 }} 162 | volumes: 163 | - name: otel-collector-config-vol 164 | configMap: 165 | name: {{ include "otelCollector.fullname" . }} 166 | {{- if .Values.otelCollector.extraVolumes }} 167 | {{ toYaml .Values.otelCollector.extraVolumes | nindent 8 }} 168 | {{- end }} 169 | # - secret: 170 | # name: otel-collector-secrets 171 | # items: 172 | # - key: cert.pem 173 | # path: cert.pem 174 | # - key: key.pem 175 | # path: key.pem 176 | -------------------------------------------------------------------------------- /charts/signoz/templates/otel-collector/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (.Values.otelCollector.autoscaling.enabled) (not .Values.otelCollector.autoscaling.keda.enabled) -}} 2 | apiVersion: {{ .Capabilities.APIVersions.Has "autoscaling/v2" | ternary "autoscaling/v2" "autoscaling/v2beta2" }} 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ include "otelCollector.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | spec: 8 | scaleTargetRef: 9 | apiVersion: apps/v1 10 | kind: Deployment 11 | name: {{ include "otelCollector.fullname" . }} # Mandatory. Must be in the same namespace as the ScaledObject 12 | minReplicas: {{ .Values.otelCollector.autoscaling.minReplicas }} 13 | maxReplicas: {{ .Values.otelCollector.autoscaling.maxReplicas }} 14 | metrics: 15 | {{- with .Values.otelCollector.autoscaling.targetMemoryUtilizationPercentage }} 16 | - type: Resource 17 | resource: 18 | name: memory 19 | target: 20 | type: Utilization 21 | averageUtilization: {{ . }} 22 | {{- end }} 23 | {{- with .Values.otelCollector.autoscaling.targetCPUUtilizationPercentage }} 24 | - type: Resource 25 | resource: 26 | name: cpu 27 | target: 28 | type: Utilization 29 | averageUtilization: {{ . }} 30 | {{- end }} 31 | {{- with .Values.otelCollector.autoscaling.autoscalingTemplate }} 32 | {{- toYaml . | nindent 2 }} 33 | {{- end }} 34 | {{- with .Values.otelCollector.autoscaling.behavior }} 35 | behavior: 36 | {{- toYaml . | nindent 4 }} 37 | {{- end }} 38 | {{- end }} 39 | -------------------------------------------------------------------------------- /charts/signoz/templates/otel-collector/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelCollector.ingress.enabled -}} 2 | {{- $fullName := include "otelCollector.fullname" . -}} 3 | {{- $ingressApiIsStable := eq (include "ingress.isStable" .) "true" -}} 4 | {{- $ingressSupportsPathType := eq (include "ingress.supportsPathType" .) "true" -}} 5 | apiVersion: {{ include "ingress.apiVersion" . }} 6 | kind: Ingress 7 | metadata: 8 | name: {{ $fullName }} 9 | labels: 10 | {{- include "otelCollector.labels" . | nindent 4 }} 11 | {{- with .Values.otelCollector.ingress.annotations }} 12 | annotations: 13 | {{- toYaml . | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | {{- if and .Values.otelCollector.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} 17 | ingressClassName: {{ .Values.otelCollector.ingress.className }} 18 | {{- end }} 19 | {{- if .Values.otelCollector.ingress.tls }} 20 | tls: 21 | {{- range .Values.otelCollector.ingress.tls }} 22 | - hosts: 23 | {{- range .hosts }} 24 | - {{ . | quote }} 25 | {{- end }} 26 | {{- with .secretName }} 27 | secretName: {{ . }} 28 | {{- end }} 29 | {{- end }} 30 | {{- end }} 31 | rules: 32 | {{- range .Values.otelCollector.ingress.hosts }} 33 | - host: {{ .host | quote }} 34 | http: 35 | paths: 36 | {{- range .paths }} 37 | - path: {{ .path }} 38 | {{- if $ingressSupportsPathType }} 39 | pathType: {{ .pathType }} 40 | {{- end }} 41 | backend: 42 | {{- if $ingressApiIsStable }} 43 | service: 44 | name: {{ $fullName }} 45 | port: 46 | number: {{ .port }} 47 | {{- else }} 48 | serviceName: {{ $fullName }} 49 | servicePort: {{ .port }} 50 | {{- end }} 51 | {{- end }} 52 | {{- end }} 53 | {{- end }} 54 | -------------------------------------------------------------------------------- /charts/signoz/templates/otel-collector/keda-autoscaler.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.otelCollector.autoscaling.enabled .Values.otelCollector.autoscaling.keda.enabled -}} 2 | apiVersion: keda.sh/v1alpha1 3 | kind: ScaledObject 4 | metadata: 5 | name: {{ include "otelCollector.fullname" . }} 6 | labels: 7 | {{- include "otelCollector.labels" . | nindent 4 }} 8 | {{- if .Values.otelCollector.autoscaling.keda.annotations }} 9 | annotations: {{ toYaml .Values.otelCollector.autoscaling.keda.annotations | nindent 4 }} 10 | {{- end }} 11 | spec: 12 | scaleTargetRef: 13 | apiVersion: apps/v1 # Optional. Default: apps/v1 14 | kind: Deployment # Optional. Default: Deployment 15 | name: {{ include "otelCollector.fullname" . }} # Mandatory. Must be in the same namespace as the ScaledObject 16 | pollingInterval: {{ .Values.otelCollector.autoscaling.keda.pollingInterval }} # Optional. Default: 30 seconds 17 | cooldownPeriod: {{ .Values.otelCollector.autoscaling.keda.cooldownPeriod }} # Optional. Default: 300 seconds 18 | minReplicaCount: {{ .Values.otelCollector.autoscaling.keda.minReplicaCount }} # Optional. Default: 0 19 | maxReplicaCount: {{ .Values.otelCollector.autoscaling.keda.maxReplicaCount }} # Optional. Default: 100 20 | {{- with .Values.otelCollector.autoscaling.keda.triggers }} 21 | triggers: 22 | {{- toYaml . | nindent 4 }} 23 | {{ end }} 24 | {{ end }} 25 | -------------------------------------------------------------------------------- /charts/signoz/templates/otel-collector/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "otelCollector.fullname" . }} 5 | labels: 6 | {{- include "otelCollector.labels" . | nindent 4 }} 7 | {{- with .Values.otelCollector }} 8 | {{- if .service.labels }} 9 | {{- toYaml .service.labels | nindent 4 }} 10 | {{- end}} 11 | {{- if .service.annotations }} 12 | annotations: 13 | {{- toYaml .service.annotations | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | type: {{ .service.type }} 17 | {{- if and (eq .service.type "LoadBalancer") .service.loadBalancerSourceRanges }} 18 | loadBalancerSourceRanges: 19 | {{- range .service.loadBalancerSourceRanges }} 20 | - {{ . }} 21 | {{- end }} 22 | {{- end }} 23 | ports: 24 | {{- include "otelCollector.portsConfig" . | indent 4 -}} 25 | {{- end }} 26 | selector: 27 | {{- include "otelCollector.selectorLabels" . | nindent 4 }} 28 | -------------------------------------------------------------------------------- /charts/signoz/templates/otel-collector/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.otelCollector.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "otelCollector.serviceAccountName" . }} 6 | labels: 7 | {{- include "otelCollector.labels" . | nindent 4 }} 8 | {{- with .Values.otelCollector.serviceAccount.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- include "signoz.imagePullSecrets" . }} 13 | {{- end -}} 14 | -------------------------------------------------------------------------------- /charts/signoz/templates/schema-migrator/migrations-async.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.schemaMigrator.enabled }} 2 | {{- $schemaMigratorSuffix := "" }} 3 | {{- if .Release.IsInstall }} 4 | {{- $schemaMigratorSuffix = "-init" }} 5 | {{- end }} 6 | apiVersion: batch/v1 7 | kind: Job 8 | metadata: 9 | name: {{ include "schemaMigrator.fullname" . }}-async{{ $schemaMigratorSuffix }} 10 | labels: 11 | {{- include "schemaMigrator.selectorLabels" . | nindent 4 }} 12 | annotations: 13 | {{- with .Values.schemaMigrator.annotations }} 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | {{- if .Values.schemaMigrator.upgradeHelmHooks }} 17 | argocd.argoproj.io/hook: PostSync 18 | argocd.argoproj.io/hook-delete-policy: BeforeHookCreation 19 | {{- if .Release.IsUpgrade }} 20 | helm.sh/hook: post-upgrade 21 | helm.sh/hook-delete-policy: before-hook-creation 22 | {{- end }} 23 | {{- end }} 24 | spec: 25 | template: 26 | metadata: 27 | labels: 28 | {{- include "schemaMigrator.selectorLabels" . | nindent 8 }} 29 | spec: 30 | serviceAccountName: {{ include "schemaMigrator.serviceAccountName" . }}-async 31 | initContainers: 32 | {{- if .Values.schemaMigrator.initContainers.init.enabled }} 33 | - name: schema-migrator-async-init 34 | image: {{ include "schemaMigrator.initContainers.init.image" . }} 35 | imagePullPolicy: {{ .Values.schemaMigrator.initContainers.init.image.pullPolicy }} 36 | env: 37 | {{- include "snippet.clickhouse-credentials" . | nindent 12 }} 38 | {{- with .Values.schemaMigrator.initContainers.init.command }} 39 | command: 40 | - sh 41 | - -c 42 | - until wget --user "$(CLICKHOUSE_USER):$(CLICKHOUSE_PASSWORD)" --spider -q {{ include "clickhouse.httpUrl" $ }}{{ .endpoint }}; do echo -e "{{ .waitMessage }}"; sleep {{ .delay }}; done; echo -e "{{ .doneMessage }}"; 43 | {{- end }} 44 | resources: 45 | {{- toYaml .Values.schemaMigrator.initContainers.init.resources | nindent 12 }} 46 | {{- end }} 47 | # ClickHouse ready check 48 | {{- if and .Values.clickhouse.enabled .Values.schemaMigrator.initContainers.chReady.enabled }} 49 | - name: schema-migrator-async-ch-ready 50 | image: {{ include "schemaMigrator.initContainers.chReady.image" . }} 51 | imagePullPolicy: {{ .Values.schemaMigrator.initContainers.chReady.image.pullPolicy }} 52 | env: 53 | {{- include "snippet.clickhouse-credentials" . | nindent 12 }} 54 | - name: CLICKHOUSE_VERSION 55 | value: {{ trimSuffix "-alpine" .Values.clickhouse.image.tag }} 56 | - name: CLICKHOUSE_SHARDS 57 | value: {{ default 1 .Values.clickhouse.layout.shardsCount | quote }} 58 | - name: CLICKHOUSE_REPLICAS 59 | value: {{ default 1 .Values.clickhouse.layout.replicasCount | quote }} 60 | {{- with .Values.schemaMigrator.initContainers.chReady.command }} 61 | command: 62 | {{- . | toYaml | nindent 12 }} 63 | {{- end }} 64 | resources: 65 | {{- toYaml .Values.schemaMigrator.initContainers.chReady.resources | nindent 12 }} 66 | {{- end }} 67 | {{- if .Values.schemaMigrator.initContainers.wait.enabled }} 68 | - name: schema-migrator-async-wait-for-sync 69 | image: {{ include "schemaMigrator.initContainers.wait.image" . }} 70 | imagePullPolicy: {{ .Values.schemaMigrator.initContainers.wait.image.pullPolicy }} 71 | {{- with .Values.schemaMigrator.initContainers.wait.env }} 72 | env: 73 | {{- toYaml . | nindent 12 }} 74 | {{- end }} 75 | args: 76 | - "job" 77 | - "{{ include "schemaMigrator.fullname" . }}-sync{{ $schemaMigratorSuffix }}" 78 | {{- end }} 79 | containers: 80 | - name: schema-migrator 81 | image: {{ include "schemaMigrator.image" . }} 82 | imagePullPolicy: {{ .Values.schemaMigrator.image.pullPolicy }} 83 | env: 84 | {{- include "snippet.clickhouse-credentials" . | nindent 12 }} 85 | args: 86 | - async 87 | - "--cluster-name" 88 | - "$(CLICKHOUSE_CLUSTER)" 89 | - "--dsn" 90 | - "tcp://$(CLICKHOUSE_USER):$(CLICKHOUSE_PASSWORD)@{{ include "schemamigrator.url" . }}" 91 | {{- if .Values.schemaMigrator.enableReplication }} 92 | - "--replication" 93 | {{- end }} 94 | {{- range .Values.schemaMigrator.args }} 95 | - {{ . | quote }} 96 | {{- end }} 97 | restartPolicy: OnFailure 98 | {{- if .Values.schemaMigrator.affinity }} 99 | affinity: {{ toYaml .Values.schemaMigrator.affinity | nindent 8 }} 100 | {{- end }} 101 | {{- if .Values.schemaMigrator.tolerations }} 102 | tolerations: {{ toYaml .Values.schemaMigrator.tolerations | nindent 8 }} 103 | {{- end }} 104 | {{- if .Values.schemaMigrator.nodeSelector }} 105 | nodeSelector: {{ toYaml .Values.schemaMigrator.nodeSelector | nindent 8 }} 106 | {{- end }} 107 | {{- if .Values.schemaMigrator.topologySpreadConstraints }} 108 | topologySpreadConstraints: {{ toYaml .Values.schemaMigrator.topologySpreadConstraints | nindent 8 }} 109 | {{- end }} 110 | {{- end }} 111 | -------------------------------------------------------------------------------- /charts/signoz/templates/schema-migrator/migrations-sync.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.schemaMigrator.enabled }} 2 | {{- $schemaMigratorSuffix := "" }} 3 | {{- if .Release.IsInstall }} 4 | {{- $schemaMigratorSuffix = "-init" }} 5 | {{- end }} 6 | apiVersion: batch/v1 7 | kind: Job 8 | metadata: 9 | name: {{ include "schemaMigrator.fullname" . }}-sync{{ $schemaMigratorSuffix }} 10 | labels: 11 | {{- include "schemaMigrator.selectorLabels" . | nindent 4 }} 12 | annotations: 13 | {{- with .Values.schemaMigrator.annotations }} 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | {{- if .Values.schemaMigrator.upgradeHelmHooks }} 17 | argocd.argoproj.io/hook: Sync 18 | argocd.argoproj.io/hook-delete-policy: BeforeHookCreation 19 | {{- if .Release.IsUpgrade }} 20 | helm.sh/hook: pre-upgrade 21 | helm.sh/hook-delete-policy: before-hook-creation 22 | {{- end }} 23 | {{- end }} 24 | spec: 25 | template: 26 | metadata: 27 | labels: 28 | {{- include "schemaMigrator.selectorLabels" . | nindent 8 }} 29 | spec: 30 | initContainers: 31 | {{- if .Values.schemaMigrator.initContainers.init.enabled }} 32 | - name: schema-migrator-sync-init 33 | image: {{ include "schemaMigrator.initContainers.init.image" . }} 34 | imagePullPolicy: {{ .Values.schemaMigrator.initContainers.init.image.pullPolicy }} 35 | env: 36 | {{- include "snippet.clickhouse-credentials" . | nindent 12 }} 37 | {{- with .Values.schemaMigrator.initContainers.init.command }} 38 | command: 39 | - sh 40 | - -c 41 | - until wget --user "$(CLICKHOUSE_USER):$(CLICKHOUSE_PASSWORD)" --spider -q {{ include "clickhouse.httpUrl" $ }}{{ .endpoint }}; do echo -e "{{ .waitMessage }}"; sleep {{ .delay }}; done; echo -e "{{ .doneMessage }}"; 42 | {{- end }} 43 | resources: 44 | {{- toYaml .Values.schemaMigrator.initContainers.init.resources | nindent 12 }} 45 | {{- end }} 46 | # ClickHouse ready check 47 | {{- if and .Values.clickhouse.enabled .Values.schemaMigrator.initContainers.chReady.enabled }} 48 | - name: schema-migrator-sync-ch-ready 49 | image: {{ include "schemaMigrator.initContainers.chReady.image" . }} 50 | imagePullPolicy: {{ .Values.schemaMigrator.initContainers.chReady.image.pullPolicy }} 51 | env: 52 | {{- include "snippet.clickhouse-credentials" . | nindent 12 }} 53 | - name: CLICKHOUSE_VERSION 54 | value: {{ trimSuffix "-alpine" .Values.clickhouse.image.tag }} 55 | - name: CLICKHOUSE_SHARDS 56 | value: {{ default 1 .Values.clickhouse.layout.shardsCount | quote }} 57 | - name: CLICKHOUSE_REPLICAS 58 | value: {{ default 1 .Values.clickhouse.layout.replicasCount | quote }} 59 | {{- with .Values.schemaMigrator.initContainers.chReady.command }} 60 | command: 61 | {{- . | toYaml | nindent 12 }} 62 | {{- end }} 63 | resources: 64 | {{- toYaml .Values.schemaMigrator.initContainers.chReady.resources | nindent 12 }} 65 | {{- end }} 66 | containers: 67 | - name: schema-migrator 68 | image: {{ include "schemaMigrator.image" . }} 69 | imagePullPolicy: {{ .Values.schemaMigrator.image.pullPolicy }} 70 | env: 71 | {{- include "snippet.clickhouse-credentials" . | nindent 12 }} 72 | args: 73 | - sync 74 | - "--cluster-name" 75 | - "$(CLICKHOUSE_CLUSTER)" 76 | - "--dsn" 77 | - "tcp://$(CLICKHOUSE_USER):$(CLICKHOUSE_PASSWORD)@{{ include "schemamigrator.url" . }}" 78 | {{- if .Values.schemaMigrator.enableReplication }} 79 | - "--replication" 80 | {{- end }} 81 | {{- range .Values.schemaMigrator.args }} 82 | - {{ . | quote }} 83 | {{- end }} 84 | restartPolicy: OnFailure 85 | {{- if .Values.schemaMigrator.affinity }} 86 | affinity: {{ toYaml .Values.schemaMigrator.affinity | nindent 8 }} 87 | {{- end }} 88 | {{- if .Values.schemaMigrator.tolerations }} 89 | tolerations: {{ toYaml .Values.schemaMigrator.tolerations | nindent 8 }} 90 | {{- end }} 91 | {{- if .Values.schemaMigrator.nodeSelector }} 92 | nodeSelector: {{ toYaml .Values.schemaMigrator.nodeSelector | nindent 8 }} 93 | {{- end }} 94 | {{- if .Values.schemaMigrator.topologySpreadConstraints }} 95 | topologySpreadConstraints: {{ toYaml .Values.schemaMigrator.topologySpreadConstraints | nindent 8 }} 96 | {{- end }} 97 | {{- end }} 98 | -------------------------------------------------------------------------------- /charts/signoz/templates/schema-migrator/role.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.schemaMigrator.role.create -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: Role 4 | metadata: 5 | name: {{ include "schemaMigrator.roleName" . }}-async 6 | namespace: {{ include "signoz.namespace" . }} 7 | {{- with .Values.schemaMigrator.role.annotations }} 8 | annotations: 9 | {{- toYaml . | nindent 4 }} 10 | {{- end }} 11 | rules: {{ toYaml .Values.schemaMigrator.role.rules | nindent 2 -}} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /charts/signoz/templates/schema-migrator/rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.schemaMigrator.role.create -}} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: RoleBinding 4 | metadata: 5 | name: {{ include "schemaMigrator.roleBindingName" . }}-async 6 | namespace: {{ include "signoz.namespace" . }} 7 | {{- with .Values.schemaMigrator.role.roleBinding.annotations }} 8 | annotations: 9 | {{- toYaml . | nindent 4 }} 10 | {{- end }} 11 | roleRef: 12 | apiGroup: rbac.authorization.k8s.io 13 | kind: Role 14 | name: {{ include "schemaMigrator.roleName" . }}-async 15 | subjects: 16 | - name: {{ include "schemaMigrator.serviceAccountName" . }}-async 17 | kind: ServiceAccount 18 | namespace: {{ include "signoz.namespace" . }} 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /charts/signoz/templates/schema-migrator/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.schemaMigrator.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "schemaMigrator.serviceAccountName" . }}-async 6 | labels: 7 | {{- include "schemaMigrator.labels" . | nindent 4 }} 8 | {{- with .Values.schemaMigrator.serviceAccount.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- include "signoz.imagePullSecrets" . }} 13 | {{- end -}} 14 | -------------------------------------------------------------------------------- /charts/signoz/templates/secrets-clickhouse-external.yaml: -------------------------------------------------------------------------------- 1 | {{- if (include "clickhouse.createSecret" .) }} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: {{ include "clickhouse.secretName" . }} 6 | type: Opaque 7 | data: 8 | {{ include "clickhouse.secretPasswordKey" . }}: {{ .Values.externalClickhouse.password | b64enc | quote }} 9 | {{- end }} 10 | -------------------------------------------------------------------------------- /charts/signoz/templates/signoz/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.signoz.ingress.enabled -}} 2 | {{- $fullName := include "signoz.fullname" . -}} 3 | {{- $ingressApiIsStable := eq (include "ingress.isStable" .) "true" -}} 4 | {{- $ingressSupportsPathType := eq (include "ingress.supportsPathType" .) "true" -}} 5 | apiVersion: {{ include "ingress.apiVersion" . }} 6 | kind: Ingress 7 | metadata: 8 | name: {{ $fullName }} 9 | labels: 10 | {{- include "signoz.labels" . | nindent 4 }} 11 | {{- with .Values.signoz.ingress.annotations }} 12 | annotations: 13 | {{- toYaml . | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | {{- if and .Values.signoz.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} 17 | ingressClassName: {{ .Values.signoz.ingress.className }} 18 | {{- end }} 19 | {{- if .Values.signoz.ingress.tls }} 20 | tls: 21 | {{- range .Values.signoz.ingress.tls }} 22 | - hosts: 23 | {{- range .hosts }} 24 | - {{ . | quote }} 25 | {{- end }} 26 | {{- with .secretName }} 27 | secretName: {{ . }} 28 | {{- end }} 29 | {{- end }} 30 | {{- end }} 31 | rules: 32 | {{- range .Values.signoz.ingress.hosts }} 33 | - host: {{ .host | quote }} 34 | http: 35 | paths: 36 | {{- range .paths }} 37 | - path: {{ .path }} 38 | {{- if $ingressSupportsPathType }} 39 | pathType: {{ .pathType }} 40 | {{- end }} 41 | backend: 42 | {{- if $ingressApiIsStable }} 43 | service: 44 | name: {{ $fullName }} 45 | port: 46 | number: {{ .port }} 47 | {{- else }} 48 | serviceName: {{ $fullName }} 49 | servicePort: {{ .port }} 50 | {{- end }} 51 | {{- end }} 52 | {{- end }} 53 | {{- end }} 54 | -------------------------------------------------------------------------------- /charts/signoz/templates/signoz/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "signoz.fullname" . }} 5 | labels: 6 | {{- include "signoz.labels" . | nindent 4 }} 7 | {{- with .Values.signoz.service }} 8 | {{- if .labels }} 9 | {{- toYaml .labels | nindent 4 }} 10 | {{- end }} 11 | {{- if .annotations }} 12 | annotations: 13 | {{- toYaml .annotations | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | type: {{ .type }} 17 | ports: 18 | - name: http 19 | port: {{ .port }} 20 | {{- include "signoz.service.ifClusterIP" .type | indent 6 }} 21 | protocol: TCP 22 | targetPort: http 23 | {{- if (and (eq .type "NodePort") .nodePort) }} 24 | nodePort: {{ .nodePort }} 25 | {{- end }} 26 | - name: http-internal 27 | port: {{ .internalPort }} 28 | {{- include "signoz.service.ifClusterIP" .type | indent 6 }} 29 | protocol: TCP 30 | targetPort: http-internal 31 | {{- if (and (eq .type "NodePort") .internalNodePort) }} 32 | nodePort: {{ .internalNodePort }} 33 | {{- end }} 34 | - name: opamp-internal 35 | port: {{ .opampPort }} 36 | {{- include "signoz.service.ifClusterIP" .type | indent 6 }} 37 | protocol: TCP 38 | targetPort: opamp-internal 39 | {{- if (and (eq .type "NodePort") .opampInternalNodePort) }} 40 | nodePort: {{ .opampInternalNodePort }} 41 | {{- end }} 42 | {{- end }} 43 | selector: 44 | {{- include "signoz.selectorLabels" . | nindent 4 }} 45 | -------------------------------------------------------------------------------- /charts/signoz/templates/signoz/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.signoz.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "signoz.serviceAccountName" . }} 6 | labels: 7 | {{- include "signoz.labels" . | nindent 4 }} 8 | {{- with .Values.signoz.serviceAccount.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- include "signoz.imagePullSecrets" . }} 13 | {{- end -}} 14 | -------------------------------------------------------------------------------- /charts/signoz/templates/signoz/statefulset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: {{ include "signoz.fullname" . }} 5 | labels: 6 | {{- include "signoz.labels" . | nindent 4 }} 7 | {{- if .Values.signoz.annotations }} 8 | annotations: 9 | {{- toYaml .Values.signoz.annotations | nindent 4 }} 10 | {{- end }} 11 | spec: 12 | serviceName: {{ include "signoz.fullname" . }} 13 | replicas: {{ .Values.signoz.replicaCount }} 14 | selector: 15 | matchLabels: 16 | {{- include "signoz.selectorLabels" . | nindent 6 }} 17 | template: 18 | metadata: 19 | {{- if .Values.signoz.podAnnotations }} 20 | annotations: 21 | {{- toYaml .Values.signoz.podAnnotations | nindent 8 }} 22 | {{- end }} 23 | labels: 24 | {{- include "signoz.selectorLabels" . | nindent 8 }} 25 | spec: 26 | {{- with .Values.signoz.imagePullSecrets }} 27 | imagePullSecrets: 28 | {{- range . }} 29 | - name: {{ . | quote }} 30 | {{- end }} 31 | {{- end }} 32 | serviceAccountName: {{ include "signoz.serviceAccountName" . }} 33 | priorityClassName: {{ .Values.signoz.priorityClassName | quote }} 34 | {{- with .Values.signoz.nodeSelector }} 35 | nodeSelector: 36 | {{- toYaml . | nindent 8 }} 37 | {{- end }} 38 | {{- with .Values.signoz.affinity }} 39 | affinity: 40 | {{- toYaml . | nindent 8 }} 41 | {{- end }} 42 | {{- with .Values.signoz.tolerations }} 43 | tolerations: 44 | {{- toYaml . | nindent 8 }} 45 | {{- end }} 46 | {{- with .Values.signoz.topologySpreadConstraints }} 47 | topologySpreadConstraints: 48 | {{- toYaml . | nindent 8 }} 49 | {{- end }} 50 | securityContext: 51 | {{- toYaml .Values.signoz.podSecurityContext | nindent 8 }} 52 | {{- with .Values.signoz.initContainers }} 53 | initContainers: 54 | {{- if .init.enabled }} 55 | - name: {{ include "signoz.fullname" $ }}-init 56 | image: {{ include "signoz.initContainers.init.image" $ }} 57 | imagePullPolicy: {{ .init.image.pullPolicy }} 58 | env: 59 | {{- include "snippet.clickhouse-credentials" $ | nindent 12 }} 60 | {{- with .init.command }} 61 | command: 62 | - sh 63 | - -c 64 | - until wget --user "${CLICKHOUSE_USER}:${CLICKHOUSE_PASSWORD}" --spider -q {{ include "clickhouse.httpUrl" $ }}{{ .endpoint }}; do echo -e "{{ .waitMessage }}"; sleep {{ .delay }}; done; echo -e "{{ .doneMessage }}"; 65 | {{- end }} 66 | resources: 67 | {{- toYaml .init.resources | nindent 12 }} 68 | {{- end }} 69 | {{- if .migration.enabled }} 70 | - name: {{ include "signoz.fullname" $ }}-migration 71 | image: {{ include "signoz.initContainers.migration.image" $ }} 72 | imagePullPolicy: {{ .migration.image.pullPolicy }} 73 | env: 74 | {{- include "snippet.clickhouse-credentials" $ | nindent 12 }} 75 | {{- if .migration.args }} 76 | args: 77 | {{- toYaml .migration.args | nindent 12 }} 78 | {{- end }} 79 | {{- if .migration.command }} 80 | command: 81 | {{- toYaml .migration.command | nindent 12 }} 82 | {{- end }} 83 | resources: 84 | {{- toYaml .migration.resources | nindent 12 }} 85 | volumeMounts: 86 | {{- if $.Values.signoz.persistence.enabled }} 87 | {{- if $.Values.signoz.persistence.existingClaim }} 88 | - name: signoz-db-existing-claim 89 | {{- else }} 90 | - name: signoz-db 91 | {{- end }} 92 | {{- else }} 93 | - name: signoz-db-volume 94 | {{- end }} 95 | mountPath: /var/lib/signoz 96 | {{- if .migration.additionalVolumeMounts }} 97 | {{- toYaml .migration.additionalVolumeMounts | nindent 12 }} 98 | {{- end }} 99 | {{- end }} 100 | {{- end }} 101 | containers: 102 | - name: signoz 103 | securityContext: 104 | {{- toYaml .Values.signoz.securityContext | nindent 12 }} 105 | image: {{ template "signoz.image" . }} 106 | imagePullPolicy: {{ .Values.signoz.image.pullPolicy }} 107 | args: 108 | - --cluster 109 | - "$(CLICKHOUSE_CLUSTER)" 110 | {{- range .Values.signoz.additionalArgs }} 111 | - {{ . | quote }} 112 | {{- end }} 113 | ports: 114 | - name: http 115 | containerPort: {{ default 8080 .Values.signoz.service.port }} 116 | protocol: TCP 117 | - name: http-internal 118 | containerPort: {{ default 8085 .Values.signoz.service.internalPort }} 119 | protocol: TCP 120 | - name: opamp-internal 121 | containerPort: {{ default 4320 .Values.signoz.service.opampPort }} 122 | protocol: TCP 123 | env: 124 | {{- include "snippet.clickhouse-credentials" . | nindent 12 }} 125 | - name: STORAGE 126 | value: {{ .Values.signoz.configVars.storage }} 127 | - name: ClickHouseUrl 128 | {{- if hasKey .Values.signoz.configVars "clickHouseUrl" }} 129 | value: {{ .Values.signoz.configVars.clickHouseUrl }} 130 | {{- else }} 131 | value: tcp://{{ include "clickhouse.clickHouseUrl" . }} 132 | {{- end }} 133 | - name: GODEBUG 134 | value: {{ .Values.signoz.configVars.goDebug }} 135 | - name: TELEMETRY_ENABLED 136 | value: {{ quote .Values.signoz.configVars.telemetryEnabled }} 137 | - name: DEPLOYMENT_TYPE 138 | value: {{ .Values.signoz.configVars.deploymentType }} 139 | - name: SIGNOZ_ALERTMANAGER_PROVIDER 140 | value: signoz 141 | {{- include "signoz.renderAdditionalEnv" .Values.signoz.additionalEnvs | nindent 12 }} 142 | {{- if .Values.signoz.smtpVars.enabled }} 143 | - name: SMTP_ENABLED 144 | value: "true" 145 | {{- range $keyName, $envName := dict "fromKey" "SMTP_FROM" 146 | "hostKey" "SMTP_HOST" 147 | "portKey" "SMTP_PORT" 148 | "usernameKey" "SMTP_USERNAME" 149 | "passwordKey" "SMTP_PASSWORD" }} 150 | {{- $keyInSecret := get $.Values.signoz.smtpVars.existingSecret $keyName }} 151 | {{- if $keyInSecret }} 152 | {{- if and $keyInSecret (hasKey $.Values.signoz.additionalEnvs $envName)}} 153 | {{- fail (printf "Error: SMTP variable '%s' is configured both in .Values.signoz.additionalEnvs and .Values.signoz.smtpVars.existingSecret.%s. Please use only one configuration method to avoid conflicts." $envName $keyName)}} 154 | {{- end}} 155 | - name: {{$envName}} 156 | valueFrom: 157 | secretKeyRef: 158 | name: {{ required (printf "'%s' is set but secret name is missing: .Values.signoz.smtpVars.existingSecret" $keyName) $.Values.signoz.smtpVars.existingSecret.name }} 159 | key: {{ $keyInSecret }} 160 | {{- end }} 161 | {{- end }} 162 | {{- end }} 163 | {{- if .Values.signoz.livenessProbe.enabled }} 164 | livenessProbe: 165 | httpGet: 166 | port: {{ .Values.signoz.livenessProbe.port }} 167 | path: {{ .Values.signoz.livenessProbe.path }} 168 | initialDelaySeconds: {{ .Values.signoz.livenessProbe.initialDelaySeconds }} 169 | periodSeconds: {{ .Values.signoz.livenessProbe.periodSeconds }} 170 | timeoutSeconds: {{ .Values.signoz.livenessProbe.timeoutSeconds }} 171 | successThreshold: {{ .Values.signoz.livenessProbe.successThreshold }} 172 | failureThreshold: {{ .Values.signoz.livenessProbe.failureThreshold }} 173 | {{- else if .Values.signoz.customLivenessProbe }} 174 | livenessProbe: {{- toYaml .Values.signoz.customLivenessProbe | nindent 12 }} 175 | {{- end }} 176 | {{- if .Values.signoz.readinessProbe.enabled }} 177 | readinessProbe: 178 | httpGet: 179 | port: {{ .Values.signoz.readinessProbe.port }} 180 | path: {{ .Values.signoz.readinessProbe.path }} 181 | initialDelaySeconds: {{ .Values.signoz.readinessProbe.initialDelaySeconds }} 182 | periodSeconds: {{ .Values.signoz.readinessProbe.periodSeconds }} 183 | timeoutSeconds: {{ .Values.signoz.readinessProbe.timeoutSeconds }} 184 | successThreshold: {{ .Values.signoz.readinessProbe.successThreshold }} 185 | failureThreshold: {{ .Values.signoz.readinessProbe.failureThreshold }} 186 | {{- else if .Values.signoz.customReadinessProbe }} 187 | readinessProbe: {{- toYaml .Values.signoz.customReadinessProbe | nindent 12 }} 188 | {{- end }} 189 | volumeMounts: 190 | - name: dashboards 191 | mountPath: /root/config/dashboards 192 | {{- if .Values.signoz.persistence.enabled }} 193 | {{- if .Values.signoz.persistence.existingClaim }} 194 | - name: signoz-db-existing-claim 195 | {{- else }} 196 | - name: signoz-db 197 | {{- end }} 198 | {{- else }} 199 | - name: signoz-db-volume 200 | {{- end }} 201 | mountPath: /var/lib/signoz/ 202 | {{- if .Values.signoz.additionalVolumeMounts }} 203 | {{- toYaml .Values.signoz.additionalVolumeMounts | nindent 12 }} 204 | {{- end }} 205 | resources: 206 | {{- toYaml .Values.signoz.resources | nindent 12 }} 207 | volumes: 208 | - name: dashboards 209 | emptyDir: {} 210 | {{- if (not .Values.signoz.persistence.enabled) }} 211 | - name: signoz-db-volume 212 | emptyDir: {} 213 | {{- else if .Values.signoz.persistence.existingClaim }} 214 | - name: signoz-db-existing-claim 215 | persistentVolumeClaim: 216 | claimName: {{ .Values.signoz.persistence.existingClaim }} 217 | {{- end }} 218 | {{- if .Values.signoz.additionalVolumes }} 219 | {{- toYaml .Values.signoz.additionalVolumes | nindent 8 }} 220 | {{- end }} 221 | {{- if .Values.signoz.initContainers.migration.additionalVolumes }} 222 | {{- toYaml .Values.signoz.initContainers.migration.additionalVolumes | nindent 8 }} 223 | {{- end }} 224 | 225 | {{- if and (.Values.signoz.persistence.enabled) (not .Values.signoz.persistence.existingClaim) }} 226 | volumeClaimTemplates: 227 | - metadata: 228 | name: signoz-db 229 | spec: 230 | accessModes: 231 | {{- toYaml .Values.signoz.persistence.accessModes | nindent 10 }} 232 | resources: 233 | requests: 234 | storage: {{ .Values.signoz.persistence.size }} 235 | {{- $storageClass := default .Values.signoz.persistence.storageClass .Values.global.storageClass -}} 236 | {{- if $storageClass -}} 237 | {{- if (eq "-" $storageClass) }} 238 | storageClassName: "" 239 | {{- else }} 240 | storageClassName: {{ $storageClass }} 241 | {{- end }} 242 | {{- end }} 243 | {{- end }} 244 | -------------------------------------------------------------------------------- /charts/signoz/templates/signoz/tests/test-connection.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: "{{ include "signoz.fullname" . }}-test-connection" 5 | labels: 6 | {{- include "signoz.labels" . | nindent 4 }} 7 | annotations: 8 | "helm.sh/hook": test-success 9 | spec: 10 | containers: 11 | - name: wget 12 | image: {{ default "docker.io" .Values.global.imageRegistry }}/busybox:1.35 13 | command: ['wget'] 14 | args: ['http://{{ include "signoz.url" . }}/api/v1/health?live=1'] 15 | # NOTE: replace the path with version or healthcheck URL after the implementation 16 | restartPolicy: Never 17 | -------------------------------------------------------------------------------- /ct.yaml: -------------------------------------------------------------------------------- 1 | # See https://github.com/helm/chart-testing#configuration 2 | remote: origin 3 | target-branch: main 4 | debug: true 5 | charts: 6 | - charts/clickhouse 7 | - charts/k8s-infra 8 | - charts/signoz 9 | check-version-increment: false 10 | helm-extra-args: --timeout 5m 11 | chart-repos: 12 | - signoz=https://charts.signoz.io 13 | --------------------------------------------------------------------------------