-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add greptimedb standalone chart (#66)
* feat: add greptimedb standalone chart * refactor: use statefulset deploy greptimedb * feat: add more values * chore: ready for review * chore: default disable monitoring * feat: add readme * refactor: delete prometheus port * refactor: greptimedb standalone storage configure * refactor: use greptimedb config default values
- Loading branch information
1 parent
5fbf1e1
commit bda9e4e
Showing
10 changed files
with
489 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ chart-dirs: | |
charts: | ||
- charts/greptimedb-operator | ||
- charts/greptimedb | ||
- charts/greptimedb-standalone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v2 | ||
name: greptimedb-standalone | ||
description: A Helm chart for deploying standalone greptimedb. | ||
type: application | ||
version: 0.1.0-alpha.1 | ||
appVersion: 0.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 standalone in default namespace. | ||
helm install greptimedb-standalone greptime/greptimedb-standalone -n default --devel | ||
``` | ||
|
||
## How to uninstall | ||
|
||
```console | ||
helm uninstall greptimedb-standalone -n default | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "greptimedb-standalone.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "greptimedb-standalone.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "greptimedb-standalone.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "greptimedb-standalone.labels" -}} | ||
helm.sh/chart: {{ include "greptimedb-standalone.chart" . }} | ||
{{ include "greptimedb-standalone.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "greptimedb-standalone.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "greptimedb-standalone.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "greptimedb-standalone.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "greptimedb-standalone.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{{- if .Values.monitoring.enabled }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PodMonitor | ||
metadata: | ||
name: {{ include "greptimedb-standalone.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
{{- with .Values.monitoring.labels }} | ||
labels: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.monitoring.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
podMetricsEndpoints: | ||
- interval: {{ .Values.monitoring.interval }} | ||
port: http | ||
path: /metrics | ||
namespaceSelector: | ||
matchNames: | ||
- {{ .Release.Namespace }} | ||
selector: | ||
matchLabels: | ||
{{- include "greptimedb-standalone.selectorLabels" . | nindent 6 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "greptimedb-standalone.fullname" . }} | ||
labels: | ||
{{- include "greptimedb-standalone.labels" . | nindent 4 }} | ||
{{- with .Values.service.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- name: http | ||
port: {{ .Values.httpPort }} | ||
targetPort: {{ .Values.httpPort }} | ||
protocol: TCP | ||
- name: grpc | ||
port: {{ .Values.grpcPort }} | ||
targetPort: {{ .Values.grpcPort }} | ||
protocol: TCP | ||
- name: mysql | ||
port: {{ .Values.mysqlPort }} | ||
targetPort: {{ .Values.mysqlPort }} | ||
protocol: TCP | ||
- name: postgres | ||
port: {{ .Values.postgresPort }} | ||
targetPort: {{ .Values.postgresPort }} | ||
protocol: TCP | ||
selector: | ||
{{- include "greptimedb-standalone.selectorLabels" . | nindent 4 }} |
13 changes: 13 additions & 0 deletions
13
charts/greptimedb-standalone/templates/serviceaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- if .Values.serviceAccount.create -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "greptimedb-standalone.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "greptimedb-standalone.labels" . | nindent 4 }} | ||
{{- with .Values.serviceAccount.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} |
137 changes: 137 additions & 0 deletions
137
charts/greptimedb-standalone/templates/statefulset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ include "greptimedb-standalone.fullname" . }} | ||
namespace: {{ $.Release.Namespace }} | ||
labels: | ||
{{- include "greptimedb-standalone.labels" . | nindent 4 }} | ||
{{- if not (empty .Values.annotations) }} | ||
annotations: | ||
{{- with .Values.annotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
replicas: 1 | ||
updateStrategy: | ||
rollingUpdate: | ||
partition: 0 | ||
serviceName: {{ include "greptimedb-standalone.fullname" . }} | ||
{{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.persistence.enableStatefulSetAutoDeletePVC) (.Values.persistence.enabled) }} | ||
persistentVolumeClaimRetentionPolicy: | ||
whenDeleted: Delete | ||
whenScaled: Delete | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "greptimedb-standalone.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
{{- with .Values.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "greptimedb-standalone.selectorLabels" . | nindent 8 }} | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ include "greptimedb-standalone.serviceAccountName" . }} | ||
{{- if .Values.image.pullSecrets }} | ||
imagePullSecrets: | ||
{{- range .Values.image.pullSecrets }} | ||
- name: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if .Values.securityContext }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 8 }} | ||
{{- end }} | ||
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} | ||
containers: | ||
- name: {{ include "greptimedb-standalone.fullname" . }} | ||
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 }} | ||
{{- end }} | ||
{{- if .Values.args }} | ||
args: | ||
{{- toYaml .Values.args | nindent 12 }} | ||
{{- end }} | ||
ports: | ||
- containerPort: {{ .Values.httpPort }} | ||
name: http | ||
protocol: TCP | ||
- containerPort: {{ .Values.grpcPort }} | ||
name: grpc | ||
protocol: TCP | ||
- containerPort: {{ .Values.mysqlPort }} | ||
name: mysql | ||
protocol: TCP | ||
- containerPort: {{ .Values.postgresPort }} | ||
name: postgres | ||
protocol: TCP | ||
{{- if .Values.env }} | ||
env: | ||
{{- range $key, $val := .Values.env }} | ||
- name: {{ $key }} | ||
value: {{ $val | quote }} | ||
{{- end }} | ||
{{- end }} | ||
{{- with .Values.envFrom }} | ||
envFrom: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.podSecurityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
volumeMounts: | ||
- name: data | ||
mountPath: /tmp/greptimedb | ||
{{- with .Values.resources }} | ||
resources: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.dnsConfig }} | ||
dnsConfig: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.persistence.enabled }} | ||
volumeClaimTemplates: | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: data | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
{{- with .Values.persistence.storageClass }} | ||
storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }} | ||
{{- end }} | ||
resources: | ||
requests: | ||
storage: {{ .Values.persistence.size | quote }} | ||
{{- with .Values.persistence.selector }} | ||
selector: | ||
{{- toYaml . | nindent 10 }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.