Skip to content

Commit

Permalink
refactor: add static auth configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy17 committed Aug 14, 2024
1 parent 11e1df1 commit ea2ab3b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/greptimedb-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: greptimedb-cluster
description: A Helm chart for deploying GreptimeDB cluster in Kubernetes.
type: application
version: 0.2.6
version: 0.2.7
appVersion: 0.9.1
home: https://github.com/GreptimeTeam/greptimedb
sources:
Expand Down
6 changes: 5 additions & 1 deletion charts/greptimedb-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A Helm chart for deploying GreptimeDB cluster in Kubernetes.

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

## Source Code

Expand Down Expand Up @@ -73,6 +73,10 @@ helm uninstall mycluster -n default

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| auth | object | `{"enabled":false,"password":"admin","username":"admin"}` | The static auth for greptimedb, only support one user now(https://docs.greptime.com/user-guide/clients/authentication#authentication). |
| auth.enabled | bool | `false` | Enable static auth |
| auth.password | string | `"admin"` | The static auth password |
| auth.username | string | `"admin"` | The static auth username |
| base.podTemplate | object | `{"affinity":{},"annotations":{},"labels":{},"main":{"args":[],"command":[],"env":[],"readinessProbe":{},"resources":{"limits":{},"requests":{}}},"nodeSelector":{},"serviceAccountName":"","tolerations":[]}` | The pod template for base |
| base.podTemplate.affinity | object | `{}` | The pod affinity |
| base.podTemplate.annotations | object | `{}` | The annotations to be created to the pod. |
Expand Down
9 changes: 8 additions & 1 deletion charts/greptimedb-cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,15 @@ spec:
{{- if .Values.frontend.podTemplate.main.args }}
args: {{ .Values.frontend.podTemplate.main.args | toYaml | nindent 8 }}
{{- end }}
{{- if or .Values.auth.enabled .Values.frontend.podTemplate.main.env }}
env:
{{- if .Values.auth.enabled }}
- name: GREPTIMEDB_FRONTEND__USER_PROVIDER
value: "static_user_provider:cmd:{{.Values.auth.username}}={{.Values.auth.password}}"
{{- end }}
{{- if .Values.frontend.podTemplate.main.env }}
env: {{- toYaml .Values.frontend.podTemplate.main.env | nindent 8 }}
{{- toYaml .Values.frontend.podTemplate.main.env | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.frontend.podTemplate.main.volumeMounts }}
volumeMounts: {{- toYaml .Values.frontend.podTemplate.main.volumeMounts | nindent 8 }}
Expand Down
9 changes: 9 additions & 0 deletions charts/greptimedb-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -443,3 +443,12 @@ remoteWal:
kafka:
# -- The kafka broker endpoints
brokerEndpoints: []

# -- The static auth for greptimedb, only support one user now(https://docs.greptime.com/user-guide/clients/authentication#authentication).
auth:
# -- Enable static auth
enabled: false
# -- The static auth username
username: admin
# -- The static auth password
password: admin

0 comments on commit ea2ab3b

Please sign in to comment.