diff --git a/.github/chart-test.yaml b/.github/chart-test.yaml index 2772345..87389c9 100644 --- a/.github/chart-test.yaml +++ b/.github/chart-test.yaml @@ -3,3 +3,4 @@ chart-dirs: charts: - charts/greptimedb-operator - charts/greptimedb + - charts/greptimedb-standalone diff --git a/charts/greptimedb-standalone/README.md b/charts/greptimedb-standalone/README.md new file mode 100644 index 0000000..0165628 --- /dev/null +++ b/charts/greptimedb-standalone/README.md @@ -0,0 +1,20 @@ +# Overview + +Helm chart for [GreptimeDB](https://github.com/GreptimeTeam/greptimedb) standalone mode. + +## How to install + +```console +# Add charts repo. +helm repo add greptime https://greptimeteam.github.io/helm-charts/ +helm repo update + +# Install greptimedb in default namespace. +helm install greptimedb greptime/greptimedb-standalone -n default --devel +``` + +## How to uninstall + +```console +helm uninstall greptimedb -n default +``` diff --git a/charts/greptimedb-standalone/templates/service.yaml b/charts/greptimedb-standalone/templates/service.yaml index 09ac8d0..4068018 100644 --- a/charts/greptimedb-standalone/templates/service.yaml +++ b/charts/greptimedb-standalone/templates/service.yaml @@ -12,24 +12,24 @@ spec: type: {{ .Values.service.type }} ports: - name: http - port: 4000 - targetPort: 4000 + port: {{ .Values.httpPort }} + targetPort: {{ .Values.httpPort }} protocol: TCP - name: grpc - port: 4001 - targetPort: 4001 + port: {{ .Values.grpcPort }} + targetPort: {{ .Values.grpcPort }} protocol: TCP - name: mysql - port: 4002 - targetPort: 4002 + port: {{ .Values.mysqlPort }} + targetPort: {{ .Values.mysqlPort }} protocol: TCP - name: postgres - port: 4003 - targetPort: 4003 + port: {{ .Values.postgresPort }} + targetPort: {{ .Values.postgresPort }} protocol: TCP - name: prom - port: 4004 - targetPort: 4004 + port: {{ .Values.promPort }} + targetPort: {{ .Values.promPort }} protocol: TCP selector: {{- include "greptimedb.selectorLabels" . | nindent 4 }} diff --git a/charts/greptimedb-standalone/templates/statefulset.yaml b/charts/greptimedb-standalone/templates/statefulset.yaml index 1c73867..513aad4 100644 --- a/charts/greptimedb-standalone/templates/statefulset.yaml +++ b/charts/greptimedb-standalone/templates/statefulset.yaml @@ -62,24 +62,27 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} ports: - - containerPort: 4000 + - containerPort: {{ .Values.httpPort }} name: http protocol: TCP - - containerPort: 4001 + - containerPort: {{ .Values.grpcPort }} name: grpc protocol: TCP - - containerPort: 4002 + - containerPort: {{ .Values.mysqlPort }} name: mysql protocol: TCP - - containerPort: 4003 + - containerPort: {{ .Values.postgresPort }} name: postgres protocol: TCP - - containerPort: 4004 + - containerPort: {{ .Values.promPort }} name: prom protocol: TCP - {{- with .Values.env }} + {{- if .Values.env }} env: - {{- toYaml . | nindent 12 }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val | quote }} + {{- end }} {{- end }} {{- with .Values.envFrom }} envFrom: @@ -91,7 +94,7 @@ spec: {{- end }} volumeMounts: - name: data - mountPath: /data + mountPath: /tmp/greptimedb {{- with .Values.resources }} resources: {{- toYaml . | nindent 12 }} diff --git a/charts/greptimedb-standalone/values.yaml b/charts/greptimedb-standalone/values.yaml index 807c665..4ed3adf 100644 --- a/charts/greptimedb-standalone/values.yaml +++ b/charts/greptimedb-standalone/values.yaml @@ -24,43 +24,44 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: "" -# Command to execute instead of defined in Docker image command: [ "greptime", "standalone", "start" ] -# Additional cli args args: [] -# Environment variables -env: [] -# GREPTIMEDB_STANDALONE__HTTP_OPTIONS__ADDR: "0.0.0.0:4000" -# GREPTIMEDB_STANDALONE__HTTP_OPTIONS__TIMEOUT: "120s" -# GREPTIMEDB_STANDALONE__PROM_OPTIONS__ADDR: "0.0.0.0:4004" +env: + GREPTIMEDB_STANDALONE__HTTP_OPTIONS__ADDR: "0.0.0.0:4000" + GREPTIMEDB_STANDALONE__HTTP_OPTIONS__TIMEOUT: "120s" + GREPTIMEDB_STANDALONE__PROM_OPTIONS__ADDR: "0.0.0.0:4004" + # GREPTIMEDB_STANDALONE__WAL__FILE_SIZE: "128MB" # GREPTIMEDB_STANDALONE__WAL__PURGE_THRESHOLD: "2GB" +# # GREPTIMEDB_STANDALONE__STORAGE__TYPE: "File" # # Temporary put this in another directory to clear the database's data. # GREPTIMEDB_STANDALONE__STORAGE__DATA_HOME: "/tmp/greptimedb/data" +# # # GREPTIMEDB_STANDALONE__STORAGE__TYPE: "S3" # # GREPTIMEDB_STANDALONE__STORAGE__BUCKET: "bucket-name" # # GREPTIMEDB_STANDALONE__STORAGE__ROOT: "/data" # # GREPTIMEDB_STANDALONE__STORAGE__REGION: "ap-southeast-1" +# # GREPTIMEDB_STANDALONE__STORAGE__CACHE_PATH: "/tmp/greptimedb/s3cache" +# GREPTIMEDB_DATANODE__WAL__DIR: "/tmp/greptimedb/wal" # GREPTIMEDB_STANDALONE__STORAGE__GLOBAL_TTL: "1d" # GREPTIMEDB_STANDALONE__STORAGE__MANIFEST__CHECKPOINT_ON_STARTUP: "true" -# # GREPTIMEDB_STANDALONE__STORAGE__FLUSH__REGION_WRITE_BUFFER_SIZE: "256MB" -# # GREPTIMEDB_STANDALONE__STORAGE__FLUSH__REGION_WRITE_BUFFER_SIZE: "1MB" # GREPTIMEDB_STANDALONE__STORAGE__FLUSH__GLOBAL_WRITE_BUFFER_SIZE: "512MB" -# # GREPTIMEDB_STANDALONE__STORAGE__FLUSH__GLOBAL_WRITE_BUFFER_SIZE: "300MB" -# # GREPTIMEDB_STANDALONE__STORAGE__FLUSH__GLOBAL_WRITE_BUFFER_SIZE: "100MB" +# # GREPTIMEDB_STANDALONE__STORAGE__FLUSH__REGION_WRITE_BUFFER_SIZE: "256MB" # # GREPTIMEDB_STANDALONE__STORAGE__FLUSH__AUTO_FLUSH_INTERVAL: "5m" # # GREPTIMEDB_STANDALONE__STORAGE__FLUSH__MAX_FLUSH_TASKS: "2" # # GREPTIMEDB_STANDALONE__STORAGE__COMPACTION__MAX_INFLIGHT_TASKS: "2" # MALLOC_CONF: "prof:true" # # GREPTIMEDB_STANDALONE__STORAGE__SKIP_WAL: "true" +# # GREPTIMEDB_DATANODE__STORAGE__MANIFEST__CHECKPOINT_MARGIN: "100" +# # GREPTIMEDB_DATANODE__STORAGE__MANIFEST__GC_DURATION: "5m" + -# Environment variables envFrom: {} # - secretRef: # name: config @@ -153,14 +154,21 @@ persistence: selector: null monitoring: - enabled: false + enabled: true # PodMonitor annotations annotations: {} # PodMonitor labels - labels: {} + labels: + release: prometheus # PodMonitor scrape interval interval: 15s +httpPort: 4000 +grpcPort: 4001 +mysqlPort: 4002 +postgresPort: 4003 +promPort: 4004 + service: type: ClusterIP # Annotations for Service