├── .github ├── labeler.yaml ├── pr-title-checker-config.json └── workflows │ ├── build-debug-pod-image.yaml │ ├── ci.yaml │ ├── e2e.yaml │ ├── pr-labeling.yaml │ ├── pr-title-checker.yaml │ ├── release.yaml │ └── update-dashboards.yaml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── charts ├── greptimedb-cluster │ ├── .helmignore │ ├── Chart.lock │ ├── Chart.yaml │ ├── README.md │ ├── README.md.gotmpl │ ├── dashboards │ │ ├── greptimedb-cluster-logs.json │ │ └── greptimedb-cluster-metrics.json │ ├── scripts │ │ └── pre-check │ │ │ ├── disk.sh │ │ │ ├── kafka.sh │ │ │ └── s3.sh │ ├── templates │ │ ├── NOTES.txt │ │ ├── _helpers.tpl │ │ ├── cluster.yaml │ │ ├── custom-image-pull-secret.yaml │ │ ├── debug-depoyment.yaml │ │ ├── grafana-dashboards-configmap.yaml │ │ ├── meta-mysql-secret.yaml │ │ ├── meta-postgresql-secret.yaml │ │ ├── object-storage-secret.yaml │ │ ├── pre-check │ │ │ ├── configmap.yaml │ │ │ ├── job.yaml │ │ │ └── pvc.yaml │ │ ├── prometheusrule.yaml │ │ ├── serviceaccount-datanode.yaml │ │ ├── serviceaccount-flownode.yaml │ │ ├── serviceaccount-frontend.yaml │ │ ├── serviceaccount-meta.yaml │ │ └── users-auth-secret.yaml │ └── values.yaml ├── greptimedb-operator │ ├── .helmignore │ ├── Chart.yaml │ ├── README.md │ ├── README.md.gotmpl │ ├── templates │ │ ├── NOTES.txt │ │ ├── _helpers.tpl │ │ ├── cert-manager.yaml │ │ ├── clusterrole.yaml │ │ ├── clusterrolebinding.yaml │ │ ├── crds │ │ │ ├── crd-greptimedbcluster.yaml │ │ │ └── crd-greptimedbstandalone.yaml │ │ ├── deployment.yaml │ │ ├── role.yaml │ │ ├── rolebinding.yaml │ │ ├── service.yaml │ │ ├── serviceaccount.yaml │ │ └── validating-webhook.yaml │ └── values.yaml └── greptimedb-standalone │ ├── .helmignore │ ├── Chart.yaml │ ├── README.md │ ├── README.md.gotmpl │ ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── configmap.yaml │ ├── podmonitor.yaml │ ├── secret.yaml │ ├── service.yaml │ ├── serviceaccount.yaml │ ├── statefulset.yaml │ └── users-auth-secret.yaml │ └── values.yaml ├── docker └── debug-pod │ ├── Dockerfile │ └── README.md └── scripts ├── crds ├── templates │ ├── crd-greptimedbcluster.tmpl │ └── crd-greptimedbstandalone.tmpl ├── update-crds.sh └── upgrade-crds.sh ├── e2e ├── greptimedb-cluster.sh └── greptimedb-standalone.sh ├── release ├── release-charts-to-acr.sh └── release-charts-to-s3.sh └── update ├── update-grafana-dashboard.sh └── update-version.sh /.github/labeler.yaml: -------------------------------------------------------------------------------- 1 | greptimedb-cluster: 2 | - changed-files: 3 | - any-glob-to-any-file: charts/greptimedb-cluster/** 4 | 5 | greptimedb-operator: 6 | - changed-files: 7 | - any-glob-to-any-file: charts/greptimedb-operator/** 8 | 9 | greptimedb-standalone: 10 | - changed-files: 11 | - any-glob-to-any-file: charts/greptimedb-standalone/** 12 | -------------------------------------------------------------------------------- /.github/pr-title-checker-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "LABEL": { 3 | "name": "Invalid PR Title", 4 | "color": "B60205" 5 | }, 6 | "CHECKS": { 7 | "regexp": "^(feat|fix|test|refactor|chore|style|docs|perf|build|ci|revert|enhancement)(!)?(\\(.*\\))?:.*", 8 | "ignoreLabels" : ["ignore-title"] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.github/workflows/build-debug-pod-image.yaml: -------------------------------------------------------------------------------- 1 | name: "Build Debug Pod Image" 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | docker: 8 | name: Build and push image 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout sources 12 | uses: actions/checkout@v4 13 | 14 | - name: Set up QEMU 15 | uses: docker/setup-qemu-action@v3 16 | with: 17 | platforms: linux/amd64,linux/arm64 18 | # The latest version will lead to segmentation fault. 19 | image: tonistiigi/binfmt:qemu-v7.0.0-28 20 | 21 | - name: Set up Docker Buildx 22 | uses: docker/setup-buildx-action@v3 23 | 24 | - name: Login to DockerHub 25 | uses: docker/login-action@v3 26 | with: 27 | username: ${{ secrets.DOCKERHUB_USERNAME }} 28 | password: ${{ secrets.DOCKERHUB_TOKEN }} 29 | 30 | - name: Login to AliCloud Container Registry 31 | uses: docker/login-action@v3 32 | with: 33 | registry: ${{ vars.OCI_REGISTRY_URL }} 34 | username: ${{ secrets.ALICLOUD_USERNAME }} 35 | password: ${{ secrets.ALICLOUD_PASSWORD }} 36 | 37 | - name: Configure build image tag # The image tag will be like '20250213-e64e46c' 38 | shell: bash 39 | run: | 40 | buildTime=`date "+%Y%m%d"` 41 | commitShortSHA=`git log -1 --pretty=format:"%h"` 42 | IMAGE_TAG="$buildTime-$commitShortSHA" 43 | echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV 44 | 45 | - name: Build and push image 46 | uses: docker/build-push-action@v6 47 | with: 48 | context: . 49 | file: ./docker/debug-pod/Dockerfile 50 | platforms: linux/amd64,linux/arm64 51 | push: true 52 | tags: | 53 | ${{ vars.DOCKERHUB_REGISTRY_URL }}/greptime/greptime-tool:${{ env.IMAGE_TAG }} 54 | ${{ vars.OCI_REGISTRY_URL }}/greptime/greptime-tool:${{ env.IMAGE_TAG }} 55 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | chart-test: 7 | runs-on: ubuntu-latest 8 | if: ${{ github.repository == 'GreptimeTeam/helm-charts' }} 9 | steps: 10 | - name: Checkout sources 11 | uses: actions/checkout@v3 12 | with: 13 | fetch-depth: 0 14 | 15 | - name: Check docs 16 | run: | 17 | make check-docs 18 | 19 | - name: Check crds 20 | run: | 21 | make check-crds 22 | 23 | - name: Install Helm 24 | uses: azure/setup-helm@v3 25 | with: 26 | version: v3.12.1 27 | 28 | - name: Testing add greptime helm repo 29 | run: | 30 | helm repo add greptime https://greptimeteam.github.io/helm-charts/ 31 | helm repo add grafana https://grafana.github.io/helm-charts/ 32 | helm repo add jaeger-all-in-one https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts/ 33 | helm search repo greptime 34 | 35 | - uses: actions/setup-python@v4 36 | with: 37 | python-version: '3.9' 38 | 39 | - name: Set up chart-testing 40 | uses: helm/chart-testing-action@v2.6.0 41 | 42 | - name: Run chart-testing (list-changed) 43 | id: list-changed 44 | run: | 45 | changed=$(ct list-changed --chart-dirs charts --target-branch ${{ github.event.repository.default_branch }}) 46 | if [[ -n "$changed" ]]; then 47 | echo "changed=true" >> "$GITHUB_OUTPUT" 48 | fi 49 | 50 | - name: Run chart-testing (lint) 51 | if: steps.list-changed.outputs.changed == 'true' 52 | run: ct lint --validate-maintainers=false --target-branch ${{ github.event.repository.default_branch }} 53 | 54 | - name: Create kind cluster 55 | if: steps.list-changed.outputs.changed == 'true' 56 | uses: helm/kind-action@v1.8.0 57 | with: 58 | wait: 120s 59 | 60 | - name: Run e2e 61 | if: steps.list-changed.outputs.changed == 'true' 62 | run: | 63 | make e2e 64 | -------------------------------------------------------------------------------- /.github/workflows/e2e.yaml: -------------------------------------------------------------------------------- 1 | name: E2E 2 | 3 | on: 4 | schedule: 5 | - cron: '0 2 * * 1-5' 6 | workflow_dispatch: 7 | inputs: 8 | chart: 9 | type: choice 10 | description: Chart Name 11 | required: true 12 | options: 13 | - greptimedb-cluster 14 | - greptimedb-standalone 15 | 16 | jobs: 17 | e2e: 18 | runs-on: ubuntu-latest 19 | if: ${{ github.repository == 'GreptimeTeam/helm-charts' }} 20 | steps: 21 | - name: Checkout code 22 | uses: actions/checkout@v3 23 | 24 | - name: Install Helm 25 | uses: azure/setup-helm@v3 26 | with: 27 | version: v3.12.1 28 | 29 | - name: Create kind cluster 30 | uses: helm/kind-action@v1.8.0 31 | with: 32 | wait: 120s 33 | 34 | - name: Deploy greptimedb-cluster 35 | if: ${{ github.event_name == 'schedule' || github.event.inputs.chart == 'greptimedb-cluster' }} 36 | shell: bash 37 | run: | 38 | make e2e-greptimedb-cluster 39 | continue-on-error: true 40 | 41 | - name: Deploy greptimedb-standalone 42 | if: ${{ github.event_name == 'schedule' || github.event.inputs.chart == 'greptimedb-standalone' }} 43 | shell: bash 44 | run: | 45 | make e2e-greptimedb-standalone 46 | continue-on-error: true 47 | 48 | - name: Notify Slack 49 | if: ${{ failure() }} 50 | uses: slackapi/slack-github-action@v1.25.0 51 | env: 52 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} 53 | with: 54 | payload: | 55 | {"text": "helm-charts e2e failed. Please check: https://github.com/GreptimeTeam/helm-charts/actions/workflows/e2e.yaml"} 56 | -------------------------------------------------------------------------------- /.github/workflows/pr-labeling.yaml: -------------------------------------------------------------------------------- 1 | name: 'PR Labeling' 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - synchronize 8 | - reopened 9 | 10 | permissions: 11 | contents: read 12 | pull-requests: write 13 | issues: write 14 | 15 | jobs: 16 | labeler: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout sources 20 | uses: actions/checkout@v4 21 | 22 | - uses: actions/labeler@v5 23 | with: 24 | configuration-path: ".github/labeler.yaml" 25 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 26 | sync-labels: true 27 | 28 | size-label: 29 | runs-on: ubuntu-latest 30 | steps: 31 | - uses: pascalgn/size-label-action@v0.5.5 32 | env: 33 | GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 34 | -------------------------------------------------------------------------------- /.github/workflows/pr-title-checker.yaml: -------------------------------------------------------------------------------- 1 | name: "PR Title Checker" 2 | on: 3 | pull_request_target: 4 | types: 5 | - opened 6 | - edited 7 | - synchronize 8 | - labeled 9 | - unlabeled 10 | 11 | jobs: 12 | check: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: thehanimo/pr-title-checker@v1.4.2 16 | with: 17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 18 | pass_on_octokit_error: false 19 | configuration_path: ".github/pr-title-checker-config.json" 20 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release Charts 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | inputs: 9 | release-charts-to-acr: 10 | description: Release the Helm charts to ACR 11 | required: false 12 | default: 'false' 13 | 14 | jobs: 15 | release: 16 | permissions: 17 | contents: write 18 | runs-on: ubuntu-latest 19 | if: ${{ github.repository == 'GreptimeTeam/helm-charts' }} 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v4 23 | with: 24 | fetch-depth: 0 25 | 26 | - name: Configure Git 27 | run: | 28 | git config user.name "$GITHUB_ACTOR" 29 | git config user.email "$GITHUB_ACTOR@users.noreply.github.com" 30 | 31 | - name: Install Helm 32 | uses: azure/setup-helm@v4.2.0 33 | 34 | - name: Add Dependencies 35 | run: | 36 | helm repo add grafana https://grafana.github.io/helm-charts 37 | helm repo add jaeger-all-in-one https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts/ 38 | 39 | - name: Run chart-releaser 40 | uses: helm/chart-releaser-action@v1.6.0 41 | with: 42 | charts_dir: charts 43 | env: 44 | CR_SKIP_EXISTING: true 45 | CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 46 | 47 | release-charts-to-acr: 48 | runs-on: ubuntu-latest 49 | if: ${{ github.repository == 'GreptimeTeam/helm-charts' && (inputs.release-charts-to-acr == 'true' || github.event_name == 'push') }} 50 | steps: 51 | - name: Check out code 52 | uses: actions/checkout@v4 53 | 54 | - name: Set up Helm 55 | uses: azure/setup-helm@v4.2.0 56 | 57 | - name: Login to OCI registry 58 | run: echo '${{ secrets.ALICLOUD_PASSWORD }}' | helm registry login ${{ vars.OCI_REGISTRY_URL }} -u ${{ secrets.ALICLOUD_USERNAME }} --password-stdin 59 | 60 | - name: Package and push Helm Charts 61 | shell: bash 62 | env: 63 | OCI_REGISTRY_URL: ${{ vars.OCI_REGISTRY_URL }} 64 | OCI_NAMESPACE: ${{ vars.OCI_NAMESPACE }} 65 | run: | 66 | ./scripts/release/release-charts-to-acr.sh 67 | 68 | release-charts-to-s3: 69 | needs: [ 70 | release, 71 | ] 72 | runs-on: ubuntu-latest 73 | steps: 74 | # TODO(zyy17): Maybe it's not a elegant way to wait for GitHub Pages to update. For many scenarios, waiting for 5 minutes is enough. 75 | - name: Wait for deployment of GitHub Pages 76 | run: | 77 | sleep 300 78 | 79 | - name: Checkout 80 | uses: actions/checkout@v4 81 | with: 82 | fetch-depth: 0 83 | 84 | - name: Install s5cmd 85 | shell: bash 86 | run: | 87 | wget https://github.com/peak/s5cmd/releases/download/v2.3.0/s5cmd_2.3.0_Linux-64bit.tar.gz 88 | tar -xzf s5cmd_2.3.0_Linux-64bit.tar.gz 89 | sudo mv s5cmd /usr/local/bin/ 90 | sudo chmod +x /usr/local/bin/s5cmd 91 | 92 | - name: Release charts to S3 93 | shell: bash 94 | run: | 95 | ./scripts/release/release-charts-to-s3.sh ${{ vars.AWS_RELEASE_BUCKET }} 96 | env: 97 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CN_ACCESS_KEY_ID }} 98 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CN_SECRET_ACCESS_KEY }} 99 | AWS_REGION: ${{ vars.AWS_RELEASE_BUCKET_REGION }} 100 | -------------------------------------------------------------------------------- /.github/workflows/update-dashboards.yaml: -------------------------------------------------------------------------------- 1 | name: Update Grafana Dashboards 2 | 3 | on: 4 | schedule: 5 | - cron: '0 1 * * *' # Run daily at 01:00 UTC. 6 | workflow_dispatch: 7 | 8 | jobs: 9 | update-dashboards: 10 | if: ${{ github.repository == 'GreptimeTeam/helm-charts' }} 11 | runs-on: ubuntu-latest 12 | permissions: 13 | contents: write 14 | pull-requests: write 15 | 16 | steps: 17 | - name: Checkout repository 18 | uses: actions/checkout@v4 19 | 20 | - name: Create Pull Request 21 | env: 22 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 23 | run: | 24 | ./scripts/update/update-grafana-dashboard.sh 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | .vscode/ 4 | .helm/ 5 | *.tgz 6 | /.idea/* 7 | .vscode 8 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, caste, color, religion, or sexual 10 | identity and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the overall 26 | community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or advances of 31 | any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email address, 35 | without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | info@greptime.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series of 86 | actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or permanent 93 | ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within the 113 | community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.1, available at 119 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 120 | 121 | Community Impact Guidelines were inspired by 122 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 123 | 124 | For answers to common questions about this code of conduct, see the FAQ at 125 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at 126 | [https://www.contributor-covenant.org/translations][translations]. 127 | 128 | [homepage]: https://www.contributor-covenant.org 129 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 130 | [Mozilla CoC]: https://github.com/mozilla/diversity 131 | [FAQ]: https://www.contributor-covenant.org/faq 132 | [translations]: https://www.contributor-covenant.org/translations 133 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are welcome through GitHub pull request. This document outlines the steps to facilitate the acceptance of your contribution. 4 | 5 | ## How to Contribute 6 | 7 | 1. Fork repository, develop, and test your changes. 8 | 2. Bump the chart version and update chart documentation. 9 | 3. Submit a pull request. 10 | 11 | To simplify testing and merging, please submit changes for only one chart per pull request. 12 | 13 | ### Technical Requirements 14 | 15 | * Must follow [charts best practices](https://helm.sh/docs/topics/chart_best_practices/). 16 | * Must pass CI jobs for linting and installing changed charts with the [chart-testing](https://github.com/helm/chart-testing) tool. 17 | * Any change to a chart requires a version bump following [semver](https://semver.org/) principles. See [Immutability](#immutability) and [Versioning](#versioning) below. 18 | 19 | Once changes have been merged, the release job will automatically run to package and release changed charts. 20 | 21 | ### Immutability 22 | 23 | Chart releases must be immutable. Any change to a chart, including documentation updates, requires bumping the chart version. 24 | 25 | ### Versioning 26 | 27 | Version numbers follow [semantic versioning](https://semver.org/). When making changes to a chart, update the version in `Chart.yaml` as follows: 28 | 29 | - MAJOR version (x.0.0): Incompatible API changes 30 | * Breaking changes to values.yaml structure. 31 | * Removal of deprecated features. 32 | * Major Kubernetes version requirement changes. 33 | 34 | - MINOR version (0.x.0): Added functionality in a backward compatible manner 35 | * New optional parameters or features. 36 | * New capabilities that maintain backward compatibility. 37 | 38 | - PATCH version (0.0.x): Backward compatible bug fixes or documentation updates 39 | * Bug fixes that don't change the chart's functionality. 40 | * Documentation improvements. 41 | * Minor clarifications or corrections. 42 | 43 | ### Generate documentation 44 | 45 | Documentation for charts is automatically generated from the following sources: 46 | - Chart.yaml: Metadata and version information. 47 | - values.yaml: Configuration options and defaults. 48 | - README.md.gotmpl: Template for the chart's README. 49 | 50 | To regenerate documentation after making changes: 51 | 52 | ```shell 53 | make docs 54 | ``` 55 | 56 | ### Community Requirements 57 | 58 | This project is released with a [Contributor Covenant](https://www.contributor-covenant.org). 59 | By participating in this project you agree to abide by its terms. 60 | See [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md). 61 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2022 Greptime Team 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | HELM_DOCS_VERSION = v1.12.0 2 | 3 | # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) 4 | ifeq (,$(shell go env GOBIN)) 5 | GOBIN=$(shell go env GOPATH)/bin 6 | else 7 | GOBIN=$(shell go env GOBIN) 8 | endif 9 | 10 | .PHONY: install-helm-docs 11 | install-helm-docs: ## Install helm-docs tool 12 | go install github.com/norwoodj/helm-docs/cmd/helm-docs@${HELM_DOCS_VERSION} 13 | 14 | .PHONY: docs 15 | docs: install-helm-docs ## Run helm-docs 16 | $(GOBIN)/helm-docs -c charts/greptimedb-cluster --chart-search-root=charts/greptimedb-cluster --template-files=README.md.gotmpl 17 | $(GOBIN)/helm-docs -c charts/greptimedb-operator --chart-search-root=charts/greptimedb-operator --template-files=README.md.gotmpl 18 | $(GOBIN)/helm-docs -c charts/greptimedb-standalone --chart-search-root=charts/greptimedb-standalone --template-files=README.md.gotmpl 19 | 20 | .PHONY: check-docs 21 | check-docs: docs ## Check docs 22 | @git diff --quiet || \ 23 | (echo "Need to update documentation, please run 'make docs'"; \ 24 | exit 1) 25 | 26 | .PHONY: e2e-greptimedb-cluster 27 | e2e-greptimedb-cluster: ## Run greptimedb-cluster e2e tests 28 | ./scripts/e2e/greptimedb-cluster.sh 29 | 30 | .PHONY: e2e-greptimedb-standalone 31 | e2e-greptimedb-standalone: ## Run greptimedb-standalone e2e tests 32 | ./scripts/e2e/greptimedb-standalone.sh 33 | 34 | .PHONY: e2e 35 | e2e: ## Run e2e tests 36 | ./scripts/e2e/greptimedb-cluster.sh 37 | ./scripts/e2e/greptimedb-standalone.sh 38 | 39 | .PHONY: update-crds 40 | update-crds: ## Run update crd 41 | ./scripts/crds/update-crds.sh 42 | 43 | .PHONY: upgrade-crds 44 | upgrade-crds: ## Upgrade the crds in the cluster. 45 | ./scripts/crds/upgrade-crds.sh $(CRDS_VERSION) 46 | 47 | .PHONY: check-crds 48 | check-crds: update-crds ## Check crd 49 | @git diff --quiet || \ 50 | (echo "Need to update crds, please run 'make crds'"; \ 51 | exit 1) 52 | 53 | # For example: make update-version CHART=${CHART_NAME} VERSION=${IMAGE_TAG} 54 | # make update-version CHART=greptimedb-standalone VERSION=v0.14.2 55 | # make update-version CHART=greptimedb-cluster VERSION=v0.14.2 56 | # make update-version CHART=greptimedb-operator VERSION=v0.2.2 57 | .PHONY: update-version 58 | update-version: ## Run update version 59 | ./scripts/update/update-version.sh $(CHART) $(VERSION) 60 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Greptime Helm Charts 2 | 3 | ## Overview 4 | 5 | This is the repository that contains [Greptime](https://greptime.com/) Helm charts. 6 | 7 | ## Prerequisites 8 | 9 | - [Helm v3](https://helm.sh/docs/intro/install/) 10 | 11 | ## Getting Started 12 | 13 | ### Add Chart Repository 14 | 15 | You can add the chart repository with the following commands: 16 | 17 | ```console 18 | helm repo add greptime https://greptimeteam.github.io/helm-charts/ 19 | helm repo update 20 | ``` 21 | 22 | You can run the following command to see the charts: 23 | 24 | ```console 25 | helm search repo greptime 26 | ``` 27 | 28 | ### OCI Artifacts 29 | 30 | Besides using the GitHub chart repo, you can also use OCI artifacts. 31 | 32 | The charts are also available in ACR namespace `greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts`. 33 | 34 | You don't have to add a chart repository explicitly when using OCI artifacts, for example: 35 | 36 | ```console 37 | helm upgrade \ 38 | --install \ 39 | --create-namespace \ 40 | --set image.registry=greptime-registry.cn-hangzhou.cr.aliyuncs.com \ 41 | greptimedb-operator oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/greptimedb-operator \ 42 | -n greptimedb-admin 43 | ``` 44 | 45 | The chart name and version will remain consistent with the GitHub chart repo. 46 | 47 | ### Install the GreptimeDB Cluster 48 | 49 | If you want to deploy the GreptimeDB cluster, you can use the following commands: 50 | 51 | 1. **Deploy etcd cluster** 52 | 53 | We recommend using the Bitnami etcd [chart](https://github.com/bitnami/charts/blob/main/bitnami/etcd/README.md) to deploy the etcd cluster: 54 | 55 | ```console 56 | helm upgrade \ 57 | --install etcd oci://registry-1.docker.io/bitnamicharts/etcd \ 58 | --set replicaCount=3 \ 59 | --set auth.rbac.create=false \ 60 | --set auth.rbac.token.enabled=false \ 61 | --create-namespace \ 62 | -n etcd-cluster 63 | ``` 64 | 65 | You can also use `oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/etcd:11.3.4`. 66 | 67 | For detailed operations (backup, restore, monitoring, defrag), refer to the [etcd management guide](https://docs.greptime.com/user-guide/deployments-administration/manage-metadata/manage-etcd). 68 | 69 | 70 | 2. **Deploy GreptimeDB operator** 71 | 72 | The greptimedb-operator will install in the `greptimedb-admin` namespace: 73 | 74 | ```console 75 | helm upgrade \ 76 | --install \ 77 | --create-namespace \ 78 | greptimedb-operator greptime/greptimedb-operator \ 79 | -n greptimedb-admin 80 | ``` 81 | 82 | 3. **Deploy GreptimeDB cluster** 83 | 84 | Install the GreptimeDB cluster in the `default` namespace: 85 | 86 | - **Default installation** 87 | 88 | The default installation will use the local storage: 89 | 90 | ```console 91 | helm upgrade \ 92 | --install mycluster \ 93 | --set meta.backendStorage.etcd.endpoints=etcd.etcd-cluster.svc.cluster.local:2379 \ 94 | greptime/greptimedb-cluster \ 95 | -n default 96 | ``` 97 | 98 | - **Use AWS S3 as backend storage** 99 | 100 | Before installation, you must create the AWS S3 bucket, and the cluster will use the bucket as backend storage: 101 | 102 | ```console 103 | helm upgrade \ 104 | --install mycluster \ 105 | --set meta.backendStorage.etcd.endpoints=etcd.etcd-cluster.svc.cluster.local:2379 \ 106 | --set objectStorage.s3.bucket="your-bucket" \ 107 | --set objectStorage.s3.region="region-of-bucket" \ 108 | --set objectStorage.s3.root="root-directory-of-data" \ 109 | --set objectStorage.credentials.accessKeyId="your-access-key-id" \ 110 | --set objectStorage.credentials.secretAccessKey="your-secret-access-key" \ 111 | greptime/greptimedb-cluster \ 112 | -n default 113 | ``` 114 | 115 | 4. **Use `kubectl port-forward` to access the GreptimeDB cluster** 116 | 117 | ```console 118 | # You can use the MySQL or PostgreSQL client to connect the cluster, for example: 'mysql -h 127.0.0.1 -P 4002'. 119 | kubectl port-forward -n default svc/mycluster-frontend 4001:4001 4002:4002 4003:4003 4000:4000 120 | ``` 121 | 122 | If you want to expose the service to the public, you can use the `kubectl port-forward` command with the `--address` option: 123 | 124 | ```console 125 | kubectl port-forward --address 0.0.0.0 svc/mycluster-frontend 4001:4001 4002:4002 4003:4003 4000:4000 126 | ``` 127 | 128 | You can also [read](https://docs.greptime.com/user-guide/query-data/overview) and [write](https://docs.greptime.com/user-guide/ingest-data/overview) data by referring to the documentation. 129 | 130 | ### Upgrade 131 | 132 | If you want to re-deploy the service because the configurations changed, you can: 133 | 134 | ```console 135 | helm upgrade --install --values -n 136 | ``` 137 | 138 | For example: 139 | 140 | ```console 141 | helm upgrade --install mycluster greptime/greptimedb-cluster --values ./values.yaml 142 | ``` 143 | 144 | ### Uninstallation 145 | 146 | If you want to terminate the GreptimeDB cluster, you can use the following command: 147 | 148 | ```console 149 | helm uninstall mycluster -n default 150 | helm uninstall etcd -n etcd-cluster 151 | helm uninstall greptimedb-operator -n greptimedb-admin 152 | ``` 153 | 154 | The CRDs of GreptimeDB are **not deleted by default** after uninstalling greptimedb-operator unless you use `--set crds.keep=false`. 155 | 156 | You can delete CRDs manually by the following commands: 157 | 158 | ```console 159 | kubectl delete crds greptimedbclusters.greptime.io 160 | kubectl delete crds greptimedbstandalones.greptime.io 161 | ``` 162 | 163 | ## List of Charts 164 | 165 | - [greptimedb-operator](./charts/greptimedb-operator/README.md) 166 | - [greptimedb-standalone](./charts/greptimedb-standalone/README.md) 167 | - [greptimedb-cluster](./charts/greptimedb-cluster/README.md) 168 | 169 | ## License 170 | 171 | helm-charts uses the [Apache 2.0 license](./LICENSE) to strike a balance between open contributions and allowing you to use the software however you want. 172 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/.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/greptimedb-cluster/Chart.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: grafana 3 | repository: https://grafana.github.io/helm-charts 4 | version: 8.5.8 5 | - name: jaeger-all-in-one 6 | repository: https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts 7 | version: 0.1.12 8 | digest: sha256:e260d018c3781656e59282e609718348d11d82d9d8b3126f57761974b8c9b70f 9 | generated: "2024-11-28T10:39:55.943979+08:00" 10 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: greptimedb-cluster 3 | description: A Helm chart for deploying GreptimeDB cluster in Kubernetes. 4 | type: application 5 | version: 0.6.4 6 | appVersion: 0.15.1 7 | home: https://github.com/GreptimeTeam/greptimedb 8 | sources: 9 | - https://github.com/GreptimeTeam/greptimedb 10 | keywords: 11 | - database 12 | - greptimedb 13 | maintainers: 14 | - name: liyang 15 | email: liyang@greptime.com 16 | url: https://github.com/daviderli614 17 | - name: zyy17 18 | email: zyy@greptime.com 19 | url: https://github.com/zyy17 20 | dependencies: 21 | - name: grafana 22 | version: "8.5.8" 23 | repository: https://grafana.github.io/helm-charts 24 | condition: grafana.enabled 25 | # TODO(zyy17): Should we use the official Jaeger chart: https://github.com/jaegertracing/helm-charts/tree/main in the future? 26 | # The main function of the current chart is the same as the official one, but more lightweight and easy to use. 27 | - name: jaeger-all-in-one 28 | version: 0.1.12 29 | repository: https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts 30 | condition: jaeger-all-in-one.enabled 31 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/README.md.gotmpl: -------------------------------------------------------------------------------- 1 | {{ template "chart.header" . }} 2 | {{ template "chart.description" . }} 3 | 4 | {{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} 5 | 6 | ## Source Code 7 | 8 | - https://github.com/GreptimeTeam/greptimedb 9 | 10 | ## Compatibility Matrix 11 | 12 | Each row in the following matrix represents a version combination, indicating the required `greptimedb-operator` chart version when installing `greptimedb-cluster` chart. 13 | 14 | | `greptimedb-cluster` Chart Version | `greptimedb-operator` Chart Version | 15 | |----------------------------------|----------------------------------------------| 16 | | ≥ `0.4.0` | ≥ `0.3.0` with GreptimeDB Operator ≥ `v0.3.0` | 17 | | < `0.4.0` | < `0.3.0` with GreptimeDB Operator < `v0.3.0` | 18 | 19 | ## How to install 20 | 21 | ### Prerequisites 22 | 23 | 1. Install the [greptimedb-operator](../greptimedb-operator/README.md) and pay attention to the version compatibility in the above matrix. 24 | 25 | 2. Install the etcd cluster: 26 | 27 | ```console 28 | helm upgrade \ 29 | --install etcd oci://registry-1.docker.io/bitnamicharts/etcd \ 30 | --set replicaCount=3 \ 31 | --set auth.rbac.create=false \ 32 | --set auth.rbac.token.enabled=false \ 33 | --create-namespace \ 34 | -n etcd-cluster 35 | ``` 36 | 37 | ### Default installation 38 | 39 | The default installation will use the local storage: 40 | 41 | ```console 42 | helm upgrade \ 43 | --install mycluster \ 44 | --set meta.backendStorage.etcd.endpoints=etcd.etcd-cluster.svc.cluster.local:2379 \ 45 | greptime/greptimedb-cluster \ 46 | -n default 47 | ``` 48 | 49 | ### Use AWS S3 as backend storage 50 | 51 | Before installation, you must create the AWS S3 bucket, and the cluster will use the bucket as backend storage: 52 | 53 | ```console 54 | helm upgrade \ 55 | --install mycluster \ 56 | --set meta.backendStorage.etcd.endpoints=etcd.etcd-cluster.svc.cluster.local:2379 \ 57 | --set objectStorage.s3.bucket="your-bucket" \ 58 | --set objectStorage.s3.region="region-of-bucket" \ 59 | --set objectStorage.s3.root="root-directory-of-data" \ 60 | --set objectStorage.credentials.accessKeyId="your-access-key-id" \ 61 | --set objectStorage.credentials.secretAccessKey="your-secret-access-key" \ 62 | greptime/greptimedb-cluster \ 63 | -n default 64 | ``` 65 | 66 | If you set `storage.s3.root` as `mycluser`, then the data layout will be: 67 | 68 | ``` 69 | 70 | ├── mycluser 71 | │ ├── data/ 72 | ``` 73 | 74 | ## How to uninstall 75 | 76 | ```console 77 | helm uninstall mycluster -n default 78 | ``` 79 | 80 | {{ template "chart.requirementsSection" . }} 81 | 82 | {{ template "chart.valuesSection" . }} 83 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/dashboards/greptimedb-cluster-logs.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": { 7 | "type": "grafana", 8 | "uid": "-- Grafana --" 9 | }, 10 | "enable": true, 11 | "hide": true, 12 | "iconColor": "rgba(0, 211, 255, 1)", 13 | "name": "Annotations & Alerts", 14 | "type": "dashboard" 15 | } 16 | ] 17 | }, 18 | "editable": true, 19 | "fiscalYearStartMonth": 0, 20 | "graphTooltip": 0, 21 | "id": 12, 22 | "links": [], 23 | "panels": [ 24 | { 25 | "datasource": { 26 | "default": false, 27 | "type": "mysql", 28 | "uid": "${datasource}" 29 | }, 30 | "fieldConfig": { 31 | "defaults": {}, 32 | "overrides": [] 33 | }, 34 | "gridPos": { 35 | "h": 20, 36 | "w": 24, 37 | "x": 0, 38 | "y": 0 39 | }, 40 | "id": 1, 41 | "options": { 42 | "dedupStrategy": "none", 43 | "enableInfiniteScrolling": true, 44 | "enableLogDetails": true, 45 | "prettifyLogMessage": false, 46 | "showCommonLabels": false, 47 | "showLabels": false, 48 | "showTime": true, 49 | "sortOrder": "Descending", 50 | "wrapLogMessage": false 51 | }, 52 | "pluginVersion": "11.6.0", 53 | "targets": [ 54 | { 55 | "dataset": "greptime_private", 56 | "datasource": { 57 | "type": "mysql", 58 | "uid": "${datasource}" 59 | }, 60 | "editorMode": "code", 61 | "format": "table", 62 | "rawQuery": true, 63 | "rawSql": "SELECT `timestamp`, CONCAT('[', `level`, ']', ' ', '<', `target`, '>', ' ', `message`),\n `role`,\n `pod`,\n `pod_ip`,\n `namespace`,\n `cluster`,\n `err`,\n `file`,\n `module_path`\nFROM\n `_gt_logs`\nWHERE\n (\n \"$level\" = \"'all'\"\n OR `level` IN ($level)\n ) \n AND (\n \"$role\" = \"'all'\"\n OR `role` IN ($role)\n )\n AND (\n \"$pod\" = \"\"\n OR `pod` = '$pod'\n )\n AND (\n \"$target\" = \"\"\n OR `target` = '$target'\n )\n AND (\n \"$search\" = \"\"\n OR matches_term(`message`, '$search')\n )\n AND (\n \"$exclude\" = \"\"\n OR NOT matches_term(`message`, '$exclude')\n )\n AND $__timeFilter(`timestamp`)\nORDER BY `timestamp` DESC\nLIMIT $limit;\n", 64 | "refId": "A", 65 | "sql": { 66 | "columns": [ 67 | { 68 | "parameters": [], 69 | "type": "function" 70 | } 71 | ], 72 | "groupBy": [ 73 | { 74 | "property": { 75 | "type": "string" 76 | }, 77 | "type": "groupBy" 78 | } 79 | ], 80 | "limit": 50 81 | } 82 | } 83 | ], 84 | "title": "Logs", 85 | "type": "logs" 86 | } 87 | ], 88 | "preload": false, 89 | "refresh": "", 90 | "schemaVersion": 41, 91 | "tags": [], 92 | "templating": { 93 | "list": [ 94 | { 95 | "current": { 96 | "text": "logs", 97 | "value": "P98F38F12DB221A8C" 98 | }, 99 | "includeAll": false, 100 | "name": "datasource", 101 | "options": [], 102 | "query": "mysql", 103 | "refresh": 1, 104 | "regex": "", 105 | "type": "datasource" 106 | }, 107 | { 108 | "allValue": "'all'", 109 | "current": { 110 | "text": [ 111 | "$__all" 112 | ], 113 | "value": [ 114 | "$__all" 115 | ] 116 | }, 117 | "includeAll": true, 118 | "label": "level", 119 | "multi": true, 120 | "name": "level", 121 | "options": [ 122 | { 123 | "selected": false, 124 | "text": "INFO", 125 | "value": "INFO" 126 | }, 127 | { 128 | "selected": false, 129 | "text": "ERROR", 130 | "value": "ERROR" 131 | }, 132 | { 133 | "selected": false, 134 | "text": "WARN", 135 | "value": "WARN" 136 | }, 137 | { 138 | "selected": false, 139 | "text": "DEBUG", 140 | "value": "DEBUG" 141 | }, 142 | { 143 | "selected": false, 144 | "text": "TRACE", 145 | "value": "TRACE" 146 | } 147 | ], 148 | "query": "INFO,ERROR,WARN,DEBUG,TRACE", 149 | "type": "custom" 150 | }, 151 | { 152 | "allValue": "'all'", 153 | "current": { 154 | "text": [ 155 | "$__all" 156 | ], 157 | "value": [ 158 | "$__all" 159 | ] 160 | }, 161 | "includeAll": true, 162 | "label": "role", 163 | "multi": true, 164 | "name": "role", 165 | "options": [ 166 | { 167 | "selected": false, 168 | "text": "datanode", 169 | "value": "datanode" 170 | }, 171 | { 172 | "selected": false, 173 | "text": "frontend", 174 | "value": "frontend" 175 | }, 176 | { 177 | "selected": false, 178 | "text": "meta", 179 | "value": "meta" 180 | } 181 | ], 182 | "query": "datanode,frontend,meta", 183 | "type": "custom" 184 | }, 185 | { 186 | "current": { 187 | "text": "", 188 | "value": "" 189 | }, 190 | "label": "pod", 191 | "name": "pod", 192 | "options": [ 193 | { 194 | "selected": true, 195 | "text": "", 196 | "value": "" 197 | } 198 | ], 199 | "query": "", 200 | "type": "textbox" 201 | }, 202 | { 203 | "current": { 204 | "text": "", 205 | "value": "" 206 | }, 207 | "label": "target", 208 | "name": "target", 209 | "options": [ 210 | { 211 | "selected": true, 212 | "text": "", 213 | "value": "" 214 | } 215 | ], 216 | "query": "", 217 | "type": "textbox" 218 | }, 219 | { 220 | "current": { 221 | "text": "", 222 | "value": "" 223 | }, 224 | "label": "search", 225 | "name": "search", 226 | "options": [ 227 | { 228 | "selected": true, 229 | "text": "", 230 | "value": "" 231 | } 232 | ], 233 | "query": "", 234 | "type": "textbox" 235 | }, 236 | { 237 | "current": { 238 | "text": "", 239 | "value": "" 240 | }, 241 | "label": "exclude", 242 | "name": "exclude", 243 | "options": [ 244 | { 245 | "selected": true, 246 | "text": "", 247 | "value": "" 248 | } 249 | ], 250 | "query": "", 251 | "type": "textbox" 252 | }, 253 | { 254 | "current": { 255 | "text": "2000", 256 | "value": "2000" 257 | }, 258 | "includeAll": false, 259 | "label": "limit", 260 | "name": "limit", 261 | "options": [ 262 | { 263 | "selected": true, 264 | "text": "2000", 265 | "value": "2000" 266 | }, 267 | { 268 | "selected": false, 269 | "text": "5000", 270 | "value": "5000" 271 | }, 272 | { 273 | "selected": false, 274 | "text": "8000", 275 | "value": "8000" 276 | } 277 | ], 278 | "query": "2000,5000,8000", 279 | "type": "custom" 280 | } 281 | ] 282 | }, 283 | "time": { 284 | "from": "now-6h", 285 | "to": "now" 286 | }, 287 | "timepicker": {}, 288 | "timezone": "browser", 289 | "title": "GreptimeDB Logs", 290 | "uid": "edx5veo4rd3wge2", 291 | "version": 1 292 | } 293 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/scripts/pre-check/disk.sh: -------------------------------------------------------------------------------- 1 | echo "\n================== Disk tests ==================" 2 | echo "\n================== Running full I/O test ==================" 3 | fio --filename=/data/fio-rw.data --direct=1 --ioengine=libaio --time_based --runtime=60 --group_reporting \ 4 | --name=seq-read --rw=read --bs=4k --iodepth=64 --numjobs=1 --size=1G \ 5 | --name=seq-write --rw=write --bs=4k --iodepth=64 --numjobs=1 --size=1G \ 6 | --name=rand-iops --rw=randrw --bs=4k --iodepth=256 --numjobs=4 --size=1G 7 | 8 | echo "\n================== Running mixed read/write test ==================" 9 | fio --name=fiotest --filename=/data/fio.data --size=1Gb --rw=readwrite --bs=64k --direct=1 --numjobs=8 \ 10 | --ioengine=libaio --iodepth=16 --group_reporting --runtime=60 --startdelay=60 11 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/scripts/pre-check/kafka.sh: -------------------------------------------------------------------------------- 1 | echo "\n================== Kafka test ==================" 2 | 3 | KAFKA_ENDPOINT=${KAFKA_ENDPOINT} 4 | TOPIC="test-topic" 5 | CONSUMER_TIMEOUT_MS=15000 # 15s 6 | 7 | echo "\n================== Creating Kafka Topic ==================" 8 | if ! ./kafka/bin/kafka-topics.sh --create \ 9 | --topic $TOPIC \ 10 | --bootstrap-server $KAFKA_ENDPOINT \ 11 | --partitions 3 \ 12 | --replication-factor 1 \ 13 | --if-not-exists; then 14 | echo "ERROR: Failed to create Kafka topic $TOPIC" 15 | exit 1 16 | fi 17 | 18 | echo "\n================== Starting Consumer ==================" 19 | ./kafka/bin/kafka-console-consumer.sh \ 20 | --bootstrap-server $KAFKA_ENDPOINT \ 21 | --topic $TOPIC \ 22 | --timeout-ms $CONSUMER_TIMEOUT_MS \ 23 | > kafka_consume.log 2>&1 & 24 | 25 | CONSUMER_PID=$! 26 | 27 | sleep 5 28 | if ! ps -p $CONSUMER_PID > /dev/null; then 29 | echo "ERROR: Kafka consumer failed to start" 30 | cat kafka_consume.log 31 | exit 1 32 | fi 33 | 34 | echo "\n================== Producing Messages ==================" 35 | start_time=$(date +%s) 36 | if ! seq 1 20 | ./kafka/bin/kafka-console-producer.sh \ 37 | --broker-list $KAFKA_ENDPOINT \ 38 | --topic $TOPIC \ 39 | --batch-size 10; then 40 | echo "ERROR: Failed to produce messages to Kafka" 41 | kill $CONSUMER_PID 2>/dev/null 42 | exit 1 43 | fi 44 | end_time=$(date +%s) 45 | echo "Produce time: $((end_time - start_time)) seconds" 46 | 47 | wait $CONSUMER_PID 48 | CONSUMER_EXIT_CODE=$? 49 | 50 | echo "\n================== Consumed Messages ==================" 51 | if [ $CONSUMER_EXIT_CODE -ne 0 ]; then 52 | echo "ERROR: Kafka consumer failed (exit code: $CONSUMER_EXIT_CODE)" 53 | cat kafka_consume.log 54 | exit 1 55 | fi 56 | 57 | MESSAGE_COUNT=$(cat kafka_consume.log | wc -l) 58 | if [ "$MESSAGE_COUNT" -lt 20 ]; then 59 | echo "ERROR: Expected 20 messages, but only got $MESSAGE_COUNT" 60 | exit 1 61 | else 62 | echo "Successfully consumed $MESSAGE_COUNT messages" 63 | fi 64 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/scripts/pre-check/s3.sh: -------------------------------------------------------------------------------- 1 | S3_BUCKET=${S3_BUCKET} 2 | 3 | echo "\n================== Generating 10MB test file... ==================" 4 | dd if=/dev/urandom of=/tmp/s3-testfile bs=10M count=1 status=progress 5 | 6 | echo "\n================== Running S3 transfer test... ==================" 7 | echo "\n================== Upload s3 testfile... ==================" 8 | start_time=$(date +%s) 9 | script -q -c 's5cmd cp --show-progress /tmp/s3-testfile "s3://$S3_BUCKET/tmp/"' upload_testfile.log 10 | cat upload_testfile.log 11 | end_time=$(date +%s) 12 | echo "\n================== Upload time: $((end_time - start_time)) seconds ==================" 13 | 14 | echo "\n================== Download s3 testfile... ==================" 15 | start_time=$(date +%s) 16 | script -q -c 's5cmd cp --show-progress "s3://$S3_BUCKET/tmp/s3-testfile" /tmp/s3-testfile.download' download_testfile.log 17 | cat download_testfile.log 18 | end_time=$(date +%s) 19 | echo "\n================== Download time: $((end_time - start_time)) seconds ==================" 20 | 21 | # Verify file integrity 22 | echo "\n================== Verifying file integrity... ==================" 23 | original_size=$(wc -c < /tmp/s3-testfile) 24 | downloaded_size=$(wc -c < /tmp/s3-testfile.download) 25 | md5_original=$(md5sum /tmp/s3-testfile | awk '{print $1}') 26 | md5_downloaded=$(md5sum /tmp/s3-testfile.download | awk '{print $1}') 27 | 28 | if [ "$original_size" -eq "$downloaded_size" ] && [ "$md5_original" = "$md5_downloaded" ]; then 29 | echo "\n================== S3 test passed ==================" 30 | echo "File size: $original_size bytes" 31 | echo "MD5 checksum: $md5_original" 32 | else 33 | echo "\n================== S3 test failed ==================" 34 | echo "Original size: $original_size bytes" 35 | echo "Downloaded size: $downloaded_size bytes" 36 | echo "Original MD5: $md5_original" 37 | echo "Downloaded MD5: $md5_downloaded" 38 | exit 1 39 | fi 40 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | *********************************************************************** 2 | Welcome to use greptimedb-cluster 3 | Chart version: {{ .Chart.Version }} 4 | GreptimeDB Cluster version: {{ .Chart.AppVersion }} 5 | *********************************************************************** 6 | 7 | Installed components: 8 | * greptimedb-meta 9 | {{- if or .Values.datanode.enabled .Values.datanodeGroups }} 10 | * greptimedb-datanode 11 | {{- end }} 12 | {{- if or .Values.frontend.enabled .Values.frontendGroups }} 13 | * greptimedb-frontend 14 | {{- end }} 15 | {{- if .Values.flownode.enabled }} 16 | * greptimedb-flownode 17 | {{- end }} 18 | 19 | The greptimedb-cluster is starting, use `kubectl get pods -n {{ .Release.Namespace }}` to check its status. -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "greptimedb-cluster.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 7 | {{- end }} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "greptimedb-cluster.fullname" -}} 15 | {{- if .Values.fullnameOverride }} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 17 | {{- else }} 18 | {{- $name := default .Chart.Name .Values.nameOverride }} 19 | {{- if contains $name .Release.Name }} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 21 | {{- else }} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 23 | {{- end }} 24 | {{- end }} 25 | {{- end }} 26 | 27 | {{/* 28 | Create the name of the service account to use 29 | */}} 30 | {{- define "greptimedb-cluster.serviceAccountName" -}} 31 | {{- if .Values.serviceAccount.create }} 32 | {{- default (include "greptimedb-cluster.fullname" .) .Values.serviceAccount.name }} 33 | {{- else }} 34 | {{- default "default" .Values.serviceAccount.name }} 35 | {{- end }} 36 | {{- end }} 37 | 38 | {{/* 39 | Create chart name and version as used by the chart label. 40 | */}} 41 | {{- define "greptimedb-cluster.chart" -}} 42 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 43 | {{- end }} 44 | 45 | {{/* 46 | Common labels 47 | */}} 48 | {{- define "greptimedb-cluster.labels" -}} 49 | helm.sh/chart: {{ include "greptimedb-cluster.chart" . }} 50 | {{ include "greptimedb-cluster.selectorLabels" . }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/component: cluster 55 | app.kubernetes.io/managed-by: {{ .Release.Service }} 56 | app.kubernetes.io/part-of: greptimedb-cluster 57 | {{- with .Values.additionalLabels }} 58 | {{ toYaml . }} 59 | {{- end }} 60 | {{- end }} 61 | 62 | {{/* 63 | Selector labels 64 | */}} 65 | {{- define "greptimedb-cluster.selectorLabels" -}} 66 | app.kubernetes.io/name: {{ include "greptimedb-cluster.name" . }} 67 | app.kubernetes.io/instance: {{ .Release.Name }} 68 | {{- end }} 69 | 70 | {{/* 71 | Generate docker config json 72 | */}} 73 | {{- define "dockerConfigJSON" -}} 74 | {{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"auth\":\"%s\"}}}" .Values.customImageRegistry.registry .Values.customImageRegistry.username .Values.customImageRegistry.password (printf "%s:%s" .Values.customImageRegistry.username .Values.customImageRegistry.password | b64enc) -}} 75 | {{- end -}} 76 | 77 | {{/* 78 | Validate datanode config 79 | */}} 80 | {{- define "validateDatanodeConfig" -}} 81 | {{- if and .Values.datanode.enabled .Values.datanodeGroups }} 82 | {{- fail "datanode and datanodeGroups cannot be set at the same time" }} 83 | {{- end }} 84 | {{- end }} 85 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/cluster.yaml: -------------------------------------------------------------------------------- 1 | {{- include "validateDatanodeConfig" . }} 2 | apiVersion: greptime.io/v1alpha1 3 | kind: GreptimeDBCluster 4 | metadata: 5 | name: {{ .Release.Name }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 9 | spec: 10 | base: 11 | main: 12 | image: '{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}' 13 | {{- if .Values.base.podTemplate.main.resources }} 14 | resources: {{- toYaml .Values.base.podTemplate.main.resources | nindent 8 }} 15 | {{- end }} 16 | {{- if .Values.base.podTemplate.main.command }} 17 | command: {{ .Values.base.podTemplate.main.command | toYaml | nindent 8 }} 18 | {{- end }} 19 | {{- if .Values.base.podTemplate.main.args }} 20 | args: {{ .Values.base.podTemplate.main.args | toYaml | nindent 8 }} 21 | {{- end }} 22 | {{- if .Values.base.podTemplate.main.env }} 23 | env: {{- toYaml .Values.base.podTemplate.main.env | nindent 8 }} 24 | {{- end }} 25 | {{- if .Values.base.podTemplate.main.startupProbe }} 26 | startupProbe: {{- toYaml .Values.base.podTemplate.main.startupProbe | nindent 8 }} 27 | {{- end }} 28 | {{- if .Values.base.podTemplate.main.readinessProbe }} 29 | readinessProbe: {{- toYaml .Values.base.podTemplate.main.readinessProbe | nindent 8 }} 30 | {{- end }} 31 | {{- if .Values.base.podTemplate.main.livenessProbe }} 32 | livenessProbe: {{- toYaml .Values.base.podTemplate.main.livenessProbe | nindent 8 }} 33 | {{- end }} 34 | {{- if .Values.base.podTemplate.main.securityContext }} 35 | securityContext: {{ .Values.base.podTemplate.main.securityContext | toYaml | nindent 8 }} 36 | {{- end }} 37 | {{- if .Values.base.podTemplate.annotations }} 38 | annotations: {{ .Values.base.podTemplate.annotations | toYaml | nindent 6 }} 39 | {{- end }} 40 | {{- if .Values.base.podTemplate.labels }} 41 | labels: {{ .Values.base.podTemplate.labels | toYaml | nindent 6 }} 42 | {{- end }} 43 | {{- if .Values.base.podTemplate.serviceAccountName }} 44 | serviceAccountName: {{ .Values.base.podTemplate.serviceAccountName }} 45 | {{- end }} 46 | {{- if .Values.base.podTemplate.tolerations }} 47 | tolerations: {{ .Values.base.podTemplate.tolerations | toYaml | nindent 6 }} 48 | {{- end }} 49 | {{- if .Values.base.podTemplate.affinity }} 50 | affinity: {{ .Values.base.podTemplate.affinity | toYaml | nindent 6 }} 51 | {{- end }} 52 | {{- if .Values.base.podTemplate.nodeSelector }} 53 | nodeSelector: {{ .Values.base.podTemplate.nodeSelector | toYaml | nindent 6 }} 54 | {{- end }} 55 | {{- if .Values.image.pullSecrets }} 56 | imagePullSecrets: 57 | {{- range .Values.image.pullSecrets }} 58 | - name: {{ . }} 59 | {{- end }} 60 | {{- end }} 61 | {{- if .Values.base.podTemplate.securityContext }} 62 | securityContext: {{ .Values.base.podTemplate.securityContext | toYaml | nindent 6 }} 63 | {{- end }} 64 | {{- if .Values.base.podTemplate.terminationGracePeriodSeconds }} 65 | terminationGracePeriodSeconds: {{ .Values.base.podTemplate.terminationGracePeriodSeconds }} 66 | {{- end }} 67 | {{- if .Values.frontend }} 68 | {{- if .Values.frontend.enabled }} 69 | frontend: 70 | replicas: {{ .Values.frontend.replicas }} 71 | {{- if or .Values.frontend.configFile .Values.frontend.configData }} 72 | config: |- 73 | {{- if .Values.frontend.configFile }} 74 | {{ .Files.Get .Values.frontend.configFile | indent 6 }} 75 | {{- else }} 76 | {{ .Values.frontend.configData | indent 6 }} 77 | {{- end }} 78 | {{- end }} 79 | {{- if .Values.frontend.tls }} 80 | tls: 81 | secretName: {{ .Values.frontend.tls.secretName }} 82 | {{- end }} 83 | {{- if .Values.frontend.service }} 84 | service: {{- toYaml .Values.frontend.service | nindent 6 }} 85 | {{- end }} 86 | template: 87 | main: 88 | {{- if .Values.frontend.podTemplate.main.image }} 89 | image: {{ .Values.frontend.podTemplate.main.image }} 90 | {{- end }} 91 | {{- if .Values.frontend.podTemplate.main.command }} 92 | command: {{ .Values.frontend.podTemplate.main.command | toYaml | nindent 8 }} 93 | {{- end }} 94 | {{- if .Values.frontend.podTemplate.main.args }} 95 | args: {{ .Values.frontend.podTemplate.main.args | toYaml | nindent 8 }} 96 | {{- end }} 97 | {{- if or .Values.auth.enabled .Values.frontend.podTemplate.main.env }} 98 | env: 99 | {{- if .Values.auth.enabled }} 100 | - name: GREPTIMEDB_FRONTEND__USER_PROVIDER 101 | value: "static_user_provider:file:{{ .Values.auth.mountPath }}/{{ .Values.auth.fileName }}" 102 | {{- end }} 103 | {{- if .Values.frontend.podTemplate.main.env }} 104 | {{- toYaml .Values.frontend.podTemplate.main.env | nindent 8 }} 105 | {{- end }} 106 | {{- end }} 107 | {{- if or .Values.auth.enabled .Values.frontend.podTemplate.main.volumeMounts }} 108 | volumeMounts: 109 | {{- if .Values.frontend.podTemplate.main.volumeMounts }} 110 | {{- toYaml .Values.frontend.podTemplate.main.volumeMounts | nindent 8 }} 111 | {{- end }} 112 | {{- if .Values.auth.enabled }} 113 | - name: auth 114 | mountPath: {{ .Values.auth.mountPath }} 115 | {{- end }} 116 | {{- end }} 117 | resources: 118 | requests: {{ .Values.frontend.podTemplate.main.resources.requests | toYaml | nindent 12 }} 119 | limits: {{ .Values.frontend.podTemplate.main.resources.limits | toYaml | nindent 12 }} 120 | {{- if .Values.frontend.podTemplate.main.startupProbe }} 121 | startupProbe: {{- toYaml .Values.frontend.podTemplate.main.startupProbe | nindent 10 }} 122 | {{- end }} 123 | {{- if .Values.frontend.podTemplate.main.readinessProbe }} 124 | readinessProbe: {{- toYaml .Values.frontend.podTemplate.main.readinessProbe | nindent 10 }} 125 | {{- end }} 126 | {{- if .Values.frontend.podTemplate.main.livenessProbe }} 127 | livenessProbe: {{- toYaml .Values.frontend.podTemplate.main.livenessProbe | nindent 10 }} 128 | {{- end }} 129 | {{- if .Values.frontend.podTemplate.main.securityContext }} 130 | securityContext: {{ .Values.frontend.podTemplate.main.securityContext | toYaml | nindent 10 }} 131 | {{- end }} 132 | {{- if .Values.frontend.podTemplate.annotations }} 133 | annotations: {{ .Values.frontend.podTemplate.annotations | toYaml | nindent 8 }} 134 | {{- end }} 135 | {{- if .Values.frontend.podTemplate.labels }} 136 | labels: {{ .Values.frontend.podTemplate.labels | toYaml | nindent 8 }} 137 | {{- end }} 138 | {{- if .Values.frontend.podTemplate.serviceAccount.create }} 139 | serviceAccountName: {{ .Release.Name }}-frontend 140 | {{- end }} 141 | {{- if .Values.frontend.podTemplate.tolerations }} 142 | tolerations: {{ .Values.frontend.podTemplate.tolerations | toYaml | nindent 8 }} 143 | {{- end }} 144 | {{- if .Values.frontend.podTemplate.affinity }} 145 | affinity: {{ .Values.frontend.podTemplate.affinity | toYaml | nindent 8 }} 146 | {{- end }} 147 | {{- if .Values.frontend.podTemplate.nodeSelector }} 148 | nodeSelector: {{ .Values.frontend.podTemplate.nodeSelector | toYaml | nindent 8 }} 149 | {{- end }} 150 | {{- if .Values.frontend.podTemplate.terminationGracePeriodSeconds }} 151 | terminationGracePeriodSeconds: {{ .Values.frontend.podTemplate.terminationGracePeriodSeconds }} 152 | {{- end }} 153 | {{- if or .Values.auth.enabled .Values.frontend.podTemplate.volumes }} 154 | volumes: 155 | {{- if .Values.frontend.podTemplate.volumes }} 156 | {{- toYaml .Values.frontend.podTemplate.volumes | nindent 8 }} 157 | {{- end }} 158 | {{- if .Values.auth.enabled }} 159 | - name: auth 160 | secret: 161 | secretName: {{ .Release.Name }}-users-auth 162 | {{- end }} 163 | {{- end }} 164 | {{- if .Values.frontend.podTemplate.securityContext }} 165 | securityContext: {{ .Values.frontend.podTemplate.securityContext | toYaml | nindent 8 }} 166 | {{- end }} 167 | {{- if .Values.frontend.logging }} 168 | logging: 169 | {{- if .Values.frontend.logging.level }} 170 | level: {{ .Values.frontend.logging.level }} 171 | {{- end }} 172 | {{- if .Values.frontend.logging.format }} 173 | format: {{ .Values.frontend.logging.format }} 174 | {{- end }} 175 | {{- if .Values.frontend.logging.logsDir }} 176 | logsDir: {{ .Values.frontend.logging.logsDir }} 177 | {{- end }} 178 | {{- if .Values.frontend.logging.onlyLogToStdout }} 179 | onlyLogToStdout: {{ .Values.frontend.logging.onlyLogToStdout }} 180 | {{- end }} 181 | {{- if .Values.frontend.logging.persistentWithData }} 182 | persistentWithData: {{ .Values.frontend.logging.persistentWithData }} 183 | {{- end }} 184 | {{- if .Values.frontend.logging.filters }} 185 | filters: {{ .Values.frontend.logging.filters | toYaml | nindent 6 }} 186 | {{- end }} 187 | {{- end }} 188 | {{- if .Values.slowQuery }} 189 | slowQuery: 190 | enabled: {{ .Values.slowQuery.enabled }} 191 | recordType: {{ .Values.slowQuery.recordType }} 192 | threshold: {{ .Values.slowQuery.threshold }} 193 | sampleRatio: {{ .Values.slowQuery.sampleRatio | quote }} 194 | ttl: {{ .Values.slowQuery.ttl }} 195 | {{- end }} 196 | {{- end }} 197 | {{- end }} 198 | meta: 199 | replicas: {{ .Values.meta.replicas }} 200 | {{- if or .Values.meta.configFile .Values.meta.configData }} 201 | config: |- 202 | {{- if .Values.meta.configFile }} 203 | {{ .Files.Get .Values.meta.configFile | indent 6 }} 204 | {{- else }} 205 | {{ .Values.meta.configData | indent 6 }} 206 | {{- end }} 207 | {{- end }} 208 | {{- if .Values.meta.enableRegionFailover }} 209 | enableRegionFailover: {{ .Values.meta.enableRegionFailover }} 210 | {{- end }} 211 | {{- if or .Values.meta.backendStorage.mysql .Values.meta.backendStorage.postgresql .Values.meta.etcdEndpoints .Values.meta.etcd }} 212 | backendStorage: 213 | {{- if or .Values.meta.backendStorage.etcd .Values.meta.etcdEndpoints }} 214 | etcd: 215 | {{- if .Values.meta.backendStorage.etcd.endpoints }} 216 | endpoints: 217 | - {{ .Values.meta.backendStorage.etcd.endpoints }} 218 | {{- else if .Values.meta.etcdEndpoints }} 219 | endpoints: 220 | - {{ .Values.meta.etcdEndpoints }} 221 | {{- end }} 222 | {{- if .Values.meta.backendStorage.etcd.storeKeyPrefix }} 223 | storeKeyPrefix: {{ .Values.meta.backendStorage.etcd.storeKeyPrefix }} 224 | {{- else if .Values.meta.storeKeyPrefix }} 225 | storeKeyPrefix: {{ .Values.meta.storeKeyPrefix }} 226 | {{- end }} 227 | {{- end }} 228 | {{- if .Values.meta.backendStorage.mysql }} 229 | mysql: 230 | host: {{ .Values.meta.backendStorage.mysql.host }} 231 | port: {{ .Values.meta.backendStorage.mysql.port }} 232 | database: {{ .Values.meta.backendStorage.mysql.database }} 233 | table: {{ .Values.meta.backendStorage.mysql.table }} 234 | {{- if .Values.meta.backendStorage.mysql.credentials.existingSecretName }} 235 | credentialsSecretName: {{ .Values.meta.backendStorage.mysql.credentials.existingSecretName }} 236 | {{- else }} 237 | credentialsSecretName: {{ .Values.meta.backendStorage.mysql.credentials.secretName }} 238 | {{- end }} 239 | {{- end }} 240 | {{- if .Values.meta.backendStorage.postgresql }} 241 | postgresql: 242 | host: {{ .Values.meta.backendStorage.postgresql.host }} 243 | port: {{ .Values.meta.backendStorage.postgresql.port }} 244 | database: {{ .Values.meta.backendStorage.postgresql.database }} 245 | table: {{ .Values.meta.backendStorage.postgresql.table }} 246 | electionLockID: {{ .Values.meta.backendStorage.postgresql.electionLockID }} 247 | {{- if .Values.meta.backendStorage.postgresql.credentials.existingSecretName }} 248 | credentialsSecretName: {{ .Values.meta.backendStorage.postgresql.credentials.existingSecretName }} 249 | {{- else }} 250 | credentialsSecretName: {{ .Values.meta.backendStorage.postgresql.credentials.secretName }} 251 | {{- end }} 252 | {{- end }} 253 | {{- end }} 254 | {{- if .Values.meta.logging }} 255 | logging: 256 | {{- if .Values.meta.logging.level }} 257 | level: {{ .Values.meta.logging.level }} 258 | {{- end }} 259 | {{- if .Values.meta.logging.format }} 260 | format: {{ .Values.meta.logging.format }} 261 | {{- end }} 262 | {{- if .Values.meta.logging.logsDir }} 263 | logsDir: {{ .Values.meta.logging.logsDir }} 264 | {{- end }} 265 | {{- if .Values.meta.logging.onlyLogToStdout }} 266 | onlyLogToStdout: {{ .Values.meta.logging.onlyLogToStdout }} 267 | {{- end }} 268 | {{- if .Values.meta.logging.persistentWithData }} 269 | persistentWithData: {{ .Values.meta.logging.persistentWithData }} 270 | {{- end }} 271 | {{- if .Values.meta.logging.filters }} 272 | filters: {{ .Values.meta.logging.filters | toYaml | nindent 6 }} 273 | {{- end }} 274 | {{- end }} 275 | template: 276 | main: 277 | {{- if .Values.meta.podTemplate.main.image }} 278 | image: {{ .Values.meta.podTemplate.main.image }} 279 | {{- end }} 280 | {{- if .Values.meta.podTemplate.main.command }} 281 | command: {{ .Values.meta.podTemplate.main.command | toYaml | nindent 8 }} 282 | {{- end }} 283 | {{- if .Values.meta.podTemplate.main.args }} 284 | args: {{ .Values.meta.podTemplate.main.args | toYaml | nindent 8 }} 285 | {{- end }} 286 | {{- if .Values.meta.podTemplate.main.env }} 287 | env: {{- toYaml .Values.meta.podTemplate.main.env | nindent 8 }} 288 | {{- end }} 289 | {{- if .Values.meta.podTemplate.main.volumeMounts }} 290 | volumeMounts: {{- toYaml .Values.meta.podTemplate.main.volumeMounts | nindent 8 }} 291 | {{- end }} 292 | resources: 293 | requests: {{ .Values.meta.podTemplate.main.resources.requests | toYaml | nindent 12 }} 294 | limits: {{ .Values.meta.podTemplate.main.resources.limits | toYaml | nindent 12 }} 295 | {{- if .Values.meta.podTemplate.main.startupProbe }} 296 | startupProbe: {{- toYaml .Values.meta.podTemplate.main.startupProbe | nindent 10 }} 297 | {{- end }} 298 | {{- if .Values.meta.podTemplate.main.readinessProbe }} 299 | readinessProbe: {{- toYaml .Values.meta.podTemplate.main.readinessProbe | nindent 10 }} 300 | {{- end }} 301 | {{- if .Values.meta.podTemplate.main.livenessProbe }} 302 | livenessProbe: {{- toYaml .Values.meta.podTemplate.main.livenessProbe | nindent 10 }} 303 | {{- end }} 304 | {{- if .Values.meta.podTemplate.main.securityContext }} 305 | securityContext: {{ .Values.meta.podTemplate.main.securityContext | toYaml | nindent 10 }} 306 | {{- end }} 307 | {{- if .Values.meta.podTemplate.annotations }} 308 | annotations: {{ .Values.meta.podTemplate.annotations | toYaml | nindent 8 }} 309 | {{- end }} 310 | {{- if .Values.meta.podTemplate.labels }} 311 | labels: {{ .Values.meta.podTemplate.labels | toYaml | nindent 8 }} 312 | {{- end }} 313 | {{- if .Values.meta.podTemplate.serviceAccount.create }} 314 | serviceAccountName: {{ .Release.Name }}-meta 315 | {{- end }} 316 | {{- if .Values.meta.podTemplate.tolerations }} 317 | tolerations: {{ .Values.meta.podTemplate.tolerations | toYaml | nindent 8 }} 318 | {{- end }} 319 | {{- if .Values.meta.podTemplate.affinity }} 320 | affinity: {{ .Values.meta.podTemplate.affinity | toYaml | nindent 8 }} 321 | {{- end }} 322 | {{- if .Values.meta.podTemplate.nodeSelector }} 323 | nodeSelector: {{ .Values.meta.podTemplate.nodeSelector | toYaml | nindent 8 }} 324 | {{- end }} 325 | {{- if .Values.meta.podTemplate.volumes}} 326 | volumes: {{ .Values.meta.podTemplate.volumes | toYaml | nindent 8 }} 327 | {{- end }} 328 | {{- if .Values.meta.podTemplate.securityContext }} 329 | securityContext: {{ .Values.meta.podTemplate.securityContext | toYaml | nindent 8 }} 330 | {{- end }} 331 | {{- if .Values.meta.podTemplate.terminationGracePeriodSeconds }} 332 | terminationGracePeriodSeconds: {{ .Values.meta.podTemplate.terminationGracePeriodSeconds }} 333 | {{- end }} 334 | {{- if and .Values.datanode .Values.datanode.enabled }} 335 | datanode: 336 | replicas: {{ .Values.datanode.replicas }} 337 | {{- if or .Values.datanode.configFile .Values.datanode.configData }} 338 | config: |- 339 | {{- if .Values.datanode.configFile }} 340 | {{ .Files.Get .Values.datanode.configFile | indent 6 }} 341 | {{- else }} 342 | {{ .Values.datanode.configData | indent 6 }} 343 | {{- end }} 344 | {{- end }} 345 | template: 346 | main: 347 | {{- if .Values.datanode.podTemplate.main.image }} 348 | image: {{ .Values.datanode.podTemplate.main.image }} 349 | {{- end }} 350 | {{- if .Values.datanode.podTemplate.main.command }} 351 | command: {{ .Values.datanode.podTemplate.main.command | toYaml | nindent 8 }} 352 | {{- end }} 353 | {{- if .Values.datanode.podTemplate.main.args }} 354 | args: {{ .Values.datanode.podTemplate.main.args | toYaml | nindent 8 }} 355 | {{- end }} 356 | {{- if .Values.datanode.podTemplate.main.env }} 357 | env: {{- toYaml .Values.datanode.podTemplate.main.env | nindent 8 }} 358 | {{- end }} 359 | {{- if .Values.datanode.podTemplate.main.volumeMounts }} 360 | volumeMounts: {{- toYaml .Values.datanode.podTemplate.main.volumeMounts | nindent 8 }} 361 | {{- end }} 362 | resources: 363 | requests: {{ .Values.datanode.podTemplate.main.resources.requests | toYaml | nindent 12 }} 364 | limits: {{ .Values.datanode.podTemplate.main.resources.limits | toYaml | nindent 12 }} 365 | {{- if .Values.datanode.podTemplate.main.startupProbe }} 366 | startupProbe: {{- toYaml .Values.datanode.podTemplate.main.startupProbe | nindent 10 }} 367 | {{- end }} 368 | {{- if .Values.datanode.podTemplate.main.readinessProbe }} 369 | readinessProbe: {{- toYaml .Values.datanode.podTemplate.main.readinessProbe | nindent 10 }} 370 | {{- end }} 371 | {{- if .Values.datanode.podTemplate.main.livenessProbe }} 372 | livenessProbe: {{- toYaml .Values.datanode.podTemplate.main.livenessProbe | nindent 10 }} 373 | {{- end }} 374 | {{- if .Values.datanode.podTemplate.main.securityContext }} 375 | securityContext: {{ .Values.datanode.podTemplate.main.securityContext | toYaml | nindent 10 }} 376 | {{- end }} 377 | {{- if .Values.datanode.podTemplate.annotations }} 378 | annotations: {{ .Values.datanode.podTemplate.annotations | toYaml | nindent 8 }} 379 | {{- end }} 380 | {{- if .Values.datanode.podTemplate.labels }} 381 | labels: {{ .Values.datanode.podTemplate.labels | toYaml | nindent 8 }} 382 | {{- end }} 383 | {{- if .Values.datanode.podTemplate.serviceAccount.create }} 384 | serviceAccountName: {{ .Release.Name }}-datanode 385 | {{- end }} 386 | {{- if .Values.datanode.podTemplate.tolerations }} 387 | tolerations: {{ .Values.datanode.podTemplate.tolerations | toYaml | nindent 8 }} 388 | {{- end }} 389 | {{- if .Values.datanode.podTemplate.affinity }} 390 | affinity: {{ .Values.datanode.podTemplate.affinity | toYaml | nindent 8 }} 391 | {{- end }} 392 | {{- if .Values.datanode.podTemplate.nodeSelector }} 393 | nodeSelector: {{ .Values.datanode.podTemplate.nodeSelector | toYaml | nindent 8 }} 394 | {{- end }} 395 | {{- if .Values.datanode.podTemplate.volumes}} 396 | volumes: {{ .Values.datanode.podTemplate.volumes | toYaml | nindent 8 }} 397 | {{- end }} 398 | {{- if .Values.datanode.podTemplate.securityContext }} 399 | securityContext: {{ .Values.datanode.podTemplate.securityContext | toYaml | nindent 8 }} 400 | {{- end }} 401 | {{- if .Values.datanode.podTemplate.terminationGracePeriodSeconds }} 402 | terminationGracePeriodSeconds: {{ .Values.datanode.podTemplate.terminationGracePeriodSeconds }} 403 | {{- end }} 404 | {{- if .Values.datanode.logging }} 405 | logging: 406 | {{- if .Values.datanode.logging.level }} 407 | level: {{ .Values.datanode.logging.level }} 408 | {{- end }} 409 | {{- if .Values.datanode.logging.format }} 410 | format: {{ .Values.datanode.logging.format }} 411 | {{- end }} 412 | {{- if .Values.datanode.logging.logsDir }} 413 | logsDir: {{ .Values.datanode.logging.logsDir }} 414 | {{- end }} 415 | {{- if .Values.datanode.logging.onlyLogToStdout }} 416 | onlyLogToStdout: {{ .Values.datanode.logging.onlyLogToStdout }} 417 | {{- end }} 418 | {{- if .Values.datanode.logging.persistentWithData }} 419 | persistentWithData: {{ .Values.datanode.logging.persistentWithData }} 420 | {{- end }} 421 | {{- if .Values.datanode.logging.filters }} 422 | filters: {{ .Values.datanode.logging.filters | toYaml | nindent 6 }} 423 | {{- end }} 424 | {{- end }} 425 | storage: 426 | dataHome: {{ .Values.datanode.storage.dataHome }} 427 | fs: 428 | storageClassName: {{ .Values.datanode.storage.storageClassName }} 429 | storageSize: {{ .Values.datanode.storage.storageSize }} 430 | storageRetainPolicy: {{ .Values.datanode.storage.storageRetainPolicy }} 431 | mountPath: {{ .Values.datanode.storage.mountPath }} 432 | {{- if .Values.datanode.storage.labels }} 433 | labels: {{ .Values.datanode.storage.labels | toYaml | nindent 10 }} 434 | {{- end }} 435 | {{- if .Values.datanode.storage.annotations }} 436 | annotations: {{ .Values.datanode.storage.annotations | toYaml | nindent 10 }} 437 | {{- end }} 438 | {{- end }} 439 | {{- if .Values.flownode.enabled }} 440 | flownode: 441 | replicas: {{ .Values.flownode.replicas }} 442 | {{- if or .Values.flownode.configFile .Values.flownode.configData }} 443 | config: |- 444 | {{- if .Values.flownode.configFile }} 445 | {{ .Files.Get .Values.flownode.configFile | indent 6 }} 446 | {{- else }} 447 | {{ .Values.flownode.configData | indent 6 }} 448 | {{- end }} 449 | {{- end }} 450 | template: 451 | main: 452 | {{- if .Values.flownode.podTemplate.main.image }} 453 | image: {{ .Values.flownode.podTemplate.main.image }} 454 | {{- end }} 455 | {{- if .Values.flownode.podTemplate.main.command }} 456 | command: {{ .Values.flownode.podTemplate.main.command | toYaml | nindent 8 }} 457 | {{- end }} 458 | {{- if .Values.flownode.podTemplate.main.args }} 459 | args: {{ .Values.flownode.podTemplate.main.args | toYaml | nindent 8 }} 460 | {{- end }} 461 | {{- if .Values.flownode.podTemplate.main.env }} 462 | env: {{- toYaml .Values.flownode.podTemplate.main.env | nindent 8 }} 463 | {{- end }} 464 | {{- if .Values.flownode.podTemplate.main.volumeMounts }} 465 | volumeMounts: {{- toYaml .Values.flownode.podTemplate.main.volumeMounts | nindent 8 }} 466 | {{- end }} 467 | resources: 468 | requests: {{ .Values.flownode.podTemplate.main.resources.requests | toYaml | nindent 12 }} 469 | limits: {{ .Values.flownode.podTemplate.main.resources.limits | toYaml | nindent 12 }} 470 | {{- if .Values.flownode.podTemplate.main.startupProbe }} 471 | startupProbe: {{- toYaml .Values.flownode.podTemplate.main.startupProbe | nindent 10 }} 472 | {{- end }} 473 | {{- if .Values.flownode.podTemplate.main.readinessProbe }} 474 | readinessProbe: {{- toYaml .Values.flownode.podTemplate.main.readinessProbe | nindent 10 }} 475 | {{- end }} 476 | {{- if .Values.flownode.podTemplate.main.livenessProbe }} 477 | livenessProbe: {{- toYaml .Values.flownode.podTemplate.main.livenessProbe | nindent 10 }} 478 | {{- end }} 479 | {{- if .Values.flownode.podTemplate.main.securityContext }} 480 | securityContext: {{ .Values.flownode.podTemplate.main.securityContext | toYaml | nindent 10 }} 481 | {{- end }} 482 | {{- if .Values.flownode.podTemplate.annotations }} 483 | annotations: {{ .Values.flownode.podTemplate.annotations | toYaml | nindent 8 }} 484 | {{- end }} 485 | {{- if .Values.flownode.podTemplate.labels }} 486 | labels: {{ .Values.flownode.podTemplate.labels | toYaml | nindent 8 }} 487 | {{- end }} 488 | {{- if .Values.flownode.podTemplate.serviceAccount.create }} 489 | serviceAccountName: {{ .Release.Name }}-flownode 490 | {{- end }} 491 | {{- if .Values.flownode.podTemplate.tolerations }} 492 | tolerations: {{ .Values.flownode.podTemplate.tolerations | toYaml | nindent 8 }} 493 | {{- end }} 494 | {{- if .Values.flownode.podTemplate.affinity }} 495 | affinity: {{ .Values.flownode.podTemplate.affinity | toYaml | nindent 8 }} 496 | {{- end }} 497 | {{- if .Values.flownode.podTemplate.nodeSelector }} 498 | nodeSelector: {{ .Values.flownode.podTemplate.nodeSelector | toYaml | nindent 8 }} 499 | {{- end }} 500 | {{- if .Values.flownode.podTemplate.volumes }} 501 | volumes: {{ .Values.flownode.podTemplate.volumes | toYaml | nindent 8 }} 502 | {{- end }} 503 | {{- if .Values.flownode.podTemplate.securityContext }} 504 | securityContext: {{ .Values.flownode.podTemplate.securityContext | toYaml | nindent 8 }} 505 | {{- end }} 506 | {{- if .Values.flownode.podTemplate.terminationGracePeriodSeconds }} 507 | terminationGracePeriodSeconds: {{ .Values.flownode.podTemplate.terminationGracePeriodSeconds }} 508 | {{- end }} 509 | {{- if .Values.flownode.logging }} 510 | logging: 511 | {{- if .Values.flownode.logging.level }} 512 | level: {{ .Values.flownode.logging.level }} 513 | {{- end }} 514 | {{- if .Values.flownode.logging.format }} 515 | format: {{ .Values.flownode.logging.format }} 516 | {{- end }} 517 | {{- if .Values.flownode.logging.logsDir }} 518 | logsDir: {{ .Values.flownode.logging.logsDir }} 519 | {{- end }} 520 | {{- if .Values.flownode.logging.onlyLogToStdout }} 521 | onlyLogToStdout: {{ .Values.flownode.logging.onlyLogToStdout }} 522 | {{- end }} 523 | {{- if .Values.flownode.logging.persistentWithData }} 524 | persistentWithData: {{ .Values.flownode.logging.persistentWithData }} 525 | {{- end }} 526 | {{- if .Values.flownode.logging.filters }} 527 | filters: {{ .Values.flownode.logging.filters | toYaml | nindent 6 }} 528 | {{- end }} 529 | {{- end }} 530 | {{- end }} 531 | {{- if .Values.frontendGroups }} 532 | frontendGroups:{{ toYaml .Values.frontendGroups | nindent 2 }} 533 | {{- end }} 534 | {{- if (and .Values.prometheusMonitor (eq .Values.prometheusMonitor.enabled true ))}} 535 | prometheusMonitor: {{- toYaml .Values.prometheusMonitor | nindent 4 }} 536 | {{- end }} 537 | {{- if .Values.datanodeGroups }} 538 | datanodeGroups: {{ toYaml .Values.datanodeGroups | nindent 2 }} 539 | {{- end }} 540 | httpPort: {{ .Values.httpServicePort }} 541 | rpcPort: {{ .Values.grpcServicePort }} 542 | mysqlPort: {{ .Values.mysqlServicePort }} 543 | postgreSQLPort: {{ .Values.postgresServicePort }} 544 | initializer: 545 | image: '{{ .Values.initializer.registry }}/{{ .Values.initializer.repository }}:{{ .Values.initializer.tag }}' 546 | {{- $objectStorage := .Values.objectStorage }} 547 | {{- if and $objectStorage (or $objectStorage.s3 $objectStorage.oss $objectStorage.gcs $objectStorage.azblob) }} 548 | objectStorage: 549 | {{- if $objectStorage.s3 }} 550 | s3: {{- toYaml $objectStorage.s3 | nindent 6 }} 551 | {{- if $objectStorage.credentials }} 552 | {{- if $objectStorage.credentials.existingSecretName }} 553 | secretName: {{ $objectStorage.credentials.existingSecretName }} 554 | {{- else }} 555 | secretName: {{ default "storage-credentials" $objectStorage.credentials.secretName }} 556 | {{- end }} 557 | {{- end }} 558 | {{- else if $objectStorage.oss }} 559 | oss: {{- toYaml $objectStorage.oss | nindent 6 }} 560 | {{- if $objectStorage.credentials }} 561 | {{- if $objectStorage.credentials.existingSecretName }} 562 | secretName: {{ $objectStorage.credentials.existingSecretName }} 563 | {{- else }} 564 | secretName: {{ default "storage-credentials" $objectStorage.credentials.secretName }} 565 | {{- end }} 566 | {{- end }} 567 | {{- else if $objectStorage.gcs }} 568 | gcs: {{- toYaml $objectStorage.gcs | nindent 6 }} 569 | {{- if $objectStorage.credentials }} 570 | {{- if $objectStorage.credentials.existingSecretName }} 571 | secretName: {{ $objectStorage.credentials.existingSecretName }} 572 | {{- else }} 573 | secretName: {{ default "storage-credentials" $objectStorage.credentials.secretName }} 574 | {{- end }} 575 | {{- end }} 576 | {{- else if $objectStorage.azblob }} 577 | azblob: {{- toYaml $objectStorage.azblob | nindent 6 }} 578 | {{- if $objectStorage.credentials }} 579 | {{- if $objectStorage.credentials.existingSecretName }} 580 | secretName: {{ $objectStorage.credentials.existingSecretName }} 581 | {{- else }} 582 | secretName: {{ default "storage-credentials" $objectStorage.credentials.secretName }} 583 | {{- end }} 584 | {{- end }} 585 | {{- end }} 586 | {{- if $objectStorage.cache }} 587 | cache: {{- toYaml $objectStorage.cache | nindent 6 }} 588 | {{- end }} 589 | {{- end }} 590 | {{- if or .Values.remoteWal.enabled .Values.dedicatedWAL.enabled }} 591 | wal: 592 | {{- if .Values.remoteWal.enabled }} 593 | kafka: {{- toYaml .Values.remoteWal.kafka | nindent 6 }} 594 | {{- end }} 595 | {{- if .Values.dedicatedWAL.enabled }} 596 | raftEngine: {{- toYaml .Values.dedicatedWAL.raftEngine | nindent 6 }} 597 | {{- end }} 598 | {{- end }} 599 | {{- if .Values.monitoring.enabled }} 600 | monitoring: 601 | enabled: {{ .Values.monitoring.enabled }} 602 | {{- if .Values.monitoring.standalone }} 603 | standalone: {{ .Values.monitoring.standalone | toYaml | nindent 6 }} 604 | {{- end }} 605 | {{- if .Values.monitoring.logsCollection.pipeline.data }} 606 | logsCollection: 607 | pipeline: 608 | data: {{ .Values.monitoring.logsCollection.pipeline.data }} 609 | {{- end }} 610 | {{- if .Values.monitoring.vector }} 611 | vector: 612 | image: '{{ .Values.monitoring.vector.registry }}/{{ .Values.monitoring.vector.repository }}:{{ .Values.monitoring.vector.tag }}' 613 | {{- if .Values.monitoring.vector.resources }} 614 | resources: {{- toYaml .Values.monitoring.vector.resources | nindent 8 }} 615 | {{- end }} 616 | {{- end }} 617 | {{- end }} 618 | {{- $ingress := .Values.ingress }} 619 | {{- if $ingress }} 620 | ingress: 621 | {{- if $ingress.annotations }} 622 | annotations: {{- toYaml $ingress.annotations | nindent 6 }} 623 | {{- end }} 624 | {{- if $ingress.labels }} 625 | labels: {{- toYaml $ingress.labels | nindent 6 }} 626 | {{- end }} 627 | {{- if $ingress.ingressClassName }} 628 | ingressClassName: {{ $ingress.ingressClassName }} 629 | {{- end }} 630 | {{- if $ingress.rules }} 631 | rules: {{- toYaml $ingress.rules | nindent 6 }} 632 | {{- end }} 633 | {{- if $ingress.tls }} 634 | tls: {{- toYaml $ingress.tls | nindent 6 }} 635 | {{- end }} 636 | {{- end }} 637 | {{- if .Values.logging}} 638 | logging: 639 | {{- if .Values.logging.level }} 640 | level: {{ .Values.logging.level }} 641 | {{- end }} 642 | {{- if .Values.logging.format }} 643 | format: {{ .Values.logging.format }} 644 | {{- end }} 645 | {{- if .Values.logging.logsDir }} 646 | logsDir: {{ .Values.logging.logsDir }} 647 | {{- end }} 648 | {{- if .Values.logging.onlyLogToStdout }} 649 | onlyLogToStdout: {{ .Values.logging.onlyLogToStdout }} 650 | {{- end }} 651 | {{- if .Values.logging.persistentWithData }} 652 | persistentWithData: {{ .Values.logging.persistentWithData }} 653 | {{- end }} 654 | {{- if .Values.logging.filters }} 655 | filters: {{ .Values.logging.filters | toYaml | nindent 4 }} 656 | {{- end }} 657 | {{- end }} 658 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/custom-image-pull-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.customImageRegistry.enabled -}} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: {{ .Values.customImageRegistry.secretName }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 9 | type: kubernetes.io/dockerconfigjson 10 | data: 11 | .dockerconfigjson: {{ include "dockerConfigJSON" . | b64enc }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/debug-depoyment.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.debugPod }} 2 | {{- if .Values.debugPod.enabled }} 3 | apiVersion: apps/v1 4 | kind: Deployment 5 | metadata: 6 | name: {{ .Release.Name }}-debug-pod 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 10 | app: {{ .Release.Name }}-debug-pod 11 | spec: 12 | replicas: 1 13 | selector: 14 | matchLabels: 15 | app: {{ .Release.Name }}-debug-pod 16 | template: 17 | metadata: 18 | labels: 19 | app: {{ .Release.Name }}-debug-pod 20 | spec: 21 | containers: 22 | - image: {{ printf "%s/%s:%s" .Values.debugPod.image.registry .Values.debugPod.image.repository .Values.debugPod.image.tag }} 23 | name: {{ .Release.Name }}-debug-pod 24 | {{- if .Values.debugPod.resources }} 25 | resources: {{ toYaml .Values.debugPod.resources | nindent 12 }} 26 | {{- end }} 27 | {{- end }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/grafana-dashboards-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if or .Values.grafana.enabled .Values.dashboards.enabled }} 2 | {{ $root := . }} 3 | {{- range $path, $_ := .Files.Glob "dashboards/**.json" }} 4 | --- 5 | apiVersion: v1 6 | kind: ConfigMap 7 | metadata: 8 | labels: 9 | component: grafana-dashboards 10 | {{- if $.Values.dashboards.label }} 11 | {{ $.Values.dashboards.label }}: {{ ternary $.Values.dashboards.labelValue "1" (not (empty $.Values.dashboards.labelValue)) | quote }} 12 | {{- end }} 13 | {{- include "greptimedb-cluster.labels" $root | nindent 4 }} 14 | {{- with $.Values.dashboards.extraLabels }} 15 | {{- toYaml . | nindent 4 }} 16 | {{- end }} 17 | {{- with $.Values.dashboards.annotations }} 18 | annotations: 19 | {{- toYaml . | nindent 4 }} 20 | {{- end }} 21 | name: dashboard-{{ (base $path | replace ".json" "" | trunc 63 | replace "_" "-") }} 22 | namespace: {{ $.Values.dashboards.namespace | default $.Release.Namespace }} 23 | data: 24 | {{ (base $path | replace ".json" "" | trunc 63 | replace "_" "-" | lower | indent 2) }}.json: | 25 | {{ $root.Files.Get $path | indent 4 }} 26 | {{- end }} 27 | {{- end }} 28 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/meta-mysql-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.meta.backendStorage.mysql }} 2 | {{- if .Values.meta.backendStorage.mysql.credentials }} 3 | {{- if not .Values.meta.backendStorage.mysql.credentials.existingSecretName }} 4 | apiVersion: v1 5 | kind: Secret 6 | metadata: 7 | name: {{ default "meta-mysql-credentials" .Values.meta.backendStorage.mysql.credentials.secretName }} 8 | namespace: {{ .Release.Namespace }} 9 | labels: 10 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 11 | type: Opaque 12 | stringData: 13 | username: {{ .Values.meta.backendStorage.mysql.credentials.username }} 14 | password: {{ .Values.meta.backendStorage.mysql.credentials.password }} 15 | {{- end }} 16 | {{- end }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/meta-postgresql-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.meta.backendStorage.postgresql }} 2 | {{- if .Values.meta.backendStorage.postgresql.credentials }} 3 | {{- if not .Values.meta.backendStorage.postgresql.credentials.existingSecretName }} 4 | apiVersion: v1 5 | kind: Secret 6 | metadata: 7 | name: {{ default "meta-postgresql-credentials" .Values.meta.backendStorage.postgresql.credentials.secretName }} 8 | namespace: {{ .Release.Namespace }} 9 | labels: 10 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 11 | type: Opaque 12 | stringData: 13 | username: {{ .Values.meta.backendStorage.postgresql.credentials.username }} 14 | password: {{ .Values.meta.backendStorage.postgresql.credentials.password }} 15 | {{- end }} 16 | {{- end }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/object-storage-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.objectStorage }} 2 | {{- if .Values.objectStorage.credentials }} 3 | {{- if not .Values.objectStorage.credentials.existingSecretName }} 4 | apiVersion: v1 5 | metadata: 6 | name: {{ default "storage-credentials" .Values.objectStorage.credentials.secretName }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 10 | kind: Secret 11 | type: Opaque 12 | {{- if .Values.objectStorage.credentials.serviceAccountKey }} 13 | data: 14 | service-account-key: {{ .Values.objectStorage.credentials.serviceAccountKey }} 15 | {{- else }} 16 | stringData: 17 | {{- if .Values.objectStorage.credentials.accessKeyId }} 18 | access-key-id: {{ .Values.objectStorage.credentials.accessKeyId }} 19 | {{- end }} 20 | {{- if .Values.objectStorage.credentials.secretAccessKey }} 21 | secret-access-key: {{ .Values.objectStorage.credentials.secretAccessKey }} 22 | {{- end }} 23 | {{- if .Values.objectStorage.credentials.accessKeySecret }} 24 | access-key-secret: {{ .Values.objectStorage.credentials.accessKeySecret }} 25 | {{- end }} 26 | {{- if .Values.objectStorage.credentials.accountName }} 27 | account-name: {{ .Values.objectStorage.credentials.accountName }} 28 | {{- end }} 29 | {{- if .Values.objectStorage.credentials.accountKey }} 30 | account-key: {{ .Values.objectStorage.credentials.accountKey }} 31 | {{- end }} 32 | {{- end }} 33 | {{- end }} 34 | {{- end }} 35 | {{- end }} 36 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/pre-check/configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.preCheck.enabled }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ .Release.Name }}-pre-check-scripts 6 | namespace: {{ .Release.Namespace }} 7 | annotations: 8 | "helm.sh/hook": pre-install,pre-upgrade,pre-delete 9 | "helm.sh/hook-weight": "-2" 10 | data: 11 | testing.sh: | 12 | #!/bin/sh 13 | 14 | set -ue 15 | 16 | echo "================== Starting testing... ==================" 17 | 18 | {{- if and .Values.preCheck.case.disk .Values.preCheck.case.disk.enabled }} 19 | # Run Disk tests 20 | {{ .Files.Get "scripts/pre-check/disk.sh" | nindent 4 }} 21 | {{- end }} 22 | 23 | {{- if and .Values.preCheck.case.s3 .Values.preCheck.case.s3.enabled }} 24 | # Run S3 tests 25 | {{ .Files.Get "scripts/pre-check/s3.sh" | nindent 4 }} 26 | {{- end }} 27 | 28 | {{- if and .Values.preCheck.case.kafka .Values.preCheck.case.kafka.enabled }} 29 | # Run Kafka tests 30 | {{ .Files.Get "scripts/pre-check/kafka.sh" | nindent 4 }} 31 | {{- end }} 32 | 33 | echo "\n================== All tests completed! ==================" 34 | {{- end }} 35 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/pre-check/job.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.preCheck.enabled }} 2 | apiVersion: batch/v1 3 | kind: Job 4 | metadata: 5 | name: {{ .Release.Name }}-pre-check 6 | namespace: {{ .Release.Namespace }} 7 | annotations: 8 | "helm.sh/hook": pre-install,pre-upgrade,pre-delete 9 | "helm.sh/hook-weight": "-1" 10 | spec: 11 | template: 12 | spec: 13 | containers: 14 | - name: {{ .Release.Name }}-pre-check 15 | image: {{ printf "%s/%s:%s" .Values.preCheck.image.registry .Values.preCheck.image.repository .Values.preCheck.image.tag }} 16 | command: ["/bin/sh", "-c"] 17 | args: ["/scripts/testing.sh"] 18 | env: 19 | {{- range $key, $val := .Values.preCheck.env }} 20 | - name: {{ $key }} 21 | value: {{ $val | quote }} 22 | {{- end }} 23 | {{- if and .Values.preCheck.case.s3 .Values.preCheck.case.s3.enabled }} 24 | - name: S3_BUCKET 25 | value: {{ .Values.preCheck.case.s3.bucket }} 26 | - name: AWS_REGION 27 | value: {{ .Values.preCheck.case.s3.region }} 28 | - name: AWS_ACCESS_KEY_ID 29 | value: {{ .Values.preCheck.case.s3.accessKeyID }} 30 | - name: AWS_SECRET_ACCESS_KEY 31 | value: {{ .Values.preCheck.case.s3.secretAccessKey }} 32 | {{- end }} 33 | {{- if and .Values.preCheck.case.kafka .Values.preCheck.case.kafka.enabled }} 34 | - name: KAFKA_ENDPOINT 35 | value: {{ .Values.preCheck.case.kafka.endpoint }} 36 | {{- end }} 37 | volumeMounts: 38 | - name: script 39 | mountPath: /scripts 40 | {{- if .Values.preCheck.case.disk.enabled }} 41 | - name: data 42 | mountPath: /data 43 | {{- end }} 44 | restartPolicy: Never 45 | volumes: 46 | - name: script 47 | configMap: 48 | name: {{ .Release.Name }}-pre-check-scripts 49 | defaultMode: 0755 50 | {{- if .Values.preCheck.case.disk.enabled }} 51 | - name: data 52 | persistentVolumeClaim: 53 | claimName: {{ .Release.Name }}-pre-check-data 54 | {{- end }} 55 | backoffLimit: 0 56 | {{- end }} 57 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/pre-check/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.preCheck.enabled .Values.preCheck.case.disk .Values.preCheck.case.disk.enabled }} 2 | apiVersion: v1 3 | kind: PersistentVolumeClaim 4 | metadata: 5 | name: {{ .Release.Name }}-pre-check-data 6 | namespace: {{ .Release.Namespace }} 7 | annotations: 8 | "helm.sh/hook": pre-install,pre-upgrade,pre-delete 9 | "helm.sh/hook-weight": "-2" 10 | spec: 11 | storageClassName: {{ .Values.preCheck.case.disk.storageClass }} 12 | accessModes: 13 | - ReadWriteOnce 14 | resources: 15 | requests: 16 | storage: {{ .Values.preCheck.case.disk.size }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/prometheusrule.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.prometheusRule .Values.prometheusRule.enabled }} 2 | apiVersion: monitoring.coreos.com/v1 3 | kind: PrometheusRule 4 | metadata: 5 | name: {{ .Release.Name }}-prometheus-rules 6 | namespace: {{ default .Release.Namespace .Values.prometheusRule.namespace }} 7 | labels: 8 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 9 | {{- if .Values.prometheusRule.labels }} 10 | {{- toYaml .Values.prometheusRule.labels | nindent 4 }} 11 | {{- end }} 12 | {{- if .Values.prometheusRule.annotations }} 13 | annotations: {{ toYaml .Values.prometheusRule.annotations | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | {{- if .Values.prometheusRule.rules }} 17 | groups: 18 | - name: {{ .Release.Name }} 19 | rules: {{- toYaml .Values.prometheusRule.rules | nindent 6 }} 20 | {{- end }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/serviceaccount-datanode.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.datanode.podTemplate.serviceAccount.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ .Release.Name }}-datanode 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 9 | {{- with .Values.datanode.podTemplate.serviceAccount.annotations }} 10 | annotations: {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/serviceaccount-flownode.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.flownode.enabled .Values.flownode.podTemplate.serviceAccount.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ .Release.Name }}-flownode 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 9 | {{- with .Values.flownode.podTemplate.serviceAccount.annotations }} 10 | annotations: {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/serviceaccount-frontend.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.frontend.podTemplate.serviceAccount.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ .Release.Name }}-frontend 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 9 | {{- with .Values.frontend.podTemplate.serviceAccount.annotations }} 10 | annotations: {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/serviceaccount-meta.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.meta.podTemplate.serviceAccount.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ .Release.Name }}-meta 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 9 | {{- with .Values.meta.podTemplate.serviceAccount.annotations }} 10 | annotations: {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /charts/greptimedb-cluster/templates/users-auth-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.auth.enabled -}} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: {{ .Release.Name }}-users-auth 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-cluster.labels" . | nindent 4 }} 9 | type: Opaque 10 | stringData: 11 | {{ .Values.auth.fileName }}: | 12 | {{- range .Values.auth.users }} 13 | {{ printf "%s=%s" .username .password }} 14 | {{- end }} 15 | {{- end }} 16 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/.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/greptimedb-operator/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | kubeVersion: ">=1.18.0-0" 3 | description: The greptimedb-operator Helm chart for Kubernetes. 4 | name: greptimedb-operator 5 | appVersion: 0.4.1 6 | version: 0.4.0 7 | type: application 8 | home: https://github.com/GreptimeTeam/greptimedb-operator 9 | sources: 10 | - https://github.com/GreptimeTeam/greptimedb-operator 11 | keywords: 12 | - operator 13 | - database 14 | - greptimedb 15 | maintainers: 16 | - name: daviderli614 17 | email: liyang@greptime.com 18 | url: https://github.com/daviderli614 19 | - name: zyy17 20 | email: zyy@greptime.com 21 | url: https://github.com/zyy17 22 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/README.md: -------------------------------------------------------------------------------- 1 | # greptimedb-operator 2 | 3 | The greptimedb-operator Helm chart for Kubernetes. 4 | 5 | ![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.4.1](https://img.shields.io/badge/AppVersion-0.4.1-informational?style=flat-square) 6 | 7 | ## Source Code 8 | 9 | - https://github.com/GreptimeTeam/greptimedb-operator 10 | 11 | ## How to Install 12 | 13 | ### Add Chart Repository 14 | 15 | ```console 16 | helm repo add greptime https://greptimeteam.github.io/helm-charts/ 17 | helm repo update 18 | ``` 19 | 20 | ### Install the GreptimeDB Operator 21 | 22 | Install greptimedb-operator in the `greptimedb-admin` namespace: 23 | 24 | ```console 25 | helm upgrade \ 26 | --install \ 27 | --create-namespace \ 28 | greptimedb-operator greptime/greptimedb-operator \ 29 | -n greptimedb-admin 30 | ``` 31 | 32 | If you want to specify the chart version, you can use `--version`: 33 | 34 | ```console 35 | helm upgrade \ 36 | --install \ 37 | --create-namespace \ 38 | greptimedb-operator greptime/greptimedb-operator \ 39 | -n greptimedb-admin \ 40 | --version 41 | ``` 42 | 43 | ## How to Uninstall 44 | 45 | ```console 46 | helm uninstall greptimedb-operator -n greptimedb-admin 47 | ``` 48 | 49 | ## CRDs Management 50 | 51 | ### Installation and Upgrade of the CRDs 52 | 53 | Helm cannot upgrade custom resource definitions in the `/crds` folder [by design](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations). 54 | 55 | For deployment convenience, we have decided to manage the CRDs using the Helm chart since **v0.2.1**. By default, the chart will automatically install or upgrade the CRDs. You can disable the behavior by using `--set crds.install=false` when installing the chart. When you uninstall the release, **it will not delete the CRDs by default** unless you use `--set crds.keep=false`. 56 | 57 | If you installed the CRD using a chart version before v0.2.1 and want to let the chart manage CRDs, you can add some necessary metadata for the original CRDs: 58 | 59 | ```console 60 | # Add the following labels to the CRDs. 61 | kubectl patch crds greptimedbclusters.greptime.io -p '{"metadata":{"labels":{"app.kubernetes.io/managed-by":"Helm"}}}' 62 | kubectl patch crds greptimedbstandalones.greptime.io -p '{"metadata":{"labels":{"app.kubernetes.io/managed-by":"Helm"}}}' 63 | 64 | # Add the following annotations to the CRDs. The values of the annotations are the name and namespace of the release. 65 | kubectl patch crds greptimedbclusters.greptime.io -p '{"metadata":{"annotations":{"meta.helm.sh/release-name":, "meta.helm.sh/release-namespace":>}}}' 66 | kubectl patch crds greptimedbstandalones.greptime.io -p '{"metadata":{"annotations":{"meta.helm.sh/release-name":, "meta.helm.sh/release-namespace":>}}}' 67 | ``` 68 | 69 | If you want to upgrade CRDs manually, you can use the following steps (**ensure the version of the operator and CRDs are aligned**): 70 | 71 | - If your `helm-charts` repository is already up-to-date, you can upgrade the CRDs by the following command: 72 | 73 | ```console 74 | make upgrade-crds 75 | ``` 76 | 77 | - If you want to upgrade the CRDs to the latest released version: 78 | 79 | ```console 80 | make upgrade-crds CRDS_VERSION=latest 81 | ``` 82 | 83 | ### How to Update the CRDs in the Chart 84 | 85 | If you want to update the CRDs in the chart, you can use the following steps: 86 | 87 | 1. Update the `appVersion` in the `Chart.yaml` file. 88 | 89 | 2. Execute the following command: 90 | 91 | ```console 92 | make update-crds 93 | ``` 94 | 95 | ## Requirements 96 | 97 | Kubernetes: `>=1.18.0-0` 98 | 99 | ## Values 100 | 101 | | Key | Type | Default | Description | 102 | |-----|------|---------|-------------| 103 | | VolumeMounts | list | `[]` | Volume mounts to add to the pod | 104 | | Volumes | list | `[]` | Volumes to add to the pod | 105 | | additionalLabels | object | `{}` | additional labels to add to all resources | 106 | | admissionWebhook | object | `{"annotations":{},"caBundle":"","certDir":"/etc/webhook-tls","certManager":{"admissionCert":{"duration":""},"enabled":false,"rootCert":{"duration":""}},"enabled":false,"failurePolicy":"Fail","port":8082}` | The configuration for the admission webhook | 107 | | admissionWebhook.annotations | object | `{}` | Additional annotations to the admission webhooks | 108 | | admissionWebhook.caBundle | string | `""` | A PEM encoded CA bundle which will be used to validate the webhook's server certificate. If certManager.enabled is true, you can get it like this: kubectl get secret webhook-server-tls -n ${namespace} -o jsonpath='{.data.ca\.crt}' | 109 | | admissionWebhook.certDir | string | `"/etc/webhook-tls"` | The directory that contains the certificate | 110 | | admissionWebhook.certManager | object | `{"admissionCert":{"duration":""},"enabled":false,"rootCert":{"duration":""}}` | Use certmanager to generate webhook certs | 111 | | admissionWebhook.certManager.admissionCert | object | `{"duration":""}` | self-signed webhook certificate | 112 | | admissionWebhook.certManager.rootCert | object | `{"duration":""}` | self-signed root certificate | 113 | | admissionWebhook.enabled | bool | `false` | Whether to enable the admission webhook | 114 | | admissionWebhook.failurePolicy | string | `"Fail"` | Valid values: Fail, Ignore, IgnoreOnInstallOnly | 115 | | admissionWebhook.port | int | `8082` | The port for the admission webhook | 116 | | affinity | object | `{}` | The pod affinity | 117 | | apiServer | object | `{"enabled":false,"podMetrics":{"enabled":false},"port":8081}` | The configuration for the operator API server | 118 | | apiServer.enabled | bool | `false` | Whether to enable the API server | 119 | | apiServer.podMetrics | object | `{"enabled":false}` | The configuration for getting PodMetrics from metrics-server. | 120 | | apiServer.podMetrics.enabled | bool | `false` | Whether to enable to get PodMetrics from metrics-server. | 121 | | apiServer.port | int | `8081` | The port for the API server | 122 | | crds.additionalLabels | object | `{}` | Addtional labels to be added to all CRDs | 123 | | crds.annotations | object | `{}` | Annotations to be added to all CRDs | 124 | | crds.install | bool | `true` | Install and upgrade CRDs | 125 | | crds.keep | bool | `true` | Keep CRDs on chart uninstall | 126 | | fullnameOverride | string | `""` | Provide a name to substitute for the full names of resources | 127 | | image.imagePullPolicy | string | `"IfNotPresent"` | The image pull policy for the controller | 128 | | image.pullSecrets | list | `[]` | The image pull secrets | 129 | | image.registry | string | `"docker.io"` | The image registry | 130 | | image.repository | string | `"greptime/greptimedb-operator"` | The image repository | 131 | | image.tag | string | `"v0.4.1"` | The image tag | 132 | | nameOverride | string | `""` | String to partially override release template name | 133 | | nodeSelector | object | `{}` | The operator node selector | 134 | | rbac.create | bool | `true` | Install role based access control | 135 | | replicas | int | `1` | Number of replicas for the greptimedb operator | 136 | | resources | object | `{"limits":{"cpu":"200m","memory":"256Mi"},"requests":{"cpu":"100m","memory":"128Mi"}}` | Default resources for greptimedb operator | 137 | | serviceAccount.annotations | object | `{}` | Annotations to add to the service account | 138 | | serviceAccount.create | bool | `true` | Specifies whether a service account should be created | 139 | | serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | 140 | | tolerations | list | `[]` | The pod tolerations | 141 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/README.md.gotmpl: -------------------------------------------------------------------------------- 1 | {{ template "chart.header" . }} 2 | {{ template "chart.description" . }} 3 | 4 | {{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} 5 | 6 | ## Source Code 7 | 8 | - https://github.com/GreptimeTeam/greptimedb-operator 9 | 10 | ## How to Install 11 | 12 | ### Add Chart Repository 13 | 14 | ```console 15 | helm repo add greptime https://greptimeteam.github.io/helm-charts/ 16 | helm repo update 17 | ``` 18 | 19 | ### Install the GreptimeDB Operator 20 | 21 | Install greptimedb-operator in the `greptimedb-admin` namespace: 22 | 23 | ```console 24 | helm upgrade \ 25 | --install \ 26 | --create-namespace \ 27 | greptimedb-operator greptime/greptimedb-operator \ 28 | -n greptimedb-admin 29 | ``` 30 | 31 | If you want to specify the chart version, you can use `--version`: 32 | 33 | ```console 34 | helm upgrade \ 35 | --install \ 36 | --create-namespace \ 37 | greptimedb-operator greptime/greptimedb-operator \ 38 | -n greptimedb-admin \ 39 | --version 40 | ``` 41 | 42 | ## How to Uninstall 43 | 44 | ```console 45 | helm uninstall greptimedb-operator -n greptimedb-admin 46 | ``` 47 | 48 | ## CRDs Management 49 | 50 | ### Installation and Upgrade of the CRDs 51 | 52 | Helm cannot upgrade custom resource definitions in the `/crds` folder [by design](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations). 53 | 54 | For deployment convenience, we have decided to manage the CRDs using the Helm chart since **v0.2.1**. By default, the chart will automatically install or upgrade the CRDs. You can disable the behavior by using `--set crds.install=false` when installing the chart. When you uninstall the release, **it will not delete the CRDs by default** unless you use `--set crds.keep=false`. 55 | 56 | If you installed the CRD using a chart version before v0.2.1 and want to let the chart manage CRDs, you can add some necessary metadata for the original CRDs: 57 | 58 | ```console 59 | # Add the following labels to the CRDs. 60 | kubectl patch crds greptimedbclusters.greptime.io -p '{"metadata":{"labels":{"app.kubernetes.io/managed-by":"Helm"}}}' 61 | kubectl patch crds greptimedbstandalones.greptime.io -p '{"metadata":{"labels":{"app.kubernetes.io/managed-by":"Helm"}}}' 62 | 63 | # Add the following annotations to the CRDs. The values of the annotations are the name and namespace of the release. 64 | kubectl patch crds greptimedbclusters.greptime.io -p '{"metadata":{"annotations":{"meta.helm.sh/release-name":, "meta.helm.sh/release-namespace":>}}}' 65 | kubectl patch crds greptimedbstandalones.greptime.io -p '{"metadata":{"annotations":{"meta.helm.sh/release-name":, "meta.helm.sh/release-namespace":>}}}' 66 | ``` 67 | 68 | If you want to upgrade CRDs manually, you can use the following steps (**ensure the version of the operator and CRDs are aligned**): 69 | 70 | - If your `helm-charts` repository is already up-to-date, you can upgrade the CRDs by the following command: 71 | 72 | ```console 73 | make upgrade-crds 74 | ``` 75 | 76 | - If you want to upgrade the CRDs to the latest released version: 77 | 78 | ```console 79 | make upgrade-crds CRDS_VERSION=latest 80 | ``` 81 | 82 | ### How to Update the CRDs in the Chart 83 | 84 | If you want to update the CRDs in the chart, you can use the following steps: 85 | 86 | 1. Update the `appVersion` in the `Chart.yaml` file. 87 | 88 | 2. Execute the following command: 89 | 90 | ```console 91 | make update-crds 92 | ``` 93 | 94 | {{ template "chart.requirementsSection" . }} 95 | 96 | {{ template "chart.valuesSection" . }} 97 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | *********************************************************************** 2 | Welcome to use greptimedb-operator 3 | Chart version: {{ .Chart.Version }} 4 | GreptimeDB Operator version: {{ .Chart.AppVersion }} 5 | *********************************************************************** 6 | 7 | Installed components: 8 | * greptimedb-operator 9 | 10 | The greptimedb-operator is starting, use `kubectl get deployment {{ include "greptimedb-operator.fullname" . }} -n {{ .Release.Namespace }}` to check its status. -------------------------------------------------------------------------------- /charts/greptimedb-operator/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "greptimedb-operator.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 7 | {{- end }} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "greptimedb-operator.fullname" -}} 15 | {{- if .Values.fullnameOverride }} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 17 | {{- else }} 18 | {{- $name := default .Chart.Name .Values.nameOverride }} 19 | {{- if contains $name .Release.Name }} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 21 | {{- else }} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 23 | {{- end }} 24 | {{- end }} 25 | {{- end }} 26 | 27 | {{/* 28 | Create the name of the service account to use 29 | */}} 30 | {{- define "greptimedb-operator.serviceAccountName" -}} 31 | {{- if .Values.serviceAccount.create }} 32 | {{- default (include "greptimedb-operator.fullname" .) .Values.serviceAccount.name }} 33 | {{- else }} 34 | {{- default "default" .Values.serviceAccount.name }} 35 | {{- end }} 36 | {{- end }} 37 | 38 | {{/* 39 | Create chart name and version as used by the chart label. 40 | */}} 41 | {{- define "greptimedb-operator.chart" -}} 42 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 43 | {{- end }} 44 | 45 | {{/* 46 | Common labels 47 | */}} 48 | {{- define "greptimedb-operator.labels" -}} 49 | helm.sh/chart: {{ include "greptimedb-operator.chart" . }} 50 | {{ include "greptimedb-operator.selectorLabels" . }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/component: operator 55 | app.kubernetes.io/managed-by: {{ .Release.Service }} 56 | app.kubernetes.io/part-of: greptimedb-operator 57 | {{- with .Values.additionalLabels }} 58 | {{ toYaml . }} 59 | {{- end }} 60 | {{- end }} 61 | 62 | {{/* 63 | Selector labels 64 | */}} 65 | {{- define "greptimedb-operator.selectorLabels" -}} 66 | app.kubernetes.io/name: {{ include "greptimedb-operator.name" . }} 67 | app.kubernetes.io/instance: {{ .Release.Name }} 68 | {{- end }} 69 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/templates/cert-manager.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.admissionWebhook.certManager.enabled }} 2 | # Create a selfsigned Issuer, in order to create a root CA certificate for 3 | # signing webhook serving certificates 4 | apiVersion: cert-manager.io/v1 5 | kind: Issuer 6 | metadata: 7 | labels: 8 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 9 | name: {{ include "greptimedb-operator.fullname" . }}-selfsigned-issuer 10 | namespace: {{ .Release.Namespace }} 11 | spec: 12 | selfSigned: {} 13 | --- 14 | # Generate a CA Certificate used to sign certificates for the webhook 15 | apiVersion: cert-manager.io/v1 16 | kind: Certificate 17 | metadata: 18 | name: {{ include "greptimedb-operator.fullname" . }}-root-cert 19 | namespace: {{ .Release.Namespace }} 20 | labels: 21 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 22 | spec: 23 | secretName: {{ include "greptimedb-operator.fullname" . }}-root-cert 24 | duration: {{ .Values.admissionWebhook.certManager.rootCert.duration | default "43800h0m0s" | quote }} 25 | issuerRef: 26 | name: {{ include "greptimedb-operator.fullname" . }}-selfsigned-issuer 27 | commonName: "ca.webhook.greptimedb-operator" 28 | isCA: true 29 | --- 30 | # Create an Issuer that uses the above generated CA certificate to issue certs 31 | apiVersion: cert-manager.io/v1 32 | kind: Issuer 33 | metadata: 34 | name: {{ include "greptimedb-operator.fullname" . }}-root-issuer 35 | namespace: {{ .Release.Namespace }} 36 | labels: 37 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 38 | spec: 39 | ca: 40 | secretName: {{ include "greptimedb-operator.fullname" . }}-root-cert 41 | --- 42 | # generate a server certificate for the apiservices to use 43 | apiVersion: cert-manager.io/v1 44 | kind: Certificate 45 | metadata: 46 | labels: 47 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 48 | name: {{ include "greptimedb-operator.fullname" . }}-webhook-cert 49 | namespace: {{ .Release.Namespace }} 50 | spec: 51 | dnsNames: 52 | - {{ include "greptimedb-operator.fullname" . }} 53 | - {{ include "greptimedb-operator.fullname" . }}.{{ .Release.Namespace }} 54 | - {{ include "greptimedb-operator.fullname" . }}.{{ .Release.Namespace }}.svc 55 | issuerRef: 56 | kind: Issuer 57 | name: {{ include "greptimedb-operator.fullname" . }}-root-issuer 58 | secretName: webhook-server-tls 59 | duration: {{ .Values.admissionWebhook.certManager.admissionCert.duration | default "8760h0m0s" | quote }} 60 | {{- end }} 61 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/templates/clusterrole.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create }} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: {{ include "greptimedb-operator.fullname" . }}-role 6 | labels: 7 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 8 | rules: 9 | - apiGroups: 10 | - apiextensions.k8s.io 11 | resources: 12 | - customresourcedefinitions 13 | verbs: 14 | - get 15 | - list 16 | - watch 17 | - apiGroups: 18 | - apps 19 | resources: 20 | - deployments 21 | verbs: 22 | - create 23 | - delete 24 | - get 25 | - list 26 | - patch 27 | - update 28 | - watch 29 | - apiGroups: 30 | - apps 31 | resources: 32 | - statefulsets 33 | verbs: 34 | - create 35 | - delete 36 | - get 37 | - list 38 | - patch 39 | - update 40 | - watch 41 | - apiGroups: 42 | - "" 43 | resources: 44 | - configmaps 45 | verbs: 46 | - create 47 | - delete 48 | - get 49 | - list 50 | - patch 51 | - update 52 | - watch 53 | - apiGroups: 54 | - "" 55 | resources: 56 | - events 57 | verbs: 58 | - create 59 | - get 60 | - list 61 | - patch 62 | - watch 63 | - apiGroups: 64 | - "" 65 | resources: 66 | - persistentvolumeclaims 67 | verbs: 68 | - create 69 | - delete 70 | - get 71 | - list 72 | - update 73 | - watch 74 | - apiGroups: 75 | - "" 76 | resources: 77 | - pods 78 | verbs: 79 | - create 80 | - get 81 | - list 82 | - patch 83 | - watch 84 | - apiGroups: 85 | - "" 86 | resources: 87 | - secrets 88 | verbs: 89 | - get 90 | - list 91 | - patch 92 | - watch 93 | - apiGroups: 94 | - "" 95 | resources: 96 | - services 97 | verbs: 98 | - create 99 | - delete 100 | - get 101 | - list 102 | - update 103 | - watch 104 | - patch 105 | - apiGroups: 106 | - greptime.io 107 | resources: 108 | - greptimedbclusters 109 | verbs: 110 | - create 111 | - delete 112 | - get 113 | - list 114 | - patch 115 | - update 116 | - watch 117 | - apiGroups: 118 | - greptime.io 119 | resources: 120 | - greptimedbclusters/finalizers 121 | verbs: 122 | - update 123 | - apiGroups: 124 | - greptime.io 125 | resources: 126 | - greptimedbclusters/status 127 | verbs: 128 | - get 129 | - patch 130 | - update 131 | - apiGroups: 132 | - greptime.io 133 | resources: 134 | - greptimedbstandalones 135 | verbs: 136 | - create 137 | - delete 138 | - get 139 | - list 140 | - patch 141 | - update 142 | - watch 143 | - apiGroups: 144 | - greptime.io 145 | resources: 146 | - greptimedbstandalones/finalizers 147 | verbs: 148 | - update 149 | - apiGroups: 150 | - greptime.io 151 | resources: 152 | - greptimedbstandalones/status 153 | verbs: 154 | - get 155 | - patch 156 | - update 157 | - apiGroups: 158 | - monitoring.coreos.com 159 | resources: 160 | - podmonitors 161 | verbs: 162 | - create 163 | - delete 164 | - get 165 | - list 166 | - patch 167 | - update 168 | - watch 169 | - apiGroups: 170 | - networking.k8s.io 171 | resources: 172 | - ingresses 173 | verbs: 174 | - create 175 | - delete 176 | - get 177 | - list 178 | - patch 179 | - update 180 | - watch 181 | {{- if and .Values.apiServer.enabled .Values.apiServer.podMetrics.enabled }} 182 | - apiGroups: 183 | - metrics.k8s.io 184 | resources: 185 | - pods 186 | verbs: 187 | - get 188 | - list 189 | {{- end }} 190 | {{- end }} 191 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/templates/clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create }} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRoleBinding 4 | metadata: 5 | name: {{ include "greptimedb-operator.fullname" . }}-rolebinding 6 | labels: 7 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 8 | roleRef: 9 | apiGroup: rbac.authorization.k8s.io 10 | kind: ClusterRole 11 | name: {{ include "greptimedb-operator.fullname" . }}-role 12 | subjects: 13 | - kind: ServiceAccount 14 | name: {{ include "greptimedb-operator.serviceAccountName" . }} 15 | namespace: {{ .Release.Namespace }} 16 | {{- end }} 17 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ include "greptimedb-operator.fullname" . }} 5 | namespace: {{ .Release.Namespace }} 6 | labels: 7 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 8 | spec: 9 | replicas: {{ .Values.replicas }} 10 | selector: 11 | matchLabels: 12 | {{- include "greptimedb-operator.selectorLabels" . | nindent 6 }} 13 | template: 14 | metadata: 15 | annotations: 16 | kubectl.kubernetes.io/default-container: manager 17 | labels: 18 | {{- include "greptimedb-operator.selectorLabels" . | nindent 8 }} 19 | spec: 20 | {{- if .Values.image.pullSecrets }} 21 | imagePullSecrets: 22 | {{- range .Values.image.pullSecrets }} 23 | - name: {{ . }} 24 | {{- end }} 25 | {{- end }} 26 | serviceAccountName: {{ include "greptimedb-operator.serviceAccountName" . }} 27 | terminationGracePeriodSeconds: 10 28 | {{- with .Values.nodeSelector }} 29 | nodeSelector: 30 | {{- toYaml . | nindent 8 }} 31 | {{- end }} 32 | {{- with .Values.affinity }} 33 | affinity: 34 | {{- toYaml . | nindent 8 }} 35 | {{- end }} 36 | {{- with .Values.tolerations }} 37 | tolerations: 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | {{- if .Values.Volumes }} 41 | volumes: {{ toYaml .Values.Volumes | nindent 8 }} 42 | {{- end }} 43 | containers: 44 | - name: manager 45 | image: '{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}' 46 | imagePullPolicy: {{ .Values.image.imagePullPolicy | default "IfNotPresent" }} 47 | livenessProbe: 48 | httpGet: 49 | path: /healthz 50 | port: 9494 51 | initialDelaySeconds: 15 52 | periodSeconds: 20 53 | readinessProbe: 54 | httpGet: 55 | path: /readyz 56 | port: 9494 57 | initialDelaySeconds: 5 58 | periodSeconds: 10 59 | {{- if .Values.VolumeMounts }} 60 | volumeMounts: {{ toYaml .Values.VolumeMounts | nindent 10 }} 61 | {{- end }} 62 | args: 63 | - --enable-leader-election 64 | {{- if .Values.apiServer.enabled }} 65 | - --enable-apiserver 66 | - --apiserver-port={{ .Values.apiServer.port }} 67 | {{- if .Values.apiServer.podMetrics.enabled }} 68 | - --enable-pod-metrics 69 | {{- end }} 70 | {{- end }} 71 | {{- if .Values.admissionWebhook.enabled }} 72 | - --enable-admission-webhook 73 | - --admission-webhook-port={{ .Values.admissionWebhook.port }} 74 | - --admission-webhook-cert-dir={{ .Values.admissionWebhook.certDir }} 75 | {{- end }} 76 | command: 77 | - greptimedb-operator 78 | {{- if .Values.resources }} 79 | resources: {{ toYaml .Values.resources | nindent 10 }} 80 | {{- end }} 81 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/templates/role.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create }} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: Role 4 | metadata: 5 | name: {{ include "greptimedb-operator.fullname" . }}-leader-election-role 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 9 | rules: 10 | - apiGroups: 11 | - '' 12 | resources: 13 | - 'configmaps' 14 | verbs: 15 | - get 16 | - list 17 | - watch 18 | - create 19 | - update 20 | - patch 21 | - delete 22 | - apiGroups: 23 | - coordination.k8s.io 24 | resources: 25 | - leases 26 | verbs: 27 | - get 28 | - list 29 | - watch 30 | - create 31 | - update 32 | - patch 33 | - delete 34 | - apiGroups: 35 | - "" 36 | resources: 37 | - events 38 | verbs: 39 | - create 40 | - patch 41 | {{- end }} 42 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/templates/rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create }} 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: RoleBinding 4 | metadata: 5 | name: {{ include "greptimedb-operator.fullname" . }}-leader-election-rolebinding 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 9 | roleRef: 10 | apiGroup: rbac.authorization.k8s.io 11 | kind: Role 12 | name: {{ include "greptimedb-operator.fullname" . }}-leader-election-role 13 | subjects: 14 | - kind: ServiceAccount 15 | name: {{ include "greptimedb-operator.serviceAccountName" . }} 16 | namespace: {{ .Release.Namespace }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if or .Values.apiServer.enabled .Values.admissionWebhook.enabled }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: {{ include "greptimedb-operator.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 9 | spec: 10 | type: ClusterIP 11 | selector: 12 | app.kubernetes.io/name: {{ include "greptimedb-operator.name" . }} 13 | ports: 14 | {{- if .Values.apiServer.enabled }} 15 | - name: http 16 | port: {{ .Values.apiServer.port }} 17 | protocol: TCP 18 | targetPort: {{ .Values.apiServer.port }} 19 | {{- end }} 20 | {{- if .Values.admissionWebhook.enabled }} 21 | - name: webhook 22 | port: 443 23 | protocol: TCP 24 | targetPort: {{ .Values.admissionWebhook.port }} 25 | {{- end }} 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "greptimedb-operator.serviceAccountName" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 9 | {{- end }} 10 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/templates/validating-webhook.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.admissionWebhook.enabled -}} 2 | apiVersion: admissionregistration.k8s.io/v1 3 | kind: ValidatingWebhookConfiguration 4 | metadata: 5 | name: {{ include "greptimedb-operator.fullname" . }}-admission 6 | labels: 7 | {{- include "greptimedb-operator.labels" . | nindent 4 }} 8 | {{- if .Values.admissionWebhook.annotations }} 9 | annotations: {{- toYaml .Values.admissionWebhook.annotations | nindent 4 }} 10 | {{- end }} 11 | webhooks: 12 | - admissionReviewVersions: 13 | - v1 14 | clientConfig: 15 | caBundle: {{ .Values.admissionWebhook.caBundle }} 16 | service: 17 | name: {{ include "greptimedb-operator.fullname" . }} 18 | namespace: {{ .Release.Namespace }} 19 | path: /validate-greptime-io-v1alpha1-greptimedbcluster 20 | failurePolicy: {{ .Values.admissionWebhook.failurePolicy }} 21 | name: vgreptimedbcluster.kb.io 22 | rules: 23 | - apiGroups: 24 | - greptime.io 25 | apiVersions: 26 | - v1alpha1 27 | operations: 28 | - CREATE 29 | - UPDATE 30 | resources: 31 | - greptimedbclusters 32 | sideEffects: None 33 | - admissionReviewVersions: 34 | - v1 35 | clientConfig: 36 | caBundle: {{ .Values.admissionWebhook.caBundle }} 37 | service: 38 | name: {{ include "greptimedb-operator.fullname" . }} 39 | namespace: {{ .Release.Namespace }} 40 | path: /validate-greptime-io-v1alpha1-greptimedbstandalone 41 | failurePolicy: {{ .Values.admissionWebhook.failurePolicy }} 42 | name: vgreptimedbstandalone.kb.io 43 | rules: 44 | - apiGroups: 45 | - greptime.io 46 | apiVersions: 47 | - v1alpha1 48 | operations: 49 | - CREATE 50 | - UPDATE 51 | resources: 52 | - greptimedbstandalones 53 | sideEffects: None 54 | {{- end }} 55 | -------------------------------------------------------------------------------- /charts/greptimedb-operator/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for greptimedb operator 2 | 3 | image: 4 | # -- The image registry 5 | registry: docker.io 6 | # -- The image repository 7 | repository: greptime/greptimedb-operator 8 | # -- The image pull policy for the controller 9 | imagePullPolicy: IfNotPresent 10 | # -- The image tag 11 | tag: v0.4.1 12 | # -- The image pull secrets 13 | pullSecrets: [] 14 | 15 | # -- additional labels to add to all resources 16 | additionalLabels: {} 17 | 18 | serviceAccount: 19 | # -- Specifies whether a service account should be created 20 | create: true 21 | # -- Annotations to add to the service account 22 | annotations: {} 23 | # -- The name of the service account to use. 24 | # If not set and create is true, a name is generated using the fullname template 25 | name: "" 26 | 27 | ## Custom resource configuration 28 | crds: 29 | # -- Install and upgrade CRDs 30 | install: true 31 | # -- Keep CRDs on chart uninstall 32 | keep: true 33 | # -- Annotations to be added to all CRDs 34 | annotations: {} 35 | # -- Addtional labels to be added to all CRDs 36 | additionalLabels: {} 37 | 38 | # -- Number of replicas for the greptimedb operator 39 | replicas: 1 40 | 41 | # -- Default resources for greptimedb operator 42 | resources: 43 | limits: 44 | cpu: 200m 45 | memory: 256Mi 46 | requests: 47 | cpu: 100m 48 | memory: 128Mi 49 | 50 | rbac: 51 | # -- Install role based access control 52 | create: true 53 | 54 | # -- String to partially override release template name 55 | nameOverride: "" 56 | 57 | # -- Provide a name to substitute for the full names of resources 58 | fullnameOverride: "" 59 | 60 | # -- The operator node selector 61 | nodeSelector: {} 62 | 63 | # -- The pod tolerations 64 | tolerations: [] 65 | 66 | # -- The pod affinity 67 | affinity: {} 68 | 69 | # -- Volume mounts to add to the pod 70 | VolumeMounts: [] 71 | # - name: webhook-tls 72 | # mountPath: /etc/webhook-tls 73 | # readOnly: true 74 | 75 | # -- Volumes to add to the pod 76 | Volumes: [] 77 | # - name: webhook-tls 78 | # secret: 79 | # secretName: webhook-server-tls 80 | 81 | # -- The configuration for the admission webhook 82 | admissionWebhook: 83 | # -- Whether to enable the admission webhook 84 | enabled: false 85 | 86 | # -- The port for the admission webhook 87 | port: 8082 88 | 89 | # -- The directory that contains the certificate 90 | certDir: "/etc/webhook-tls" 91 | 92 | # -- Additional annotations to the admission webhooks 93 | annotations: {} 94 | 95 | # -- Valid values: Fail, Ignore, IgnoreOnInstallOnly 96 | failurePolicy: Fail 97 | 98 | # -- A PEM encoded CA bundle which will be used to validate the webhook's server certificate. 99 | # If certManager.enabled is true, you can get it like this: kubectl get secret webhook-server-tls -n ${namespace} -o jsonpath='{.data.ca\.crt}' 100 | caBundle: "" 101 | 102 | # -- Use certmanager to generate webhook certs 103 | certManager: 104 | enabled: false 105 | 106 | # -- self-signed root certificate 107 | rootCert: 108 | # default to be 5 year 109 | duration: "" # 43800h0m0s 110 | 111 | # -- self-signed webhook certificate 112 | admissionCert: 113 | # default to be 1 year 114 | duration: "" # 8760h0m0s 115 | 116 | # -- The configuration for the operator API server 117 | apiServer: 118 | # -- Whether to enable the API server 119 | enabled: false 120 | 121 | # -- The port for the API server 122 | port: 8081 123 | 124 | # -- The configuration for getting PodMetrics from metrics-server. 125 | podMetrics: 126 | # -- Whether to enable to get PodMetrics from metrics-server. 127 | enabled: false 128 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/.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/greptimedb-standalone/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: greptimedb-standalone 3 | description: A Helm chart for deploying standalone greptimedb 4 | type: application 5 | version: 0.2.4 6 | appVersion: 0.15.1 7 | home: https://github.com/GreptimeTeam/greptimedb 8 | sources: 9 | - https://github.com/GreptimeTeam/greptimedb 10 | keywords: 11 | - database 12 | - greptimedb 13 | maintainers: 14 | - name: liyang 15 | email: liyang@greptime.com 16 | url: https://github.com/daviderli614 17 | - name: zyy17 18 | email: zyy@greptime.com 19 | url: https://github.com/zyy17 20 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/README.md: -------------------------------------------------------------------------------- 1 | # greptimedb-standalone 2 | 3 | A Helm chart for deploying standalone greptimedb 4 | 5 | ![Version: 0.2.4](https://img.shields.io/badge/Version-0.2.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.15.1](https://img.shields.io/badge/AppVersion-0.15.1-informational?style=flat-square) 6 | 7 | ## Source Code 8 | - https://github.com/GreptimeTeam/greptimedb 9 | 10 | ## How to install 11 | 12 | ```console 13 | # Add charts repo. 14 | helm repo add greptime https://greptimeteam.github.io/helm-charts/ 15 | helm repo update 16 | 17 | # Install greptimedb standalone in default namespace. 18 | helm upgrade --install greptimedb-standalone greptime/greptimedb-standalone -n default 19 | ``` 20 | 21 | **Use AWS S3 as backend storage** 22 | ```console 23 | helm upgrade --install greptimedb-standalone greptime/greptimedb-standalone \ 24 | --set objectStorage.credentials.accessKeyId="your-access-key-id" \ 25 | --set objectStorage.credentials.secretAccessKey="your-secret-access-key" \ 26 | --set objectStorage.s3.bucket="your-bucket-name" \ 27 | --set objectStorage.s3.region="region-of-bucket" \ 28 | --set objectStorage.s3.endpoint="s3-endpoint" \ 29 | --set objectStorage.s3.root="root-directory-of-data" \ 30 | -n default 31 | ``` 32 | 33 | ## Connection 34 | 35 | ```console 36 | # You can use the MySQL client to connect the greptimedb, for example: 'mysql -h 127.0.0.1 -P 4002'. 37 | kubectl port-forward -n default svc/greptimedb-standalone 4002:4002 38 | 39 | # You can use the PostgreSQL client to connect the greptimedb, for example: 'psql -h 127.0.0.1 -p 4003 -d public'. 40 | kubectl port-forward -n default svc/greptimedb-standalone 4003:4003 41 | ``` 42 | 43 | ## How to uninstall 44 | 45 | ```console 46 | helm uninstall greptimedb-standalone -n default 47 | ``` 48 | 49 | ## Values 50 | 51 | | Key | Type | Default | Description | 52 | |-----|------|---------|-------------| 53 | | additionalLabels | object | `{}` | additional labels to add to all resources | 54 | | affinity | object | `{}` | Affinity configuration for pod | 55 | | annotations | object | `{}` | The annotations | 56 | | args | list | `[]` | The container args | 57 | | auth | object | `{"enabled":false,"fileName":"passwd","mountPath":"/etc/greptimedb/auth","users":[{"password":"admin","username":"admin"}]}` | The static auth for greptimedb, only support one user now(https://docs.greptime.com/user-guide/deployments-administration/authentication/static). | 58 | | auth.enabled | bool | `false` | Enable static auth | 59 | | auth.fileName | string | `"passwd"` | The auth file name, the full path is `${mountPath}/${fileName}` | 60 | | auth.mountPath | string | `"/etc/greptimedb/auth"` | The auth file path to store the auth info | 61 | | auth.users | list | `[{"password":"admin","username":"admin"}]` | The users to be created in the auth file | 62 | | command | list | `[]` | The container command | 63 | | configToml | string | `"mode = 'standalone'\n"` | The extra configuration for greptimedb | 64 | | dataHome | string | `"/data/greptimedb/"` | Storage root directory | 65 | | env | object | `{}` | Environment variables | 66 | | extraVolumeMounts | list | `[]` | Volume mounts to add to the pods | 67 | | extraVolumes | list | `[]` | Volumes to add to the pods | 68 | | fullnameOverride | string | `""` | Provide a name to substitute for the full names of resources | 69 | | grpcServicePort | int | `4001` | GreptimeDB grpc service port | 70 | | httpServicePort | int | `4000` | GreptimeDB http service port | 71 | | image.pullPolicy | string | `"IfNotPresent"` | The image pull policy for the controller | 72 | | image.pullSecrets | list | `[]` | The image pull secrets. | 73 | | image.registry | string | `"docker.io"` | The image registry | 74 | | image.repository | string | `"greptime/greptimedb"` | The image repository | 75 | | image.tag | string | `"v0.15.1"` | The image tag | 76 | | logging | object | `{"format":"text","level":"info","logsDir":"/data/greptimedb/logs","onlyLogToStdout":false}` | Logging configuration for greptimedb | 77 | | logging.format | string | `"text"` | The log format for greptimedb, only support "json" and "text" | 78 | | logging.level | string | `"info"` | The log level for greptimedb, only support "debug", "info", "warn" | 79 | | logging.logsDir | string | `"/data/greptimedb/logs"` | The logs directory for greptimedb. It will be ignored if `onlyLogToStdout` is `true`. | 80 | | logging.onlyLogToStdout | bool | `false` | Whether to log to stdout only. If `true`, it will ignore the `logsDir` options. | 81 | | monitoring.annotations | object | `{}` | PodMonitor annotations | 82 | | monitoring.enabled | bool | `false` | Enable prometheus podmonitor | 83 | | monitoring.interval | string | `"30s"` | PodMonitor scrape interval | 84 | | monitoring.labels | object | `{}` | PodMonitor labels | 85 | | mysqlServicePort | int | `4002` | GreptimeDB mysql service port | 86 | | nameOverride | string | `""` | Overrides the chart's name | 87 | | nodeSelector | object | `{}` | NodeSelector to apply pod | 88 | | objectStorage | object | `{"azblob":{},"gcs":{},"oss":{},"s3":{}}` | Configure to object storage | 89 | | persistence.enableStatefulSetAutoDeletePVC | bool | `false` | Enable StatefulSetAutoDeletePVC feature | 90 | | persistence.enabled | bool | `true` | Enable persistent disk | 91 | | persistence.mountPath | string | `"/data/greptimedb"` | Mount path of persistent disk. | 92 | | persistence.selector | string | `nil` | Selector for persistent disk | 93 | | persistence.size | string | `"20Gi"` | Size of persistent disk | 94 | | persistence.storageClass | string | `nil` | Storage class name | 95 | | persistentVolumeClaimRetentionPolicy | object | `{"whenDeleted":"Retain","whenScaled":"Retain"}` | PersistentVolumeClaimRetentionPolicyType is a string enumeration of the policies that will determine, when volumes from the VolumeClaimTemplates will be deleted when the controlling StatefulSet is deleted or scaled down. | 96 | | podAnnotations | object | `{}` | Extra pod annotations to add | 97 | | podLabels | object | `{}` | Extra pod labels to add | 98 | | podSecurityContext | object | `{}` | Security context to apply to the pod | 99 | | postgresServicePort | int | `4003` | GreptimeDB postgres service port | 100 | | resources | object | `{}` | Resource requests and limits for the container | 101 | | securityContext | object | `{}` | Security context to apply to the container | 102 | | service.annotations | object | `{}` | Annotations for service | 103 | | service.type | string | `"ClusterIP"` | Service type | 104 | | serviceAccount.annotations | object | `{}` | Annotations to add to the service account | 105 | | serviceAccount.create | bool | `true` | Specifies whether a service account should be created | 106 | | serviceAccount.name | string | `""` | Service account name | 107 | | terminationGracePeriodSeconds | int | `30` | Grace period to allow the single binary to shut down before it is killed | 108 | | tolerations | object | `{}` | Tolerations to apply pod | 109 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/README.md.gotmpl: -------------------------------------------------------------------------------- 1 | {{ template "chart.header" . }} 2 | {{ template "chart.description" . }} 3 | 4 | {{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} 5 | 6 | ## Source Code 7 | - https://github.com/GreptimeTeam/greptimedb 8 | 9 | ## How to install 10 | 11 | ```console 12 | # Add charts repo. 13 | helm repo add greptime https://greptimeteam.github.io/helm-charts/ 14 | helm repo update 15 | 16 | # Install greptimedb standalone in default namespace. 17 | helm upgrade --install greptimedb-standalone greptime/greptimedb-standalone -n default 18 | ``` 19 | 20 | **Use AWS S3 as backend storage** 21 | ```console 22 | helm upgrade --install greptimedb-standalone greptime/greptimedb-standalone \ 23 | --set objectStorage.credentials.accessKeyId="your-access-key-id" \ 24 | --set objectStorage.credentials.secretAccessKey="your-secret-access-key" \ 25 | --set objectStorage.s3.bucket="your-bucket-name" \ 26 | --set objectStorage.s3.region="region-of-bucket" \ 27 | --set objectStorage.s3.endpoint="s3-endpoint" \ 28 | --set objectStorage.s3.root="root-directory-of-data" \ 29 | -n default 30 | ``` 31 | 32 | ## Connection 33 | 34 | ```console 35 | # You can use the MySQL client to connect the greptimedb, for example: 'mysql -h 127.0.0.1 -P 4002'. 36 | kubectl port-forward -n default svc/greptimedb-standalone 4002:4002 37 | 38 | # You can use the PostgreSQL client to connect the greptimedb, for example: 'psql -h 127.0.0.1 -p 4003 -d public'. 39 | kubectl port-forward -n default svc/greptimedb-standalone 4003:4003 40 | ``` 41 | 42 | ## How to uninstall 43 | 44 | ```console 45 | helm uninstall greptimedb-standalone -n default 46 | ``` 47 | 48 | {{ template "chart.requirementsSection" . }} 49 | 50 | {{ template "chart.valuesSection" . }} 51 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | *********************************************************************** 2 | Welcome to use greptimedb-standalone 3 | Chart version: {{ .Chart.Version }} 4 | GreptimeDB Standalone version: {{ .Chart.AppVersion }} 5 | *********************************************************************** 6 | 7 | Installed components: 8 | * greptimedb-standalone 9 | 10 | The greptimedb-standalone is starting, use `kubectl get statefulset {{ include "greptimedb-standalone.fullname" . }} -n {{ .Release.Namespace }}` to check its status. -------------------------------------------------------------------------------- /charts/greptimedb-standalone/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Expand the name of the chart. 3 | */}} 4 | {{- define "greptimedb-standalone.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 "greptimedb-standalone.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 "greptimedb-standalone.chart" -}} 30 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 31 | {{- end }} 32 | 33 | {{/* 34 | Common labels 35 | */}} 36 | {{- define "greptimedb-standalone.labels" -}} 37 | helm.sh/chart: {{ include "greptimedb-standalone.chart" . }} 38 | {{ include "greptimedb-standalone.selectorLabels" . }} 39 | {{- if .Chart.AppVersion }} 40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 41 | {{- end }} 42 | app.kubernetes.io/component: standalone 43 | app.kubernetes.io/managed-by: {{ .Release.Service }} 44 | app.kubernetes.io/part-of: greptimedb-standalone 45 | {{- with .Values.additionalLabels }} 46 | {{ toYaml . }} 47 | {{- end }} 48 | {{- end }} 49 | 50 | {{/* 51 | Selector labels 52 | */}} 53 | {{- define "greptimedb-standalone.selectorLabels" -}} 54 | app.kubernetes.io/name: {{ include "greptimedb-standalone.name" . }} 55 | app.kubernetes.io/instance: {{ .Release.Name }} 56 | {{- end }} 57 | 58 | {{/* 59 | Create the name of the service account to use 60 | */}} 61 | {{- define "greptimedb-standalone.serviceAccountName" -}} 62 | {{- if .Values.serviceAccount.create }} 63 | {{- default (include "greptimedb-standalone.fullname" .) .Values.serviceAccount.name }} 64 | {{- else }} 65 | {{- default "default" .Values.serviceAccount.name }} 66 | {{- end }} 67 | {{- end }} 68 | 69 | {{- define "greptimedb-standalone.objectStorageConfig" -}} 70 | {{- if or .Values.objectStorage.s3 .Values.objectStorage.oss .Values.objectStorage.gcs .Values.objectStorage.azblob }} 71 | {{- $provider := "" }} 72 | {{- $bucket := "" }} 73 | {{- $root := "" }} 74 | {{- $container := "" }} 75 | {{- $cache_capacity := "" }} 76 | 77 | {{- if .Values.objectStorage.s3 }} 78 | {{- $provider = "S3" }} 79 | {{- $bucket = .Values.objectStorage.s3.bucket }} 80 | {{- $root = .Values.objectStorage.s3.root }} 81 | {{- $cache_capacity = .Values.objectStorage.s3.cache_capacity }} 82 | {{- else if .Values.objectStorage.oss }} 83 | {{- $provider = "Oss" }} 84 | {{- $bucket = .Values.objectStorage.oss.bucket }} 85 | {{- $root = .Values.objectStorage.oss.root }} 86 | {{- $cache_capacity = .Values.objectStorage.oss.cache_capacity }} 87 | {{- else if .Values.objectStorage.gcs }} 88 | {{- $provider = "Gcs" }} 89 | {{- $bucket = .Values.objectStorage.gcs.bucket }} 90 | {{- $root = .Values.objectStorage.gcs.root }} 91 | {{- $cache_capacity = .Values.objectStorage.gcs.cache_capacity }} 92 | {{- else if .Values.objectStorage.azblob }} 93 | {{- $provider = "Azblob" }} 94 | {{- $container = .Values.objectStorage.azblob.container }} 95 | {{- $root = .Values.objectStorage.azblob.root }} 96 | {{- $cache_capacity = .Values.objectStorage.azblob.cache_capacity }} 97 | {{- end }} 98 | 99 | {{- if $provider }} 100 | [storage] 101 | # Storage provider type: S3, Oss, Azblob, or Gcs 102 | type = "{{ $provider }}" 103 | 104 | {{- if $bucket }} 105 | # Bucket name in the storage provider 106 | bucket = "{{ $bucket }}" 107 | {{- end }} 108 | 109 | {{- if $container }} 110 | # The container name for the Azure blob 111 | container = "{{ $container }}" 112 | {{- end }} 113 | 114 | # Root path within the bucket 115 | root = "{{ $root }}" 116 | 117 | {{- if $cache_capacity }} 118 | # The cache capacity 119 | cache_capacity = "{{ $cache_capacity }}" 120 | {{- end }} 121 | 122 | {{- if .Values.objectStorage.s3 }} 123 | endpoint = "{{ .Values.objectStorage.s3.endpoint }}" 124 | region = "{{ .Values.objectStorage.s3.region }}" 125 | {{- else if .Values.objectStorage.oss }} 126 | endpoint = "{{ .Values.objectStorage.oss.endpoint }}" 127 | region = "{{ .Values.objectStorage.oss.region }}" 128 | {{- else if .Values.objectStorage.gcs }} 129 | endpoint = "{{ .Values.objectStorage.gcs.endpoint }}" 130 | scope = "{{ .Values.objectStorage.gcs.scope }}" 131 | {{- else if .Values.objectStorage.azblob }} 132 | endpoint = "{{ .Values.objectStorage.azblob.endpoint }}" 133 | {{- end }} 134 | {{- end }} 135 | {{- end }} 136 | {{- end }} 137 | 138 | {{- define "greptimedb-standalone.loggingConfig" -}} 139 | {{- if .Values.logging }} 140 | [logging] 141 | {{- if .Values.logging.level }} 142 | level = "{{ .Values.logging.level }}" 143 | {{- end }} 144 | {{- if .Values.logging.format }} 145 | log_format = "{{ .Values.logging.format }}" 146 | {{- end }} 147 | {{- if not .Values.logging.onlyLogToStdout }} 148 | {{- if .Values.logging.logsDir }} 149 | dir = "{{ .Values.logging.logsDir }}" 150 | {{- end }} 151 | {{- end }} 152 | {{- end }} 153 | {{- end }} 154 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.configToml -}} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ include "greptimedb-standalone.fullname" . }}-config 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-standalone.labels" . | nindent 4 }} 9 | data: 10 | config.toml: | 11 | {{ .Values.configToml | indent 4 }} 12 | {{ include "greptimedb-standalone.objectStorageConfig" . | indent 4 }} 13 | {{ include "greptimedb-standalone.loggingConfig" . | indent 4 }} 14 | {{- end -}} 15 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/templates/podmonitor.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.monitoring.enabled }} 2 | apiVersion: monitoring.coreos.com/v1 3 | kind: PodMonitor 4 | metadata: 5 | name: {{ include "greptimedb-standalone.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-standalone.labels" . | nindent 4 }} 9 | {{- with .Values.monitoring.labels }} 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- with .Values.monitoring.annotations }} 13 | annotations: 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | spec: 17 | podMetricsEndpoints: 18 | - interval: {{ .Values.monitoring.interval }} 19 | port: http 20 | path: /metrics 21 | namespaceSelector: 22 | matchNames: 23 | - {{ .Release.Namespace }} 24 | selector: 25 | matchLabels: 26 | {{- include "greptimedb-standalone.selectorLabels" . | nindent 6 }} 27 | {{- end }} 28 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.objectStorage }} 2 | {{- if .Values.objectStorage.credentials }} 3 | {{- if not .Values.objectStorage.credentials.existingSecretName }} 4 | apiVersion: v1 5 | metadata: 6 | name: {{ include "greptimedb-standalone.fullname" . }}-secret 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{- include "greptimedb-standalone.labels" . | nindent 4 }} 10 | kind: Secret 11 | type: Opaque 12 | {{- if .Values.objectStorage.credentials.serviceAccountKey }} 13 | data: 14 | GREPTIMEDB_STANDALONE__STORAGE__CREDENTIAL: {{ .Values.objectStorage.credentials.serviceAccountKey | b64enc }} 15 | {{- else }} 16 | stringData: 17 | {{- if .Values.objectStorage.credentials.accessKeyId}} 18 | GREPTIMEDB_STANDALONE__STORAGE__ACCESS_KEY_ID: {{ .Values.objectStorage.credentials.accessKeyId }} 19 | {{- end }} 20 | {{- if .Values.objectStorage.credentials.secretAccessKey}} 21 | GREPTIMEDB_STANDALONE__STORAGE__SECRET_ACCESS_KEY: {{ .Values.objectStorage.credentials.secretAccessKey }} 22 | {{- end }} 23 | {{- if .Values.objectStorage.credentials.accessKeySecret}} 24 | GREPTIMEDB_STANDALONE__STORAGE__ACCESS_KEY_SECRET: {{ .Values.objectStorage.credentials.accessKeySecret }} 25 | {{- end }} 26 | {{- if .Values.objectStorage.credentials.accountName}} 27 | GREPTIMEDB_STANDALONE__STORAGE__ACCOUNT_NAME: {{ .Values.objectStorage.credentials.accountName }} 28 | {{- end }} 29 | {{- if .Values.objectStorage.credentials.accountKey}} 30 | GREPTIMEDB_STANDALONE__STORAGE__ACCOUNT_KEY: {{ .Values.objectStorage.credentials.accountKey }} 31 | {{- end }} 32 | {{- end }} 33 | {{- end }} 34 | {{- end }} 35 | {{- end }} 36 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "greptimedb-standalone.fullname" . }} 5 | labels: 6 | {{- include "greptimedb-standalone.labels" . | nindent 4 }} 7 | {{- with .Values.service.annotations }} 8 | annotations: 9 | {{- toYaml . | nindent 4 }} 10 | {{- end }} 11 | spec: 12 | type: {{ .Values.service.type }} 13 | ports: 14 | - name: http 15 | port: {{ .Values.httpServicePort }} 16 | targetPort: http 17 | protocol: TCP 18 | - name: grpc 19 | port: {{ .Values.grpcServicePort }} 20 | targetPort: grpc 21 | protocol: TCP 22 | - name: mysql 23 | port: {{ .Values.mysqlServicePort }} 24 | targetPort: mysql 25 | protocol: TCP 26 | - name: postgres 27 | port: {{ .Values.postgresServicePort }} 28 | targetPort: postgres 29 | protocol: TCP 30 | selector: 31 | {{- include "greptimedb-standalone.selectorLabels" . | nindent 4 }} 32 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "greptimedb-standalone.serviceAccountName" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-standalone.labels" . | nindent 4 }} 9 | {{- with .Values.serviceAccount.annotations }} 10 | annotations: 11 | {{- toYaml . | nindent 4 }} 12 | {{- end }} 13 | {{- end }} 14 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/templates/statefulset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: {{ include "greptimedb-standalone.fullname" . }} 5 | namespace: {{ $.Release.Namespace }} 6 | labels: 7 | {{- include "greptimedb-standalone.labels" . | nindent 4 }} 8 | {{- if not (empty .Values.annotations) }} 9 | annotations: 10 | {{- with .Values.annotations }} 11 | {{- toYaml . | nindent 4 }} 12 | {{- end }} 13 | {{- end }} 14 | spec: 15 | replicas: 1 16 | updateStrategy: 17 | rollingUpdate: 18 | partition: 0 19 | serviceName: {{ include "greptimedb-standalone.fullname" . }} 20 | {{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.persistence.enableStatefulSetAutoDeletePVC) (.Values.persistence.enabled) }} 21 | persistentVolumeClaimRetentionPolicy: 22 | whenDeleted: {{ .Values.persistentVolumeClaimRetentionPolicy.whenDeleted }} 23 | whenScaled: {{ .Values.persistentVolumeClaimRetentionPolicy.whenScaled }} 24 | {{- end }} 25 | selector: 26 | matchLabels: 27 | {{- include "greptimedb-standalone.selectorLabels" . | nindent 6 }} 28 | template: 29 | metadata: 30 | annotations: 31 | app.greptime.io/config-hash: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} 32 | app.greptime.io/secret-hash: {{ 33 | (printf "%s%s" 34 | (include (print $.Template.BasePath "/secret.yaml") .) 35 | (include (print $.Template.BasePath "/users-auth-secret.yaml") .) 36 | ) | sha256sum 37 | }} 38 | {{- with .Values.podAnnotations }} 39 | {{- toYaml . | nindent 8 }} 40 | {{- end }} 41 | labels: 42 | {{- include "greptimedb-standalone.selectorLabels" . | nindent 8 }} 43 | {{- with .Values.podLabels }} 44 | {{- toYaml . | nindent 8 }} 45 | {{- end }} 46 | spec: 47 | serviceAccountName: {{ include "greptimedb-standalone.serviceAccountName" . }} 48 | {{- if .Values.image.pullSecrets }} 49 | imagePullSecrets: 50 | {{- range .Values.image.pullSecrets }} 51 | - name: {{ . }} 52 | {{- end }} 53 | {{- end }} 54 | {{- if .Values.podSecurityContext }} 55 | securityContext: 56 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 57 | {{- end }} 58 | terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} 59 | containers: 60 | - name: {{ include "greptimedb-standalone.fullname" . }} 61 | image: {{ printf "%s/%s:%s" .Values.image.registry .Values.image.repository .Values.image.tag }} 62 | imagePullPolicy: {{ .Values.image.pullPolicy }} 63 | command: 64 | {{- if .Values.command }} 65 | {{- toYaml .Values.command | nindent 12 }} 66 | {{- else }} 67 | - "greptime" 68 | - "standalone" 69 | - "start" 70 | {{- end }} 71 | args: 72 | - "--http-addr" 73 | - "0.0.0.0:{{ .Values.httpServicePort }}" 74 | - "--rpc-bind-addr" 75 | - "0.0.0.0:{{ .Values.grpcServicePort }}" 76 | - "--mysql-addr" 77 | - "0.0.0.0:{{ .Values.mysqlServicePort }}" 78 | - "--postgres-addr" 79 | - "0.0.0.0:{{ .Values.postgresServicePort }}" 80 | {{- if .Values.configToml }} 81 | - "--config-file" 82 | - "/etc/greptimedb/config/config.toml" 83 | {{- end }} 84 | {{- if .Values.dataHome }} 85 | - "--data-home" 86 | - {{ .Values.dataHome }} 87 | {{- end }} 88 | {{- if .Values.args }} 89 | {{- toYaml .Values.args | nindent 12 }} 90 | {{- end }} 91 | ports: 92 | - containerPort: {{ .Values.httpServicePort }} 93 | name: http 94 | protocol: TCP 95 | - containerPort: {{ .Values.grpcServicePort }} 96 | name: grpc 97 | protocol: TCP 98 | - containerPort: {{ .Values.mysqlServicePort }} 99 | name: mysql 100 | protocol: TCP 101 | - containerPort: {{ .Values.postgresServicePort }} 102 | name: postgres 103 | protocol: TCP 104 | {{- if or .Values.env .Values.auth.enabled }} 105 | env: 106 | {{- range $key, $val := .Values.env }} 107 | - name: {{ $key }} 108 | value: {{ $val | quote }} 109 | {{- end }} 110 | {{- if .Values.auth.enabled }} 111 | - name: GREPTIMEDB_STANDALONE__USER_PROVIDER 112 | value: "static_user_provider:file:{{ .Values.auth.mountPath }}/{{ .Values.auth.fileName }}" 113 | {{- end }} 114 | {{- end }} 115 | {{- if .Values.objectStorage }} 116 | {{- if .Values.objectStorage.credentials }} 117 | envFrom: 118 | - secretRef: 119 | {{- if .Values.objectStorage.credentials.existingSecretName }} 120 | name: {{ .Values.objectStorage.credentials.existingSecretName }} 121 | {{- else }} 122 | name: {{ include "greptimedb-standalone.fullname" . }}-secret 123 | {{- end }} 124 | {{- end }} 125 | {{- end }} 126 | {{- with .Values.securityContext }} 127 | securityContext: 128 | {{- toYaml . | nindent 12 }} 129 | {{- end }} 130 | volumeMounts: 131 | - name: data 132 | mountPath: {{ .Values.persistence.mountPath }} 133 | {{- if .Values.configToml }} 134 | - name: config 135 | mountPath: /etc/greptimedb/config 136 | readOnly: true 137 | {{- end }} 138 | {{- if .Values.auth.enabled }} 139 | - name: auth 140 | mountPath: {{ .Values.auth.mountPath }} 141 | readOnly: true 142 | {{- end }} 143 | {{- with .Values.extraVolumeMounts }} 144 | {{- toYaml . | nindent 12 }} 145 | {{- end }} 146 | {{- with .Values.resources }} 147 | resources: 148 | {{- toYaml . | nindent 12 }} 149 | {{- end }} 150 | volumes: 151 | {{- if .Values.configToml }} 152 | - name: config 153 | configMap: 154 | name: {{ include "greptimedb-standalone.fullname" . }}-config 155 | {{- end }} 156 | {{- if .Values.auth.enabled }} 157 | - name: auth 158 | secret: 159 | secretName: {{ include "greptimedb-standalone.fullname" . }}-users-auth 160 | {{- end }} 161 | {{- with .Values.extraVolumes }} 162 | {{- toYaml . | nindent 8 }} 163 | {{- end }} 164 | {{- with .Values.affinity }} 165 | affinity: 166 | {{- toYaml . | nindent 8 }} 167 | {{- end }} 168 | {{- with .Values.nodeSelector }} 169 | nodeSelector: 170 | {{- toYaml . | nindent 8 }} 171 | {{- end }} 172 | {{- with .Values.tolerations }} 173 | tolerations: 174 | {{- toYaml . | nindent 8 }} 175 | {{- end }} 176 | {{- if .Values.persistence.enabled }} 177 | volumeClaimTemplates: 178 | - apiVersion: v1 179 | kind: PersistentVolumeClaim 180 | metadata: 181 | name: data 182 | spec: 183 | accessModes: 184 | - ReadWriteOnce 185 | {{- with .Values.persistence.storageClass }} 186 | storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }} 187 | {{- end }} 188 | resources: 189 | requests: 190 | storage: {{ .Values.persistence.size | quote }} 191 | {{- with .Values.persistence.selector }} 192 | selector: 193 | {{- toYaml . | nindent 10 }} 194 | {{- end }} 195 | {{- end }} 196 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/templates/users-auth-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.auth.enabled -}} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: {{ include "greptimedb-standalone.fullname" . }}-users-auth 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "greptimedb-standalone.labels" . | nindent 4 }} 9 | type: Opaque 10 | stringData: 11 | {{ .Values.auth.fileName }}: | 12 | {{- range .Values.auth.users }} 13 | {{ printf "%s=%s" .username .password }} 14 | {{- end }} 15 | {{- end }} 16 | -------------------------------------------------------------------------------- /charts/greptimedb-standalone/values.yaml: -------------------------------------------------------------------------------- 1 | image: 2 | # -- The image registry 3 | registry: docker.io 4 | # -- The image repository 5 | repository: greptime/greptimedb 6 | # -- The image tag 7 | tag: "v0.15.1" 8 | # -- The image pull policy for the controller 9 | pullPolicy: IfNotPresent 10 | # -- The image pull secrets. 11 | pullSecrets: [] 12 | 13 | # -- Overrides the chart's name 14 | nameOverride: "" 15 | 16 | # -- Provide a name to substitute for the full names of resources 17 | fullnameOverride: "" 18 | 19 | # -- additional labels to add to all resources 20 | additionalLabels: {} 21 | 22 | serviceAccount: 23 | # -- Specifies whether a service account should be created 24 | create: true 25 | # -- Annotations to add to the service account 26 | annotations: {} 27 | # The name of the service account to use. 28 | # If not set and create is true, a name is generated using the fullname template 29 | # -- Service account name 30 | name: "" 31 | 32 | # -- The container command 33 | command: [] 34 | 35 | # -- The container args 36 | args: [] 37 | 38 | # -- The extra configuration for greptimedb 39 | configToml: | 40 | mode = 'standalone' 41 | 42 | # -- Storage root directory 43 | dataHome: "/data/greptimedb/" 44 | 45 | # -- Configure to object storage 46 | objectStorage: 47 | # credentials: 48 | # # AWS or AliCloud cloudProvider accessKeyID 49 | # accessKeyId: "you-should-set-the-access-key-id-here" 50 | 51 | # # AWS cloudProvider secretAccessKey 52 | # secretAccessKey: "you-should-set-the-secret-access-key-here" 53 | 54 | # # AliCloud cloudProvider secretAccessKey 55 | # accessKeySecret: "you-should-set-the-access-key-secret-here" 56 | 57 | # # Azure cloudProvider accountName and accountKey 58 | # accountName: "you-should-set-the-account-name-here" 59 | # accountKey: "you-should-set-the-account-key-here" 60 | 61 | # # GCP cloudProvider serviceAccountKey JSON-formatted base64 value 62 | # serviceAccountKey: "you-should-set-the-base64-service-account-key-here" 63 | 64 | # # Set the existing secret to get the key's of cloudProvider 65 | # existingSecretName: "" 66 | 67 | # configure to use s3 storage 68 | s3: {} 69 | # bucket: "bucket-name" 70 | # region: "us-west-2" 71 | 72 | # # The data directory in S3 will be: 's3:////data/...'. 73 | # root: "greptimedb-standalone" 74 | # endpoint: "" # See more detail: https://docs.aws.amazon.com/general/latest/gr/s3.html 75 | 76 | # The cache capacity 77 | # cache_capacity = "" 78 | 79 | # configure to use oss storage 80 | oss: {} 81 | # bucket: "bucket-name" 82 | # region: "cn-hangzhou" 83 | 84 | # # The data directory in OSS will be: 'oss:////data/...'. 85 | # root: "greptimedb-standalone" 86 | # endpoint: "oss-cn-hangzhou.aliyuncs.com" 87 | 88 | # The cache capacity 89 | # cache_capacity = "" 90 | 91 | # configure to use gcs storage 92 | gcs: {} 93 | # bucket: "bucket-name" 94 | # scope: "" # example: "https://www.googleapis.com/auth/devstorage.read_write" 95 | 96 | # # The data directory in gcs will be: 'gcs:////data/...'. 97 | # root: "greptimedb-standalone" 98 | # endpoint: "https://storage.googleapis.com" 99 | 100 | # The cache capacity 101 | # cache_capacity = "" 102 | 103 | # configure to use azblob storage 104 | azblob: {} 105 | # container: "" 106 | # endpoint: "" 107 | # root: "greptimedb-standalone" 108 | 109 | # The cache capacity 110 | # cache_capacity = "" 111 | 112 | # -- Environment variables 113 | env: {} 114 | # envKey: "envValue" 115 | 116 | # -- Extra pod annotations to add 117 | podAnnotations: {} 118 | 119 | # -- Extra pod labels to add 120 | podLabels: {} 121 | 122 | # -- Security context to apply to the pod 123 | podSecurityContext: {} 124 | # runAsUser: 1000 125 | # runAsGroup: 3000 126 | # fsGroup: 2000 127 | 128 | # -- The annotations 129 | annotations: {} 130 | # imageregistry: "https://hub.docker.com/" 131 | 132 | # -- Security context to apply to the container 133 | securityContext: {} 134 | # runAsUser: 1000 135 | # runAsGroup: 3000 136 | # fsGroup: 2000 137 | 138 | # -- Resource requests and limits for the container 139 | resources: {} 140 | # limits: 141 | # cpu: 800m 142 | # memory: 1Gi 143 | # requests: 144 | # cpu: 200m 145 | # memory: 512Mi 146 | 147 | # -- NodeSelector to apply pod 148 | nodeSelector: {} 149 | # disktype: ssd 150 | 151 | # -- Volume mounts to add to the pods 152 | extraVolumeMounts: [] 153 | # -- Volumes to add to the pods 154 | extraVolumes: [] 155 | 156 | # -- Tolerations to apply pod 157 | tolerations: {} 158 | # - key: "key1" 159 | # operator: "Equal" 160 | # value: "value1" 161 | # effect: "NoSchedule" 162 | 163 | # -- Affinity configuration for pod 164 | affinity: {} 165 | # nodeAffinity: 166 | # requiredDuringSchedulingIgnoredDuringExecution: 167 | # nodeSelectorTerms: 168 | # - matchExpressions: 169 | # - key: topology.kubernetes.io/zone 170 | # operator: In 171 | # values: 172 | # - antarctica-east1 173 | # - antarctica-west1 174 | # preferredDuringSchedulingIgnoredDuringExecution: 175 | # - weight: 1 176 | # preference: 177 | # matchExpressions: 178 | # - key: another-node-label-key 179 | # operator: In 180 | # values: 181 | # - another-node-label-value 182 | 183 | # -- Grace period to allow the single binary to shut down before it is killed 184 | terminationGracePeriodSeconds: 30 185 | 186 | # -- PersistentVolumeClaimRetentionPolicyType is a string enumeration of the policies that will determine, when volumes from the VolumeClaimTemplates will be deleted when the controlling StatefulSet is deleted or scaled down. 187 | persistentVolumeClaimRetentionPolicy: 188 | whenDeleted: Retain 189 | whenScaled: Retain 190 | 191 | persistence: 192 | # -- Enable persistent disk 193 | enabled: true 194 | # -- Enable StatefulSetAutoDeletePVC feature 195 | enableStatefulSetAutoDeletePVC: false 196 | # -- Size of persistent disk 197 | size: 20Gi 198 | # -- Storage class name 199 | storageClass: null 200 | # -- Selector for persistent disk 201 | selector: null 202 | # -- Mount path of persistent disk. 203 | mountPath: /data/greptimedb 204 | 205 | monitoring: 206 | # -- Enable prometheus podmonitor 207 | enabled: false 208 | # -- PodMonitor annotations 209 | annotations: {} 210 | # -- PodMonitor labels 211 | labels: {} 212 | # -- PodMonitor scrape interval 213 | interval: 30s 214 | 215 | # -- GreptimeDB http service port 216 | httpServicePort: 4000 217 | # -- GreptimeDB grpc service port 218 | grpcServicePort: 4001 219 | # -- GreptimeDB mysql service port 220 | mysqlServicePort: 4002 221 | # -- GreptimeDB postgres service port 222 | postgresServicePort: 4003 223 | 224 | service: 225 | # -- Service type 226 | type: ClusterIP 227 | # -- Annotations for service 228 | annotations: {} 229 | 230 | # -- The static auth for greptimedb, only support one user now(https://docs.greptime.com/user-guide/deployments-administration/authentication/static). 231 | auth: 232 | # -- Enable static auth 233 | enabled: false 234 | # -- The auth file path to store the auth info 235 | mountPath: "/etc/greptimedb/auth" 236 | # -- The auth file name, the full path is `${mountPath}/${fileName}` 237 | fileName: "passwd" 238 | # -- The users to be created in the auth file 239 | users: 240 | - username: "admin" 241 | password: "admin" 242 | 243 | # -- Logging configuration for greptimedb 244 | logging: 245 | # -- The log level for greptimedb, only support "debug", "info", "warn" 246 | level: "info" 247 | # -- The log format for greptimedb, only support "json" and "text" 248 | format: "text" 249 | # -- The logs directory for greptimedb. It will be ignored if `onlyLogToStdout` is `true`. 250 | logsDir: "/data/greptimedb/logs" 251 | # -- Whether to log to stdout only. If `true`, it will ignore the `logsDir` options. 252 | onlyLogToStdout: false 253 | -------------------------------------------------------------------------------- /docker/debug-pod/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | # Supporting Command Install 4 | RUN apt-get update && apt-get install -y \ 5 | wget \ 6 | tar \ 7 | sudo \ 8 | curl \ 9 | unzip \ 10 | net-tools \ 11 | iproute2 \ 12 | telnet \ 13 | make \ 14 | gcc \ 15 | vim \ 16 | mysql-client \ 17 | postgresql-client \ 18 | jq \ 19 | python3 \ 20 | python3-pip \ 21 | curl \ 22 | netcat-openbsd \ 23 | fio \ 24 | iperf3 \ 25 | openjdk-11-jdk 26 | 27 | # ETCD CLI Install 28 | RUN ARCH=$(dpkg --print-architecture) && \ 29 | wget "https://github.com/etcd-io/etcd/releases/download/v3.5.0/etcd-v3.5.0-linux-${ARCH}.tar.gz" && \ 30 | tar zxvf "etcd-v3.5.0-linux-${ARCH}.tar.gz" && \ 31 | sudo mv etcd-v3.5.0-linux-${ARCH}/etcdctl /usr/local/bin/ && \ 32 | rm -rf etcd-v3.5.0-linux-${ARCH}* 33 | 34 | # Kafka Install 35 | RUN KAFKA_VERSION=3.5.0 && \ 36 | wget "https://archive.apache.org/dist/kafka/3.5.0/kafka_2.13-${KAFKA_VERSION}.tgz" && \ 37 | tar -xzf "kafka_2.13-${KAFKA_VERSION}.tgz" && \ 38 | sudo mv "kafka_2.13-${KAFKA_VERSION}" kafka && \ 39 | rm -rf "kafka_2.13-${KAFKA_VERSION}.tgz" "kafka_2.13-${KAFKA_VERSION}" 40 | 41 | # Helm CLI Install 42 | RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 \ 43 | && chmod 700 get_helm.sh \ 44 | && ./get_helm.sh \ 45 | && rm get_helm.sh 46 | 47 | # AWS CLI Install 48 | RUN ARCH=$(dpkg --print-architecture) && \ 49 | if [ "$ARCH" = "amd64" ]; then \ 50 | curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"; \ 51 | else \ 52 | curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"; \ 53 | fi && \ 54 | unzip awscliv2.zip && \ 55 | ./aws/install && \ 56 | rm -rf awscliv2.zip aws/ 57 | 58 | # AliCloud CLI Install 59 | RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/aliyun/aliyun-cli/HEAD/install.sh)" && \ 60 | rm aliyun-cli-linux-latest-* 61 | 62 | # Google Cloud CLI Install 63 | RUN ARCH=$(dpkg --print-architecture) && \ 64 | if [ "$ARCH" = "amd64" ]; then \ 65 | curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz; \ 66 | else \ 67 | curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-arm.tar.gz; \ 68 | fi && \ 69 | tar zxvf google-cloud-cli-linux-* && \ 70 | ./google-cloud-sdk/install.sh && \ 71 | rm -rf google-cloud-cli-linux-* 72 | 73 | # s5cmd cli Install 74 | RUN wget https://github.com/peak/s5cmd/releases/download/v2.3.0/s5cmd_2.3.0_Linux-64bit.tar.gz && \ 75 | tar -xzf s5cmd_2.3.0_Linux-64bit.tar.gz && \ 76 | sudo mv s5cmd /usr/local/bin/ && \ 77 | sudo chmod +x /usr/local/bin/s5cmd && \ 78 | rm s5cmd_2.3.0_Linux-64bit.tar.gz 79 | 80 | # Kubectl CLI Install 81 | RUN ARCH=$(dpkg --print-architecture) && \ 82 | curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl" \ 83 | && curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl.sha256" \ 84 | && echo "$(cat kubectl.sha256) kubectl" | sha256sum --check \ 85 | && install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl \ 86 | && kubectl version --client 87 | 88 | CMD ["tail", "-f", "/dev/null"] 89 | -------------------------------------------------------------------------------- /docker/debug-pod/README.md: -------------------------------------------------------------------------------- 1 | # Debug Pod 2 | 3 | This docker image is designed for debugging purposes and includes a variety of useful tools(such as `mysql-client` and `kubectl`, etc.). 4 | 5 | ## Building the Image 6 | 7 | The debug pod is constructed using the Dockerfile located in [here](./Dockerfile). 8 | 9 | ## Features 10 | 11 | - **Tools Included**: 12 | - `mysql-client` 13 | - `postgresql-client` 14 | - `kubectl` 15 | - `etcdctl` 16 | - `AWS CLI` 17 | - `AliCloud CLI` 18 | - `Google Cloud CLI` 19 | 20 | ## Enabling the Debug Pod 21 | 22 | To enable the debug pod, set the configuration option `greptimedb-cluster.debugPod.enabled` to `true`. This will allow you to access the debug pod for troubleshooting and debugging tasks. 23 | 24 | ## Accessing the Debug Pod 25 | 26 | Once the debug pod is enabled, you can access it using the following command: 27 | 28 | ```bash 29 | kubectl exec -it $(kubectl get pods -l app={{ .Release.Name }}-debug-pod -o jsonpath='{.items[0].metadata.name}') -- /bin/bash 30 | ``` 31 | 32 | This command will open an interactive shell inside the debug pod, allowing you to run various commands and tools for debugging. 33 | 34 | ## Example Deployment YAML 35 | 36 | You can deploy the debug pod using the following YAML configuration: 37 | 38 | ```yaml 39 | apiVersion: apps/v1 40 | kind: Deployment 41 | metadata: 42 | name: debug 43 | namespace: default 44 | labels: 45 | app: debug 46 | spec: 47 | replicas: 1 48 | selector: 49 | matchLabels: 50 | app: debug 51 | template: 52 | metadata: 53 | labels: 54 | app: debug 55 | spec: 56 | containers: 57 | - image: greptime/greptime-tool:${tag} # Replace ${tag} with the desired image tag, which you can find here: https://hub.docker.com/repository/docker/greptime/greptime-tool/tags 58 | name: debug 59 | ``` 60 | -------------------------------------------------------------------------------- /scripts/crds/templates/crd-greptimedbcluster.tmpl: -------------------------------------------------------------------------------- 1 | {{- if .Values.crds.install }} 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | {{- if .Values.crds.keep }} 7 | "helm.sh/resource-policy": keep 8 | {{- end }} 9 | {{- with .Values.crds.annotations }} 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | labels: 13 | {{- if .Values.crds.additionalLabels }} 14 | {{- toYaml .Values.crds.additionalLabels | nindent 4 }} 15 | {{- end }} 16 | name: greptimedbclusters.greptime.io 17 | spec: 18 | ${{ spec }} 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /scripts/crds/templates/crd-greptimedbstandalone.tmpl: -------------------------------------------------------------------------------- 1 | {{- if .Values.crds.install }} 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | annotations: 6 | {{- if .Values.crds.keep }} 7 | "helm.sh/resource-policy": keep 8 | {{- end }} 9 | {{- with .Values.crds.annotations }} 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | labels: 13 | {{- if .Values.crds.additionalLabels }} 14 | {{- toYaml .Values.crds.additionalLabels | nindent 4 }} 15 | {{- end }} 16 | name: greptimedbstandalones.greptime.io 17 | spec: 18 | ${{ spec }} 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /scripts/crds/update-crds.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | set -e 4 | 5 | function get_operator_app_version() { 6 | operator_app_version=$(awk '/appVersion:/{print $2}' "charts/greptimedb-operator/Chart.yaml") 7 | 8 | if [[ -z "$operator_app_version" ]]; then 9 | echo "Failed to get 'appVersion' from charts/greptimedb-operator/Chart.yaml" 10 | exit 1 11 | fi 12 | } 13 | 14 | function main() { 15 | get_operator_app_version 16 | 17 | curl -sL "https://github.com/GreptimeTeam/greptimedb-operator/releases/download/v$operator_app_version/greptimedbclusters.yaml" -o /tmp/greptimedbclusters.yaml 18 | yq e '.spec' /tmp/greptimedbclusters.yaml | awk '{print " " $0}' > /tmp/greptimedbclusters.spec 19 | sed -e '/\${{ spec }}/{ 20 | s/\${{ spec }}//g 21 | r /tmp/greptimedbclusters.spec 22 | d 23 | }' scripts/crds/templates/crd-greptimedbcluster.tmpl > charts/greptimedb-operator/templates/crds/crd-greptimedbcluster.yaml 24 | 25 | curl -sL "https://github.com/GreptimeTeam/greptimedb-operator/releases/download/v$operator_app_version/greptimedbstandalones.yaml" -o /tmp/greptimedbstandalones.yaml 26 | yq e '.spec' /tmp/greptimedbstandalones.yaml | awk '{print " " $0}' > /tmp/greptimedbstandalones.spec 27 | sed -e '/\${{ spec }}/{ 28 | s/\${{ spec }}//g 29 | r /tmp/greptimedbstandalones.spec 30 | d 31 | }' scripts/crds/templates/crd-greptimedbstandalone.tmpl > charts/greptimedb-operator/templates/crds/crd-greptimedbstandalone.yaml 32 | } 33 | 34 | main 35 | -------------------------------------------------------------------------------- /scripts/crds/upgrade-crds.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | OPERATOR_VERSION=${1:-$(awk '/appVersion:/{print $2}' "charts/greptimedb-operator/Chart.yaml")} 6 | 7 | function upgrade_crds() { 8 | if [ -z "$OPERATOR_VERSION" ]; then 9 | echo "Failed to get the operator version." 10 | exit 1 11 | fi 12 | 13 | if [ "$OPERATOR_VERSION" == "latest" ]; then 14 | echo "Applying CRDs for the latest released greptimedb-operator version" 15 | kubectl apply -f "https://github.com/GreptimeTeam/greptimedb-operator/releases/latest/download/greptimedbclusters.yaml" 16 | kubectl apply -f "https://github.com/GreptimeTeam/greptimedb-operator/releases/latest/download/greptimedbstandalones.yaml" 17 | exit 0 18 | fi 19 | 20 | echo "Applying CRDs for the current greptimedb-operator version $OPERATOR_VERSION" 21 | kubectl apply -f "https://github.com/GreptimeTeam/greptimedb-operator/releases/download/v$OPERATOR_VERSION/greptimedbclusters.yaml" 22 | kubectl apply -f "https://github.com/GreptimeTeam/greptimedb-operator/releases/download/v$OPERATOR_VERSION/greptimedbstandalones.yaml" 23 | } 24 | 25 | upgrade_crds 26 | -------------------------------------------------------------------------------- /scripts/e2e/greptimedb-cluster.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | # Configuration 6 | DB_HOST="127.0.0.1" 7 | DB_PORT="4002" 8 | TABLE_NAME="greptimedb_cluster_test_$(date +%s)" 9 | PORT_FORWARD_PID="" 10 | CONNECTION_LOG="/tmp/connections.out" 11 | TIMEOUT_CLUSTER=300 12 | SLEEP_INTERVAL=5 13 | 14 | # SQL Templates 15 | CreateTableSQL="CREATE TABLE %s ( 16 | ts TIMESTAMP DEFAULT current_timestamp(), 17 | n INT, 18 | row_id INT, 19 | TIME INDEX (ts), 20 | PRIMARY KEY(n) 21 | ) 22 | PARTITION ON COLUMNS (n) ( 23 | n < 5, 24 | n >= 5 AND n < 9, 25 | n >= 9 26 | )" 27 | 28 | InsertDataSQL="INSERT INTO %s(n, row_id) VALUES (%d, %d)" 29 | SelectDataSQL="SELECT * FROM %s" 30 | DropTableSQL="DROP TABLE %s" 31 | TestRowIDNum=1 32 | 33 | function log() { 34 | echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" 35 | } 36 | 37 | function create_table() { 38 | local table_name=$1 39 | local sql=$(printf "$CreateTableSQL" "$table_name") 40 | log "Creating table: $table_name" 41 | if ! mysql -h "$DB_HOST" -P "$DB_PORT" -e "$sql"; then 42 | log "Failed to create table: $table_name" 43 | exit 1 44 | fi 45 | } 46 | 47 | function insert_data() { 48 | local table_name=$1 49 | local sql=$(printf "$InsertDataSQL" "$table_name" "$TestRowIDNum" "$TestRowIDNum") 50 | log "Inserting data into: $table_name" 51 | if ! mysql -h "$DB_HOST" -P "$DB_PORT" -e "$sql"; then 52 | log "Failed to insert data into: $table_name" 53 | exit 1 54 | fi 55 | } 56 | 57 | function select_data() { 58 | local table_name=$1 59 | local sql=$(printf "$SelectDataSQL" "$table_name") 60 | log "Querying data from: $table_name" 61 | if ! mysql -h "$DB_HOST" -P "$DB_PORT" -e "$sql"; then 62 | log "Failed to select data from: $table_name" 63 | exit 1 64 | fi 65 | } 66 | 67 | function drop_table() { 68 | local table_name=$1 69 | local sql=$(printf "$DropTableSQL" "$table_name") 70 | log "Dropping table: $table_name" 71 | if ! mysql -h "$DB_HOST" -P "$DB_PORT" -e "$sql"; then 72 | log "Failed to drop table: $table_name" 73 | exit 1 74 | fi 75 | } 76 | 77 | function deploy_etcd() { 78 | log "Deploying etcd..." 79 | if ! helm upgrade --install etcd \ 80 | oci://registry-1.docker.io/bitnamicharts/etcd \ 81 | --set replicaCount=1 \ 82 | --set auth.rbac.create=false \ 83 | --set auth.rbac.token.enabled=false \ 84 | --create-namespace \ 85 | -n etcd-cluster; then 86 | log "Failed to deploy etcd" 87 | exit 1 88 | fi 89 | 90 | log "Waiting for etcd to be ready..." 91 | if ! kubectl rollout status --timeout=120s statefulset/etcd -n etcd-cluster; then 92 | log "ETCD deployment failed or timed out" 93 | exit 1 94 | fi 95 | } 96 | 97 | function deploy_greptimedb_operator() { 98 | log "Deploying GreptimeDB Operator..." 99 | if ! helm upgrade --install greptimedb-operator charts/greptimedb-operator -n default; then 100 | log "Failed to deploy greptimedb-operator" 101 | exit 1 102 | fi 103 | 104 | log "Waiting for operator to be ready..." 105 | if ! kubectl rollout status --timeout=120s deployment/greptimedb-operator -n default; then 106 | log "Operator deployment failed or timed out" 107 | exit 1 108 | fi 109 | } 110 | 111 | function deploy_greptimedb_cluster() { 112 | log "Setting up dependencies..." 113 | if ! helm repo add grafana https://grafana.github.io/helm-charts --force-update; then 114 | log "Failed to add grafana repo" 115 | exit 1 116 | fi 117 | 118 | if ! helm repo add jaeger-all-in-one https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts --force-update; then 119 | log "Failed to add jaeger repo" 120 | exit 1 121 | fi 122 | 123 | if ! helm dependency build charts/greptimedb-cluster; then 124 | log "Failed to build dependencies" 125 | exit 1 126 | fi 127 | 128 | log "Deploying GreptimeDB Cluster..." 129 | if ! helm upgrade --install mycluster charts/greptimedb-cluster -n default; then 130 | log "Failed to deploy greptimedb-cluster" 131 | exit 1 132 | fi 133 | 134 | log "Waiting for cluster to be ready (timeout: ${TIMEOUT_CLUSTER}s)..." 135 | local elapsed_time=0 136 | while true; do 137 | PHASE=$(kubectl -n default get gtc mycluster -o jsonpath='{.status.clusterPhase}' 2>/dev/null || echo "Unknown") 138 | if [ "$PHASE" == "Running" ]; then 139 | log "Cluster is ready" 140 | break 141 | elif [ $elapsed_time -ge $TIMEOUT_CLUSTER ]; then 142 | log "Timed out waiting for cluster to be ready. Current phase: $PHASE" 143 | exit 1 144 | else 145 | log "Cluster is not ready yet: Current phase: $PHASE" 146 | sleep $SLEEP_INTERVAL 147 | fi 148 | elapsed_time=$((elapsed_time + SLEEP_INTERVAL)) 149 | done 150 | } 151 | 152 | function start_port_forward() { 153 | log "Starting port forwarding..." 154 | kubectl port-forward -n default svc/mycluster-frontend \ 155 | 4000:4000 \ 156 | 4001:4001 \ 157 | 4002:4002 \ 158 | 4003:4003 > "$CONNECTION_LOG" 2>&1 & 159 | 160 | PORT_FORWARD_PID=$! 161 | sleep 5 162 | 163 | if ! ps -p "$PORT_FORWARD_PID" > /dev/null; then 164 | log "Port forwarding failed. Check $CONNECTION_LOG for details." 165 | exit 1 166 | fi 167 | log "Port forwarding established (PID: $PORT_FORWARD_PID)" 168 | } 169 | 170 | function stop_port_forward() { 171 | if [[ -n "$PORT_FORWARD_PID" ]]; then 172 | log "Stopping port forwarding (PID: $PORT_FORWARD_PID)..." 173 | if kill -0 "$PORT_FORWARD_PID" 2>/dev/null; then 174 | kill "$PORT_FORWARD_PID" || true 175 | fi 176 | PORT_FORWARD_PID="" 177 | fi 178 | } 179 | 180 | function run_mysql_tests() { 181 | start_port_forward 182 | 183 | create_table "$TABLE_NAME" 184 | insert_data "$TABLE_NAME" 185 | select_data "$TABLE_NAME" 186 | drop_table "$TABLE_NAME" 187 | 188 | stop_port_forward 189 | } 190 | 191 | function cleanup() { 192 | log "Starting cleanup..." 193 | stop_port_forward 194 | 195 | # Clean up any orphaned port-forward processes 196 | pids=$(pgrep -f "kubectl port-forward.*mycluster-frontend" || true) 197 | if [[ -n "$pids" ]]; then 198 | log "Cleaning up orphaned port-forward processes: $pids" 199 | kill $pids 2>/dev/null || true 200 | fi 201 | 202 | log "Cleanup completed" 203 | } 204 | 205 | function main() { 206 | log "Starting GreptimeDB cluster test..." 207 | 208 | deploy_etcd 209 | deploy_greptimedb_operator 210 | deploy_greptimedb_cluster 211 | run_mysql_tests 212 | 213 | log "All tests completed successfully" 214 | } 215 | 216 | main 217 | -------------------------------------------------------------------------------- /scripts/e2e/greptimedb-standalone.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | # Configuration variables 6 | DB_HOST="127.0.0.1" 7 | DB_PORT="4002" 8 | TABLE_NAME="greptimedb_standalone_test_$(date +%s)" 9 | PORT_FORWARD_PID="" 10 | CONNECTION_LOG="/tmp/connections.out" 11 | 12 | # SQL templates 13 | CreateTableSQL="CREATE TABLE %s ( 14 | ts TIMESTAMP DEFAULT current_timestamp(), 15 | n INT, 16 | row_id INT, 17 | TIME INDEX (ts), 18 | PRIMARY KEY(n) 19 | ) 20 | PARTITION ON COLUMNS (n) ( 21 | n < 5, 22 | n >= 5 AND n < 9, 23 | n >= 9 24 | )" 25 | 26 | InsertDataSQL="INSERT INTO %s(n, row_id) VALUES (%d, %d)" 27 | SelectDataSQL="SELECT * FROM %s" 28 | DropTableSQL="DROP TABLE %s" 29 | TestRowIDNum=1 30 | 31 | function log() { 32 | echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" 33 | } 34 | 35 | function create_table() { 36 | local table_name=$1 37 | local sql=$(printf "$CreateTableSQL" "$table_name") 38 | log "Creating table: $table_name" 39 | if ! mysql -h "$DB_HOST" -P "$DB_PORT" -e "$sql"; then 40 | log "Failed to create table: $table_name" 41 | exit 1 42 | fi 43 | } 44 | 45 | function insert_data() { 46 | local table_name=$1 47 | local sql=$(printf "$InsertDataSQL" "$table_name" "$TestRowIDNum" "$TestRowIDNum") 48 | log "Inserting test data into: $table_name" 49 | if ! mysql -h "$DB_HOST" -P "$DB_PORT" -e "$sql"; then 50 | log "Failed to insert data into: $table_name" 51 | exit 1 52 | fi 53 | } 54 | 55 | function select_data() { 56 | local table_name=$1 57 | local sql=$(printf "$SelectDataSQL" "$table_name") 58 | log "Querying data from: $table_name" 59 | if ! mysql -h "$DB_HOST" -P "$DB_PORT" -e "$sql"; then 60 | log "Failed to select data from: $table_name" 61 | exit 1 62 | fi 63 | } 64 | 65 | function drop_table() { 66 | local table_name=$1 67 | local sql=$(printf "$DropTableSQL" "$table_name") 68 | log "Dropping table: $table_name" 69 | if ! mysql -h "$DB_HOST" -P "$DB_PORT" -e "$sql"; then 70 | log "Failed to drop table: $table_name" 71 | exit 1 72 | fi 73 | } 74 | 75 | function deploy_greptimedb_standalone() { 76 | log "Deploying GreptimeDB standalone..." 77 | if ! helm upgrade --install greptimedb-standalone charts/greptimedb-standalone -n default; then 78 | log "Failed to deploy greptimedb-standalone" 79 | exit 1 80 | fi 81 | 82 | log "Waiting for GreptimeDB standalone to be ready..." 83 | if ! kubectl rollout status --timeout=120s statefulset/greptimedb-standalone -n default; then 84 | log "GreptimeDB standalone deployment failed or timed out" 85 | exit 1 86 | fi 87 | } 88 | 89 | function start_port_forward() { 90 | log "Starting port forwarding..." 91 | kubectl port-forward -n default svc/greptimedb-standalone \ 92 | 4000:4000 \ 93 | 4001:4001 \ 94 | 4002:4002 \ 95 | 4003:4003 > "$CONNECTION_LOG" 2>&1 & 96 | 97 | PORT_FORWARD_PID=$! 98 | sleep 5 99 | 100 | if ! ps -p "$PORT_FORWARD_PID" > /dev/null; then 101 | log "Port forwarding failed. Check $CONNECTION_LOG for details." 102 | exit 1 103 | fi 104 | 105 | log "Port forwarding established (PID: $PORT_FORWARD_PID)" 106 | } 107 | 108 | function stop_port_forward() { 109 | if [[ -n "$PORT_FORWARD_PID" ]]; then 110 | log "Stopping port forwarding (PID: $PORT_FORWARD_PID)..." 111 | if kill -0 "$PORT_FORWARD_PID" 2>/dev/null; then 112 | kill "$PORT_FORWARD_PID" || true 113 | fi 114 | PORT_FORWARD_PID="" 115 | fi 116 | } 117 | 118 | function run_mysql_tests() { 119 | start_port_forward 120 | 121 | create_table "$TABLE_NAME" 122 | insert_data "$TABLE_NAME" 123 | select_data "$TABLE_NAME" 124 | drop_table "$TABLE_NAME" 125 | 126 | stop_port_forward 127 | } 128 | 129 | function cleanup() { 130 | log "Starting cleanup..." 131 | stop_port_forward 132 | 133 | # Clean up any orphaned port-forward processes 134 | pids=$(pgrep -f "kubectl port-forward.*greptimedb-standalone" || true) 135 | if [[ -n "$pids" ]]; then 136 | log "Cleaning up orphaned port-forward processes: $pids" 137 | kill $pids 2>/dev/null || true 138 | fi 139 | 140 | log "Cleanup completed" 141 | } 142 | 143 | function main() { 144 | log "Starting GreptimeDB standalone test..." 145 | deploy_greptimedb_standalone 146 | run_mysql_tests 147 | log "All tests completed successfully" 148 | } 149 | 150 | main 151 | -------------------------------------------------------------------------------- /scripts/release/release-charts-to-acr.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | OCI_REGISTRY_URL=${OCI_REGISTRY_URL:-"greptime-registry.cn-hangzhou.cr.aliyuncs.com"} 4 | OCI_NAMESPACE=${OCI_NAMESPACE:-"charts"} 5 | CHARTS_DIR="charts" 6 | 7 | for dir in "$CHARTS_DIR"/*; do 8 | # Ensure the directory exists and is not empty. 9 | if [ -d "$dir" ]; then 10 | # Get the chart name from the directory path. 11 | chart_name=$(basename "$dir") 12 | 13 | if [ "$chart_name" == "greptimedb-cluster" ]; then 14 | # Use the OCI registry URL as the repository in the Chart.yaml file. 15 | sed -i 's|https://grafana.github.io/helm-charts|oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts|g' "$dir/Chart.yaml" 16 | sed -i 's|https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts|oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts|g' "$dir/Chart.yaml" 17 | 18 | # Update the dependencies. 19 | helm dependency update "$dir" 20 | fi 21 | 22 | # Package the chart, specifying the directory and output path directly. 23 | helm package "$dir" --destination "$dir" 24 | 25 | # Get the packaged chart file path. 26 | packaged_file=$(find "$dir" -type f -name "${chart_name}-*.tgz" -print -quit) 27 | 28 | echo "Package $chart_name to $packaged_file and push to oci://$OCI_REGISTRY_URL/$OCI_NAMESPACE/$chart_name ..." 29 | 30 | # Push the packaged chart to the OCI repository, handling the output path. 31 | helm push "${packaged_file}" "oci://$OCI_REGISTRY_URL/$OCI_NAMESPACE" 32 | fi 33 | done 34 | -------------------------------------------------------------------------------- /scripts/release/release-charts-to-s3.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ue 4 | 5 | GREPTIME_RELEASE_BUCKET=$1 6 | RELEASE_DIR=releases/charts 7 | 8 | function update_greptime_charts() { 9 | helm repo add greptime https://greptimeteam.github.io/helm-charts/ 10 | helm repo update 11 | } 12 | 13 | function release_charts_to_s3() { 14 | repo=$1 15 | chart=$2 16 | 17 | mkdir "$chart" 18 | echo "Pulling chart from '$repo/$chart'..." 19 | 20 | helm pull "$repo"/"$chart" -d "$chart" 21 | 22 | package=$(ls ./"$chart") 23 | 24 | if [ -z "$package" ]; then 25 | echo "No package found from $repo/$chart" 26 | exit 1 27 | fi 28 | 29 | # Get the version from the package, for example, greptimedb-0.1.1-alpha.12.tgz -> 0.1.1-alpha.12. 30 | version=$(echo "$package" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+[-a-zA-Z0-9.]*' | sed 's/.tgz//') 31 | 32 | if [ -z "$version" ]; then 33 | echo "No version found from $repo/$chart" 34 | exit 1 35 | fi 36 | 37 | echo "Releasing package '$package' to 's3://$GREPTIME_RELEASE_BUCKET/$RELEASE_DIR/$chart/$version'..." 38 | 39 | s5cmd cp "$chart"/"$package" s3://"$GREPTIME_RELEASE_BUCKET"/"$RELEASE_DIR"/"$chart"/"$version"/"$package" 40 | 41 | echo "Releasing package "$chart-latest.tgz" to 's3://$GREPTIME_RELEASE_BUCKET/$RELEASE_DIR/$chart/latest'..." 42 | 43 | s5cmd cp "$chart"/"$package" s3://"$GREPTIME_RELEASE_BUCKET"/"$RELEASE_DIR"/"$chart"/latest/"$chart"-latest.tgz 44 | 45 | echo "$version" > latest-version.txt 46 | 47 | # Create a latest-version.txt file in the chart directory. 48 | s5cmd cp latest-version.txt s3://"$GREPTIME_RELEASE_BUCKET"/"$RELEASE_DIR"/"$chart"/latest-version.txt 49 | } 50 | 51 | function main() { 52 | update_greptime_charts 53 | release_charts_to_s3 greptime greptimedb-operator 54 | release_charts_to_s3 greptime greptimedb-standalone 55 | release_charts_to_s3 greptime greptimedb-cluster 56 | release_charts_to_s3 oci://registry-1.docker.io/bitnamicharts etcd 57 | } 58 | 59 | # The entrypoint for the script. 60 | main 61 | -------------------------------------------------------------------------------- /scripts/update/update-grafana-dashboard.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | UPSTREAM_DASHBOARD_URL=https://raw.githubusercontent.com/GreptimeTeam/greptimedb/refs/heads/main/grafana/dashboards/metrics/cluster/dashboard.json 6 | 7 | update_chart_version() { 8 | # Extract the version and increment the last digit by 1. 9 | VERSION=$(cat charts/greptimedb-cluster/Chart.yaml | grep -m 1 'version:' | awk '{print $2}') 10 | VERSION_PARTS=(${VERSION//./ }) 11 | VERSION_PARTS[2]=$((${VERSION_PARTS[2]} + 1)) 12 | NEW_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}" 13 | echo "Updating chart version from '${VERSION}' to '${NEW_VERSION}'" 14 | sed -i "s/version: ${VERSION}/version: ${NEW_VERSION}/g" charts/greptimedb-cluster/Chart.yaml 15 | } 16 | 17 | update_grafana_dashboard() { 18 | # Download the latest dashboard from the upstream repository. 19 | curl -o /tmp/latest-dashboard.json ${UPSTREAM_DASHBOARD_URL} 20 | 21 | # Ensure the dashboard file is not empty and has differences with the local file. 22 | if [ -s /tmp/latest-dashboard.json ] && ! cmp -s /tmp/latest-dashboard.json charts/greptimedb-cluster/dashboards/greptimedb-cluster-metrics.json; then 23 | 24 | # Configure Git configs. 25 | git config --global user.email helm-charts-ci@greptime.com 26 | git config --global user.name helm-charts-ci 27 | 28 | # Copy the new dashboard file. 29 | cp /tmp/latest-dashboard.json charts/greptimedb-cluster/dashboards/greptimedb-cluster-metrics.json 30 | 31 | # Checkout a new branch. 32 | BRANCH_NAME="ci/update-grafana-dashboard-$(date +%Y%m%d%H%M%S)" 33 | git checkout -b $BRANCH_NAME 34 | 35 | # Update the chart version. 36 | update_chart_version 37 | 38 | # Execute the `make docs` command. 39 | make docs 40 | 41 | # Commit the changes. 42 | git add charts/greptimedb-cluster 43 | git commit -s -m "ci: update Grafana dashboard from upstream" 44 | git push origin $BRANCH_NAME 45 | 46 | # Create a Pull Request. 47 | gh pr create \ 48 | --title "ci: update Grafana dashboard from upstream" \ 49 | --body "This PR updates the Grafana dashboard from the upstream repository." \ 50 | --base main \ 51 | --head $BRANCH_NAME \ 52 | --reviewer zyy17 \ 53 | --reviewer daviderli614 54 | else 55 | exit 0 56 | fi 57 | } 58 | 59 | update_grafana_dashboard 60 | -------------------------------------------------------------------------------- /scripts/update/update-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CHART="$1" 4 | VERSION="$2" 5 | 6 | function update_version() { 7 | if [ -z "$CHART" ] || [ -z "$VERSION" ]; then 8 | echo "Error: Missing required arguments CHART or VERSION." 9 | exit 1 10 | fi 11 | 12 | if [[ "$CHART" != "greptimedb-standalone" && "$CHART" != "greptimedb-operator" && "$CHART" != "greptimedb-cluster" ]]; then 13 | echo "Error: Invalid CHART value: "$CHART"." 14 | exit 1 15 | fi 16 | 17 | if [[ ! "$VERSION" =~ ^v ]]; then 18 | echo "Error: VERSION must start with 'v'." 19 | exit 1 20 | fi 21 | 22 | chart_file="./charts/"$CHART"/Chart.yaml" 23 | values_file="./charts/"$CHART"/values.yaml" 24 | 25 | current_version=$(yq eval '.version' "$chart_file") 26 | 27 | major=$(echo "$current_version" | awk -F. '{print $1}') 28 | minor=$(echo "$current_version" | awk -F. '{print $2}') 29 | patch=$(echo "$current_version" | awk -F. '{print $3}') 30 | 31 | next_version="$major.$minor.$((patch + 1))" 32 | appVersion=${VERSION#v} 33 | 34 | yq eval ".version = \"$next_version\"" -i "$chart_file" 35 | yq eval ".appVersion = \"$appVersion\"" -i "$chart_file" 36 | 37 | echo "The chart $CHART version updated to $next_version successfully." 38 | 39 | yq e ".image.tag = \"$VERSION\"" "$values_file" > /tmp/"$CHART"-values-updated.yaml 40 | diff -U0 -w -b --ignore-blank-lines "$values_file" /tmp/"$CHART"-values-updated.yaml > /tmp/"$CHART"-values.diff 41 | patch "$values_file" < /tmp/"$CHART"-values.diff 42 | 43 | echo "The chart $CHART image updated to $VERSION successfully." 44 | } 45 | 46 | update_version 47 | --------------------------------------------------------------------------------