Skip to content

Commit

Permalink
refactor: delete prometheus port
Browse files Browse the repository at this point in the history
  • Loading branch information
daviderli614 committed Oct 13, 2023
1 parent 08aae78 commit b8c989a
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 49 deletions.
2 changes: 1 addition & 1 deletion charts/greptimedb-standalone/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: greptimedb
name: greptimedb-standalone
description: A Helm chart for deploying standalone greptimedb.
type: application
version: 0.1.0-alpha.1
Expand Down
6 changes: 3 additions & 3 deletions charts/greptimedb-standalone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Helm chart for [GreptimeDB](https://github.com/GreptimeTeam/greptimedb) standalo
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
# Install greptimedb standalone in default namespace.
helm install greptimedb-standalone greptime/greptimedb-standalone -n default --devel
```

## How to uninstall

```console
helm uninstall greptimedb -n default
helm uninstall greptimedb-standalone -n default
```
20 changes: 10 additions & 10 deletions charts/greptimedb-standalone/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "greptimedb.name" -}}
{{- define "greptimedb-standalone.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ 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.fullname" -}}
{{- define "greptimedb-standalone.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "greptimedb.chart" -}}
{{- define "greptimedb-standalone.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "greptimedb.labels" -}}
helm.sh/chart: {{ include "greptimedb.chart" . }}
{{ include "greptimedb.selectorLabels" . }}
{{- 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 }}
Expand All @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "greptimedb.selectorLabels" -}}
app.kubernetes.io/name: {{ include "greptimedb.name" . }}
{{- 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.serviceAccountName" -}}
{{- define "greptimedb-standalone.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "greptimedb.fullname" .) .Values.serviceAccount.name }}
{{- default (include "greptimedb-standalone.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions charts/greptimedb-standalone/templates/podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "greptimedb.fullname" . }}
name: {{ include "greptimedb-standalone.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- with .Values.monitoring.labels }}
labels:
Expand All @@ -22,5 +22,5 @@ spec:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "greptimedb.selectorLabels" . | nindent 6 }}
{{- include "greptimedb-standalone.selectorLabels" . | nindent 6 }}
{{- end }}
10 changes: 3 additions & 7 deletions charts/greptimedb-standalone/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "greptimedb.fullname" . }}
name: {{ include "greptimedb-standalone.fullname" . }}
labels:
{{- include "greptimedb.labels" . | nindent 4 }}
{{- include "greptimedb-standalone.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -27,9 +27,5 @@ spec:
port: {{ .Values.postgresPort }}
targetPort: {{ .Values.postgresPort }}
protocol: TCP
- name: prom
port: {{ .Values.promPort }}
targetPort: {{ .Values.promPort }}
protocol: TCP
selector:
{{- include "greptimedb.selectorLabels" . | nindent 4 }}
{{- include "greptimedb-standalone.selectorLabels" . | nindent 4 }}
4 changes: 2 additions & 2 deletions charts/greptimedb-standalone/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "greptimedb.serviceAccountName" . }}
name: {{ include "greptimedb-standalone.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "greptimedb.labels" . | nindent 4 }}
{{- include "greptimedb-standalone.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
28 changes: 14 additions & 14 deletions charts/greptimedb-standalone/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "greptimedb.fullname" . }}
name: {{ include "greptimedb-standalone.fullname" . }}
namespace: {{ $.Release.Namespace }}
labels:
{{- include "greptimedb.labels" . | nindent 4 }}
{{- include "greptimedb-standalone.labels" . | nindent 4 }}
{{- if not (empty .Values.annotations) }}
annotations:
{{- with .Values.annotations }}
Expand All @@ -16,28 +16,28 @@ spec:
updateStrategy:
rollingUpdate:
partition: 0
serviceName: {{ include "greptimedb.fullname" . }}
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.selectorLabels" . | nindent 6 }}
{{- include "greptimedb-standalone.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "greptimedb.selectorLabels" . | nindent 8 }}
{{- include "greptimedb-standalone.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "greptimedb.serviceAccountName" . }}
serviceAccountName: {{ include "greptimedb-standalone.serviceAccountName" . }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
Expand All @@ -50,16 +50,19 @@ spec:
{{- end }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
containers:
- name: {{ include "greptimedb.fullname" . }}
- name: {{ include "greptimedb-standalone.fullname" . }}
image: {{ printf "%s/%s:%s" .Values.image.registry .Values.image.repository .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.command }}
command:
{{- toYaml . | nindent 10 }}
- greptime
- standalone
- start
{{- if .Values.command }}
{{- toYaml .Values.command | nindent 12 }}
{{- end }}
{{- with .Values.args }}
{{- if .Values.args }}
args:
{{- toYaml . | nindent 10 }}
{{- toYaml .Values.args | nindent 12 }}
{{- end }}
ports:
- containerPort: {{ .Values.httpPort }}
Expand All @@ -74,9 +77,6 @@ spec:
- containerPort: {{ .Values.postgresPort }}
name: postgres
protocol: TCP
- containerPort: {{ .Values.promPort }}
name: prom
protocol: TCP
{{- if .Values.env }}
env:
{{- range $key, $val := .Values.env }}
Expand Down
16 changes: 6 additions & 10 deletions charts/greptimedb-standalone/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name: ""

command: [
"greptime", "standalone", "start"
]
command: []

args: []

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__HTTP__ADDR: "0.0.0.0:4000"
GREPTIMEDB_STANDALONE__HTTP__TIMEOUT: "120s"
# GREPTIMEDB_STANDALONE__PROM_OPTIONS__ADDR: "0.0.0.0:4004"

# GREPTIMEDB_STANDALONE__WAL__FILE_SIZE: "128MB"
# GREPTIMEDB_STANDALONE__WAL__PURGE_THRESHOLD: "2GB"
Expand Down Expand Up @@ -154,20 +152,18 @@ persistence:
selector: null

monitoring:
enabled: true
enabled: false
# PodMonitor annotations
annotations: {}
# PodMonitor labels
labels:
release: prometheus
labels: {}
# PodMonitor scrape interval
interval: 15s

httpPort: 4000
grpcPort: 4001
mysqlPort: 4002
postgresPort: 4003
promPort: 4004

service:
type: ClusterIP
Expand Down

0 comments on commit b8c989a

Please sign in to comment.