├── .github
└── containers.png
├── .gitignore
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.txt
├── README.md
└── charts
└── questdb
├── .helmignore
├── Chart.yaml
├── README.md
├── templates
├── NOTES.txt
├── _helpers.tpl
├── config.yaml
├── headless-svc.yaml
├── ingress.yaml
├── init_db_migrations_configmap.yaml
├── service.yaml
├── serviceaccount.yaml
├── statefulset.yaml
└── tests
│ └── test-connection.yaml
└── values.yaml
/.github/containers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/questdb/questdb-kubernetes/4d7c8d8f5ddeaba7b54186393b0239db511dbd68/.github/containers.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | dist/
2 | docs/
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @bluestreak01
2 |
3 | /charts/questdb/ @bluestreak01 @sklarsa @nwoolmer
4 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and
9 | expression, level of experience, education, socio-economic status, nationality,
10 | personal appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | - Using welcoming and inclusive language
18 | - Being respectful of differing viewpoints and experiences
19 | - Gracefully accepting constructive criticism
20 | - Focusing on what is best for the community
21 | - Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | - The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | - Trolling, insulting/derogatory comments, and personal or political attacks
28 | - Public or private harassment
29 | - Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | - Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or reject
41 | comments, commits, code, wiki edits, issues, and other contributions that are
42 | not aligned to this Code of Conduct, or to ban temporarily or permanently any
43 | contributor for other behaviors that they deem inappropriate, threatening,
44 | offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team on Slack. All complaints will be
59 | reviewed and investigated and will result in a response that is deemed necessary
60 | and appropriate to the circumstances. The project team is obligated to maintain
61 | confidentiality with regard to the reporter of an incident. Further details of
62 | specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
71 | version 1.4, available at
72 | https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
73 |
74 | [homepage]: https://www.contributor-covenant.org
75 |
76 | For answers to common questions about this code of conduct, see
77 | https://www.contributor-covenant.org/faq
78 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to QuestDB
2 |
3 | ## Raise an Issue
4 |
5 | Raising **[issues](https://github.com/questdb/questdb-kubernetes/issues)** is
6 | welcome. We aim to respond quickly and thoughtfully. This is a good place to
7 | start before deep diving into the code base.
8 |
9 | # Committing
10 |
11 | We use [Conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) to
12 | auto-generate release notes. We require all commit comments to conform. To that
13 | end, commits have to be granular enough to be successfully described using this
14 | method.
15 |
16 | # Squashing commits
17 |
18 | When submitting a pull request to QuestDB, we ask that you squash your commits
19 | before we merge.
20 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Helm Charts for QuestDB
2 |
3 | Here you will find both the code for our Helm charts and the artifacts available
4 | through GitHub Pages as a standard charts repository.
5 |
6 |
7 |
12 |
13 |
14 | ## What is QuestDB
15 |
16 | [QuestDB](https://questdb.io) is an open source database designed to make time
17 | series lightning fast and easy.
18 |
19 | It uses a column-oriented approach, vectorized execution, SIMD instructions, and
20 | a whole array of low-latency techniques. The whole code base is built from
21 | scratch and without dependencies, in the name of performance. We are 100% free
22 | from garbage collection.
23 |
24 | QuestDB implements SQL, and augments it for time-series. It exposes a Postgres
25 | wire protocol, a high-performance REST API, and even supports ingestion with
26 | InfluxDB line protocol. It supports both relational and time-series joins, which
27 | makes it easy to correlate data over time. Writes are durably committed to disk,
28 | meaning that the data is safe - yet instantly accessible.
29 |
30 | ## Add Helm repository
31 |
32 | ```shell
33 | helm repo add questdb https://helm.questdb.io/
34 | helm repo update
35 | ```
36 |
37 | ## Hubs
38 |
39 | You can find our Helm charts distributed on:
40 |
41 | - [Artifact Hub](https://artifacthub.io/packages/helm/questdb/questdb)
42 | - [Helm Hub](https://hub.helm.sh/charts/questdb/questdb)
43 |
44 | ## Charts
45 |
46 | - [QuestDB](charts/questdb/README.md)
47 |
48 | ## Resources
49 |
50 | Complete references are available in the
51 | [Documentation](https://questdb.io/docs/introduction/).
52 |
53 | Get started:
54 |
55 | - [Docker](https://questdb.io/docs/get-started/docker/)
56 | - [Binaries](https://questdb.io/docs/get-started/binaries/)
57 | - [Homebrew](https://questdb.io/docs/get-started/homebrew/)
58 |
59 | Develop:
60 |
61 | - [Connect](https://questdb.io/docs/develop/connect/)
62 | - [Insert data](https://questdb.io/docs/develop/insert-data/)
63 | - [Query data](https://questdb.io/docs/develop/query-data/)
64 | - [Authenticate](https://questdb.io/docs/develop/authenticate/)
65 |
66 | Concepts:
67 |
68 | - [SQL extensions](https://questdb.io/docs/concept/sql-extensions/)
69 | - [Storage model](https://questdb.io/docs/concept/storage-model/)
70 | - [Partitions](https://questdb.io/docs/concept/partitions/)
71 | - [Designated timestamp](https://questdb.io/docs/concept/designated-timestamp/)
72 |
73 | ## Support / Contact
74 |
75 | [Slack Channel](https://slack.questdb.io)
76 |
77 | ## Roadmap
78 |
79 | [Our roadmap is here](https://github.com/questdb/questdb/projects/3)
80 |
81 | ## Contribution
82 |
83 | Feel free to contribute to the project by forking the repository and submitting
84 | pull requests. Please make sure you have read our
85 | [contributing guide](https://github.com/questdb/questdb-kubernetes/blob/master/CONTRIBUTING.md).
86 |
--------------------------------------------------------------------------------
/charts/questdb/.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/questdb/Chart.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v2
2 | name: questdb
3 | version: 1.0.7
4 | appVersion: 8.3.3
5 | description: Run QuestDB on Kubernetes via Helm
6 | icon: https://questdb.com/img/favicon.png
7 | home: https://questdb.com
8 | sources:
9 | - https://github.com/questdb/questdb-kubernetes/
10 | type: application
11 | keywords:
12 | - questdb
13 | - database
14 | - timeseries
15 | - sql
16 | maintainers:
17 | - email: containers@questdb.com
18 | name: QuestDB Team
19 |
--------------------------------------------------------------------------------
/charts/questdb/README.md:
--------------------------------------------------------------------------------
1 | # QuestDB Helm chart
2 |
3 | ## Install the chart
4 |
5 | 1. Add our repository:
6 |
7 | ```shell
8 | helm repo add questdb https://helm.questdb.io/
9 | helm repo update
10 | ```
11 |
12 | 2. Run the following:
13 |
14 | ```shell
15 | helm install questdb questdb/questdb
16 | ```
17 |
18 | For a list of all options and variables, please check the
19 | [values.yaml](values.yaml).
20 |
--------------------------------------------------------------------------------
/charts/questdb/templates/NOTES.txt:
--------------------------------------------------------------------------------
1 | 1. Get the application URL by running these commands:
2 |
3 | {{- if .Values.ingress.enabled }}
4 | {{- range $host := .Values.ingress.hosts }}
5 | {{- range .paths }}
6 | http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
7 | {{- end }}
8 | {{- end }}
9 | {{- else if contains "NodePort" .Values.service.type }}
10 | export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "questdb.fullname" . }})
11 | export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
12 | echo http://$NODE_IP:$NODE_PORT
13 | {{- else if contains "LoadBalancer" .Values.service.type }}
14 | NOTE: It may take a few minutes for the LoadBalancer IP to be available.
15 | You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "questdb.fullname" . }}'
16 | export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "questdb.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
17 | echo http://$SERVICE_IP:{{ .Values.service.port }}
18 | {{- else if contains "ClusterIP" .Values.service.type }}
19 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "questdb.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
20 | echo "Visit http://127.0.0.1:9000 to use your application"
21 | kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9000:9000
22 | {{- end }}
23 |
--------------------------------------------------------------------------------
/charts/questdb/templates/_helpers.tpl:
--------------------------------------------------------------------------------
1 | {{/* vim: set filetype=mustache: */}}
2 | {{/*
3 | Expand the name of the chart.
4 | */}}
5 | {{- define "questdb.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 "questdb.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 chart name and version as used by the chart label.
29 | */}}
30 | {{- define "questdb.chart" -}}
31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
32 | {{- end }}
33 |
34 | {{/*
35 | Common labels
36 | */}}
37 | {{- define "questdb.labels" -}}
38 | helm.sh/chart: {{ include "questdb.chart" . }}
39 | {{ include "questdb.selectorLabels" . }}
40 | {{- if .Chart.AppVersion }}
41 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
42 | {{- end }}
43 | app.kubernetes.io/managed-by: {{ .Release.Service }}
44 | {{- end }}
45 |
46 | {{/*
47 | Selector labels
48 | */}}
49 | {{- define "questdb.selectorLabels" -}}
50 | app.kubernetes.io/name: {{ include "questdb.name" . }}
51 | app.kubernetes.io/instance: {{ .Release.Name }}
52 | {{- end }}
53 |
54 | {{/*
55 | Create the name of the service account to use
56 | */}}
57 | {{- define "questdb.serviceAccountName" -}}
58 | {{- default (include "questdb.fullname" .) .Values.serviceAccount.name }}
59 | {{- end }}
60 |
61 |
62 | {{/*
63 | Generate server.conf file content
64 | */}}
65 | {{- define "generateServerConfig" -}}
66 | {{- if .Values.metrics.enabled -}}
67 | metrics.enabled = true
68 | {{- end }}
69 | {{- range $key, $value := index .Values.questdb.serverConfig.options }}
70 | {{ $key }} = {{ $value }}
71 | {{- end }}
72 | {{- end }}
73 |
74 | {{/*
75 | Generate log.conf file content
76 | */}}
77 | {{- define "generateLogConfig" -}}
78 | {{- range $key, $value := index .Values.questdb.loggingConfig.options }}
79 | {{ $key }} = {{ $value }}
80 | {{- end }}
81 | {{- end }}
82 |
--------------------------------------------------------------------------------
/charts/questdb/templates/config.yaml:
--------------------------------------------------------------------------------
1 | {{- if or .Values.questdb.serverConfig.enabled .Values.questdb.loggingConfig.enabled -}}
2 | apiVersion: v1
3 | {{- if eq .Values.questdb.configStorageType "Secret" }}
4 | kind: Secret
5 | {{- else }}
6 | kind: ConfigMap
7 | {{- end }}
8 | metadata:
9 | name: {{ include "questdb.fullname" . }}
10 | labels:
11 | {{- include "questdb.labels" . | nindent 4 }}
12 |
13 | {{- if eq .Values.questdb.configStorageType "Secret" }}
14 | data:
15 | {{- if .Values.questdb.serverConfig.enabled }}
16 | server.conf: {{ include "generateServerConfig" . | b64enc -}}
17 | {{- end }}
18 | {{- if .Values.questdb.loggingConfig.enabled }}
19 | log.conf: {{ include "generateLogConfig" . | b64enc -}}
20 | {{- end }}
21 | {{- else }}
22 | data:
23 | {{- if .Values.questdb.serverConfig.enabled }}
24 | server.conf: |
25 | {{- include "generateServerConfig" . | nindent 4 -}}
26 | {{- end }}
27 | {{- if .Values.questdb.loggingConfig.enabled }}
28 | log.conf: |
29 | {{- include "generateLogConfig" . | nindent 4 -}}
30 | {{- end }}
31 | {{- end }}
32 | {{- end }}
33 |
--------------------------------------------------------------------------------
/charts/questdb/templates/headless-svc.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ include "questdb.fullname" . }}-headless
5 | labels:
6 | {{- include "questdb.labels" . | nindent 4 }}
7 | spec:
8 | type: ClusterIP
9 | clusterIP: None
10 | ports:
11 | - name: postgresql
12 | port: 8812
13 | targetPort: postgresql
14 | selector:
15 | {{- include "questdb.selectorLabels" . | nindent 4 }}
16 |
--------------------------------------------------------------------------------
/charts/questdb/templates/ingress.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.ingress.enabled -}}
2 | {{- $fullName := include "questdb.fullname" . -}}
3 | {{- $svcPort := .Values.service.port -}}
4 | {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
5 | apiVersion: networking.k8s.io/v1
6 | {{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
7 | apiVersion: networking.k8s.io/v1beta1
8 | {{- else -}}
9 | apiVersion: extensions/v1beta1
10 | {{- end }}
11 | kind: Ingress
12 | metadata:
13 | name: {{ $fullName }}
14 | labels:
15 | {{- include "questdb.labels" . | nindent 4 }}
16 | {{- with .Values.ingress.annotations }}
17 | annotations:
18 | {{- toYaml . | nindent 4 }}
19 | {{- end }}
20 | spec:
21 | {{- if and .Values.ingress.ingressClassName (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
22 | ingressClassName: {{ .Values.ingress.ingressClassName }}
23 | {{- end }}
24 | {{- if .Values.ingress.tls }}
25 | tls:
26 | {{- range .Values.ingress.tls }}
27 | - hosts:
28 | {{- range .hosts }}
29 | - {{ . | quote }}
30 | {{- end }}
31 | secretName: {{ .secretName }}
32 | {{- end }}
33 | {{- end }}
34 | rules:
35 | {{- range .Values.ingress.hosts }}
36 | - host: {{ .host | quote }}
37 | http:
38 | paths:
39 | {{- range .paths }}
40 | - path: {{ .path }}
41 | {{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
42 | pathType: {{ default "ImplementationSpecific" .pathType | quote }}
43 | {{- end }}
44 | backend:
45 | {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
46 | service:
47 | name: {{ $fullName }}
48 | port:
49 | number: {{ $svcPort }}
50 | {{- else }}
51 | serviceName: {{ $fullName }}
52 | servicePort: {{ $svcPort }}
53 | {{- end }}
54 | {{- end }}
55 | {{- end }}
56 | {{- end }}
57 |
--------------------------------------------------------------------------------
/charts/questdb/templates/init_db_migrations_configmap.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ConfigMap
3 | metadata:
4 | name: {{ include "questdb.fullname" . }}-db-migrations
5 | labels:
6 | {{- include "questdb.labels" . | nindent 4 }}
7 | data:
8 | migrate_to_helm_v1.sh: |
9 | #!/bin/bash
10 |
11 | set -e
12 | shopt -s extglob
13 |
14 | SOURCE_DIR="/mnt/questdb"
15 | DEST_DIR="db"
16 | TEMP_DIR="db_helm_migration_1_tmp_$(date +"%Y%m%d%H%M%S")"
17 | MARKER="tables.d.*"
18 |
19 | cd $SOURCE_DIR
20 |
21 | if [[ -z $(ls $MARKER 2>/dev/null) ]] ; then
22 | echo "File '$MARKER' not found. Nothing to move."
23 | exit 0
24 | fi
25 |
26 | # If the db dir already exists, move its contents to a temp dir
27 | if [[ -e $DEST_DIR ]]; then
28 |
29 | # Check that the temp dir does not already exist. This is highly
30 | # unlikely and we fail if this is the case
31 | if [[ -e $TEMP_DIR ]]; then
32 | echo "$TEMP_DIR exists! exiting data migration"
33 | exit 1
34 | fi
35 |
36 | # Move the existing db dir to the temp location
37 | mv "$DEST_DIR" "$TEMP_DIR"
38 |
39 | fi
40 |
41 | # Make the target db dir
42 | mkdir $DEST_DIR
43 |
44 | # Move all regular files into the db dir
45 | mv !($DEST_DIR) $DEST_DIR
46 |
47 | # Move any hidden files
48 | mv .[^.]* "$DEST_DIR/" 2>/dev/null || true
49 |
50 | # Check if the temp dir exists in the new location, if so, move it back to db/db
51 | if [[ -d "$DEST_DIR/$TEMP_DIR" ]]; then
52 | mv $DEST_DIR/$TEMP_DIR $DEST_DIR/$DEST_DIR
53 | fi
54 |
55 | echo "Migration complete!"
56 |
57 |
--------------------------------------------------------------------------------
/charts/questdb/templates/service.yaml:
--------------------------------------------------------------------------------
1 | {{ $expose := default dict .Values.service.expose }}
2 | {{ $influxdb := default dict $expose.influxdb }}
3 | {{ $postgresql := default dict $expose.postgresql }}
4 | {{ $metrics := default dict .Values.metrics }}
5 | apiVersion: v1
6 | kind: Service
7 | metadata:
8 | name: {{ include "questdb.fullname" . }}
9 | labels:
10 | {{- include "questdb.labels" . | nindent 4 }}
11 | {{- with .Values.service.annotations }}
12 | annotations:
13 | {{- toYaml . | nindent 4 }}
14 | {{- end }}
15 | spec:
16 | type: {{ .Values.service.type }}
17 | ports:
18 | - port: {{ .Values.service.port }}
19 | targetPort: http
20 | protocol: TCP
21 | name: http
22 | {{- if $postgresql.enabled }}
23 | - port: {{ $postgresql.port }}
24 | targetPort: postgresql
25 | protocol: TCP
26 | name: postgresql
27 | {{ end }}
28 | {{- if $influxdb.enabled }}
29 | - port: {{ $influxdb.port }}
30 | targetPort: influxdb
31 | protocol: TCP
32 | name: influxdb
33 | {{ end }}
34 | {{- if $metrics.enabled }}
35 | - port: {{ $metrics.port }}
36 | targetPort: metrics
37 | protocol: TCP
38 | name: metrics
39 | {{ end }}
40 | selector:
41 | {{- include "questdb.selectorLabels" . | nindent 4 }}
42 |
--------------------------------------------------------------------------------
/charts/questdb/templates/serviceaccount.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.serviceAccount.create }}
2 | apiVersion: v1
3 | kind: ServiceAccount
4 | metadata:
5 | name: {{ include "questdb.serviceAccountName" . }}
6 | {{- if .Values.serviceAccount.labels }}
7 | labels:
8 | {{ toYaml .Values.serviceAccount.labels | nindent 6 }}
9 | {{- end }}
10 | {{- if .Values.serviceAccount.annotations }}
11 | annotations:
12 | {{ toYaml .Values.serviceAccount.annotations | nindent 6 }}
13 | {{- end }}
14 | {{- end }}
15 |
--------------------------------------------------------------------------------
/charts/questdb/templates/statefulset.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: StatefulSet
3 | metadata:
4 | name: {{ include "questdb.fullname" . }}
5 | labels:
6 | {{- include "questdb.labels" . | nindent 4 }}
7 | spec:
8 | # Not horizontally scalable yet, so pinning to 1
9 | replicas: 1
10 | selector:
11 | matchLabels:
12 | {{- include "questdb.selectorLabels" . | nindent 6 }}
13 | serviceName: "{{ include "questdb.fullname" . }}-headless"
14 | template:
15 | metadata:
16 | annotations:
17 | checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }}
18 | {{- with .Values.podAnnotations }}
19 | {{- toYaml . | nindent 8 }}
20 | {{- end }}
21 | labels:
22 | {{- include "questdb.selectorLabels" . | nindent 8 }}
23 | {{- if .Values.extraLabels }}
24 | {{ toYaml .Values.extraLabels | nindent 8 }}
25 | {{- end }}
26 | spec:
27 | {{- with .Values.imagePullSecrets }}
28 | imagePullSecrets:
29 | {{- toYaml . | nindent 8 }}
30 | {{- end }}
31 | securityContext:
32 | {{- toYaml .Values.podSecurityContext | nindent 8 }}
33 | {{- if or .Values.serviceAccount.create .Values.serviceAccount.name }}
34 | serviceAccountName: {{ include "questdb.serviceAccountName" . }}
35 | {{- end }}
36 | containers:
37 | - name: {{ .Chart.Name }}
38 | securityContext:
39 | {{- toYaml .Values.securityContext | nindent 12 }}
40 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
41 | imagePullPolicy: {{ .Values.image.pullPolicy }}
42 | env:
43 | {{- range $key, $value := .Values.questdb.env }}
44 | - name: {{ $key }}
45 | value: "{{ $value }}"
46 | {{- end }}
47 | {{- if .Values.questdb.envFrom }}
48 | envFrom:
49 | {{ toYaml .Values.questdb.envFrom | nindent 10 }}
50 | {{- end }}
51 | volumeMounts:
52 | - name: {{ include "questdb.fullname" . }}
53 | mountPath: {{ .Values.questdb.dataDir }}/db
54 | subPath: db/
55 | - name: {{ include "questdb.fullname" . }}
56 | mountPath: {{ .Values.questdb.dataDir }}/.checkpoint
57 | subPath: .checkpoint/
58 | - name: {{ include "questdb.fullname" . }}
59 | mountPath: {{ .Values.questdb.dataDir }}/snapshot
60 | subPath: snapshot/
61 | {{- if .Values.questdb.serverConfig.enabled }}
62 | - name: server-config
63 | mountPath: {{ .Values.questdb.dataDir }}/conf/server.conf
64 | subPath: server.conf
65 | {{- end }}
66 | {{- if .Values.questdb.loggingConfig.enabled }}
67 | - name: logging-config
68 | mountPath: {{ .Values.questdb.dataDir }}/conf/log.conf
69 | subPath: log.conf
70 | {{- end }}
71 | {{- if .Values.extraVolumeMounts }}
72 | {{ toYaml .Values.extraVolumeMounts | nindent 10 }}
73 | {{- end }}
74 | ports:
75 | - name: http
76 | containerPort: 9000
77 | protocol: TCP
78 | - name: postgresql
79 | containerPort: 8812
80 | protocol: TCP
81 | - name: influxdb
82 | containerPort: 9009
83 | protocol: TCP
84 | {{- if .Values.metrics.enabled }}
85 | - name: metrics
86 | containerPort: {{ .Values.metrics.port }}
87 | protocol: TCP
88 | {{- end }}
89 | {{- if .Values.livenessProbe }}
90 | livenessProbe:
91 | {{- toYaml .Values.livenessProbe | nindent 12 }}
92 | {{- end }}
93 | {{- if .Values.readinessProbe }}
94 | readinessProbe:
95 | {{- toYaml .Values.readinessProbe | nindent 12 }}
96 | {{- end }}
97 | resources:
98 | {{- toYaml .Values.resources | nindent 12 }}
99 | {{- if .Values.sidecars }}
100 | {{- toYaml .Values.sidecars | nindent 8 }}
101 | {{- end }}
102 | initContainers:
103 | - name: init-db-migration
104 | image: "{{ .Values.dataMigration.image.repository }}:{{ .Values.dataMigration.image.tag }}"
105 | command: ["bash", "/mnt/migration_scripts/migrate_to_helm_v1.sh"]
106 | volumeMounts:
107 | - name: {{ include "questdb.fullname" . }}
108 | mountPath: /mnt/questdb
109 | - name: migration-scripts
110 | mountPath: /mnt/migration_scripts
111 | {{- if .Values.dataMigration.resources }}
112 | resources:
113 | {{- toYaml .Values.dataMigration.resources | nindent 12}}
114 | {{- end }}
115 | {{- if .Values.initContainers }}
116 | {{- toYaml .Values.initContainers | nindent 8 }}
117 | {{- end }}
118 | {{- with .Values.nodeSelector }}
119 | nodeSelector:
120 | {{- toYaml . | nindent 8 }}
121 | {{- end }}
122 | {{- with .Values.affinity }}
123 | affinity:
124 | {{- toYaml . | nindent 8 }}
125 | {{- end }}
126 | {{- with .Values.tolerations }}
127 | tolerations:
128 | {{- toYaml . | nindent 8 }}
129 | {{- end }}
130 | volumes:
131 | {{- if .Values.questdb.serverConfig.enabled }}
132 | - name: server-config
133 | {{- if eq .Values.questdb.configStorageType "Secret" }}
134 | secret:
135 | secretName: {{ include "questdb.fullname" . }}
136 | {{- else }}
137 | configMap:
138 | name: {{ include "questdb.fullname" . }}
139 | {{- end }}
140 | {{- end }}
141 | {{- if .Values.questdb.loggingConfig.enabled }}
142 | - name: logging-config
143 | {{- if eq .Values.questdb.configStorageType "Secret" }}
144 | secret:
145 | secretName: {{ include "questdb.fullname" . }}
146 | {{- else }}
147 | configMap:
148 | name: {{ include "questdb.fullname" . }}
149 | {{- end }}
150 | {{- end }}
151 | - name: migration-scripts
152 | configMap:
153 | name: {{ include "questdb.fullname" . }}-db-migrations
154 | {{- if .Values.extraVolumes }}
155 | {{ toYaml .Values.extraVolumes | nindent 8 }}
156 | {{- end }}
157 | {{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
158 | - name: {{ include "questdb.fullname" . }}
159 | persistentVolumeClaim:
160 | claimName: {{ tpl .Values.persistence.existingClaim $ }}
161 | {{- else if not .Values.persistence.enabled }}
162 | - name: {{ include "questdb.fullname" . }}
163 | emptyDir: {}
164 | {{- else }}
165 | volumeClaimTemplates:
166 | - metadata:
167 | name: {{ include "questdb.fullname" . }}
168 | annotations:
169 | {{- range $key, $value := .Values.persistence.annotations }}
170 | {{ $key }}: "{{ $value }}"
171 | {{- end }}
172 | spec:
173 | accessModes:
174 | - {{ .Values.persistence.accessMode | quote}}
175 | resources:
176 | requests:
177 | storage: {{ .Values.persistence.size | quote }}
178 | {{- if .Values.persistence.storageClass }}
179 | {{- if (eq "-" .Values.persistence.storageClass) }}
180 | storageClassName: ""
181 | {{- else }}
182 | storageClassName: "{{ .Values.persistence.storageClass }}"
183 | {{- end }}
184 | {{- end }}
185 | {{- end }}
186 |
--------------------------------------------------------------------------------
/charts/questdb/templates/tests/test-connection.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Pod
3 | metadata:
4 | name: "{{ include "questdb.fullname" . }}-test-connection"
5 | labels:
6 | {{- include "questdb.labels" . | nindent 4 }}
7 | annotations:
8 | "helm.sh/hook": test-success
9 | spec:
10 | containers:
11 | - name: curl
12 | image: curlimages/curl:7.71.0
13 | command: ['curl']
14 | args: ['-G', '{{ include "questdb.fullname" . }}:{{ .Values.service.port }}', '--data-urlencode', 'query="SHOW TABLES;"']
15 | restartPolicy: Never
16 |
--------------------------------------------------------------------------------
/charts/questdb/values.yaml:
--------------------------------------------------------------------------------
1 | image:
2 | repository: questdb/questdb
3 | pullPolicy: IfNotPresent
4 | tag: 8.3.3
5 |
6 | imagePullSecrets: []
7 | nameOverride: ""
8 | fullnameOverride: ""
9 |
10 | podAnnotations: {}
11 | podSecurityContext: {}
12 | securityContext: {}
13 | extraVolumes: []
14 | extraVolumeMounts: []
15 | extraLabels: {}
16 |
17 | questdb:
18 | dataDir: /var/lib/questdb
19 | configStorageType: ConfigMap
20 | serverConfig:
21 | enabled: false
22 | options: {}
23 | loggingConfig:
24 | enabled: false
25 | options: {}
26 | # env supports key/value pairs that are added directly to the questdb statefulset's env
27 | env: {}
28 | # envFrom supports a list of sources that will be injected into the questdb statefulset's env
29 | envFrom: []
30 |
31 | service:
32 | annotations: {}
33 | type: ClusterIP
34 | port: 9000
35 | expose:
36 | postgresql:
37 | enabled: false
38 | port: 8812
39 | influxdb:
40 | enabled: false
41 | port: 9009
42 |
43 | persistence:
44 | enabled: true
45 | accessMode: ReadWriteOnce
46 | size: 50Gi
47 | annotations: {}
48 | # Uncomment storageClass if you want to use a specific Storage Class
49 | # storageClass: STORAGE_CLASS_NAME_HERE
50 | # Uncomment existingClaim to enable existing pvc to be mounted for db storage
51 | # size and accessMode will be ignored
52 | # existing pvc needs to be in the namespace where questdb will be deployed
53 | # if you have problems with aws availability zones use nodeSelector to schedule nodes in the same az as volume
54 | # existingClaim: PVC_NAME_HERE
55 |
56 | ingress:
57 | enabled: false
58 | annotations: {}
59 | # tls:
60 | # - hosts:
61 | # - example.com
62 | # secretName: questdb-certificate
63 | # ingressClassName: nginx
64 | # hosts:
65 | # - host: example.com
66 | # paths:
67 | # - path: /
68 | # pathType: ImplementationSpecific
69 |
70 | resources: {}
71 | nodeSelector: {}
72 | tolerations: []
73 | affinity: {}
74 | readinessProbe: {}
75 | # Example of readinessProbe
76 | # failureThreshold: 3
77 | # httpGet:
78 | # path: /status
79 | # port: 9003
80 | # scheme: HTTP
81 | # initialDelaySeconds: 5
82 | # periodSeconds: 10
83 | # successThreshold: 1
84 | # timeoutSeconds: 2
85 | livenessProbe: {}
86 | # Example of livenessProbe
87 | # failureThreshold: 5
88 | # httpGet:
89 | # path: /status
90 | # port: 9003
91 | # scheme: HTTP
92 | # initialDelaySeconds: 5
93 | # periodSeconds: 10
94 | # successThreshold: 1
95 | # timeoutSeconds: 2
96 |
97 |
98 | metrics:
99 | enabled: true
100 | port: 9003
101 |
102 | initContainers: []
103 | sidecars: []
104 |
105 | serviceAccount:
106 | create: false
107 | labels: {}
108 | annotations: {}
109 |
110 | # if create is set to "true", you can specify the name of that service account below
111 | # if create is set to "false", you can use this to reference an existing service account for the StatefulSet pod
112 | # name: custom-service-account-name
113 |
114 | dataMigration:
115 | image:
116 | repository: debian
117 | pullPolicy: IfNotPresent
118 | tag: 12.10-slim
119 | resources:
120 | requests:
121 | memory: "256Mi"
122 | limits:
123 | memory: "1Gi"
124 |
--------------------------------------------------------------------------------