Skip to content

Commit

Permalink
refactor: support to pass config file and refactor some fields (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy17 authored Nov 3, 2023
1 parent b25e8a1 commit 4f25a70
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/greptimedb-standalone/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: greptimedb-standalone
description: A Helm chart for deploying standalone greptimedb
type: application
version: 0.1.3
version: 0.1.4
appVersion: 0.4.2
4 changes: 3 additions & 1 deletion charts/greptimedb-standalone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A Helm chart for deploying standalone greptimedb

![Version: 0.1.3](https://img.shields.io/badge/Version-0.1.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.4.2](https://img.shields.io/badge/AppVersion-0.4.2-informational?style=flat-square)
![Version: 0.1.4](https://img.shields.io/badge/Version-0.1.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.4.2](https://img.shields.io/badge/AppVersion-0.4.2-informational?style=flat-square)

## Source Code
- https://github.com/GreptimeTeam/greptimedb
Expand Down Expand Up @@ -32,6 +32,7 @@ helm uninstall greptimedb-standalone -n default
| annotations | object | `{}` | The annotations |
| args | list | `[]` | The container args |
| command | list | `[]` | The container command |
| configToml | string | `"mode = 'standalone'\n"` | The extra configuration for greptimedb. |
| dnsConfig | object | `{}` | DNS configuration for pod |
| env | object | `{"GREPTIMEDB_STANDALONE__HTTP__ADDR":"0.0.0.0:4000"}` | Environment variables |
| envFrom | object | `{}` | Maps all the keys on a configmap or secret as environment variables |
Expand All @@ -53,6 +54,7 @@ helm uninstall greptimedb-standalone -n default
| opentsdbServicePort | int | `4242` | GreptimeDB opentsdb service port |
| persistence.enableStatefulSetAutoDeletePVC | bool | `false` | Enable StatefulSetAutoDeletePVC feature |
| persistence.enabled | bool | `true` | Enable persistent disk |
| persistence.mountPath | string | `"/data/greptimedb"` | Mount path of persistent disk. |
| persistence.selector | string | `nil` | Selector for persistent disk |
| persistence.size | string | `"10Gi"` | Size of persistent disk |
| persistence.storageClass | string | `nil` | Storage class name |
Expand Down
10 changes: 10 additions & 0 deletions charts/greptimedb-standalone/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if .Values.configToml -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-config
namespace: {{ .Release.Namespace }}
data:
config.toml: |
{{ .Values.configToml | indent 4 }}
{{- end -}}
26 changes: 21 additions & 5 deletions charts/greptimedb-standalone/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,19 @@ spec:
image: {{ printf "%s/%s:%s" .Values.image.registry .Values.image.repository .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- greptime
- standalone
- start
{{- if .Values.command }}
{{- toYaml .Values.command | nindent 12 }}
{{- else }}
- "greptime"
- "standalone"
- "start"
{{- end }}
{{- if .Values.args }}
args:
{{- if .Values.configToml }}
- "--config-file"
- "/etc/greptimedb/config.toml"
{{- end }}
{{- if .Values.args }}
{{- toYaml .Values.args | nindent 12 }}
{{- end }}
ports:
Expand Down Expand Up @@ -97,11 +102,22 @@ spec:
{{- end }}
volumeMounts:
- name: data
mountPath: /tmp/greptimedb
mountPath: {{ .Values.persistence.mountPath }}
{{- if .Values.configToml }}
- name: config
mountPath: /etc/greptimedb
readOnly: true
{{- end }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.configToml }}
volumes:
- name: config
configMap:
name: {{ .Release.Name }}-config
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
Expand Down
7 changes: 6 additions & 1 deletion charts/greptimedb-standalone/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ command: []
# -- The container args
args: []

# -- The extra configuration for greptimedb.
configToml: |
mode = 'standalone'
# -- Environment variables
env:
GREPTIMEDB_STANDALONE__HTTP__ADDR: "0.0.0.0:4000"
Expand Down Expand Up @@ -147,7 +151,6 @@ dnsConfig: {}
# -- Grace period to allow the single binary to shutdown before it is killed
terminationGracePeriodSeconds: 30


persistence:
# -- Enable persistent disk
enabled: true
Expand All @@ -159,6 +162,8 @@ persistence:
storageClass: null
# -- Selector for persistent disk
selector: null
# -- Mount path of persistent disk.
mountPath: /data/greptimedb

monitoring:
# -- Enable prometheus podmonitor
Expand Down

0 comments on commit 4f25a70

Please sign in to comment.