Skip to content

Commit

Permalink
feat: add Azure Blob storage (#207)
Browse files Browse the repository at this point in the history
* feat: add Azure Blob storage

* chore: change name

* chore: update docs
  • Loading branch information
daviderli614 authored Nov 27, 2024
1 parent 2975ae6 commit d74366e
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 19 deletions.
4 changes: 2 additions & 2 deletions 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.35
version: 0.2.36
appVersion: 0.10.2
home: https://github.com/GreptimeTeam/greptimedb
sources:
Expand All @@ -11,7 +11,7 @@ keywords:
- database
- greptimedb
maintainers:
- name: daviderli614
- name: liyang
email: [email protected]
url: https://github.com/daviderli614
- name: zyy17
Expand Down
6 changes: 3 additions & 3 deletions 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.35](https://img.shields.io/badge/Version-0.2.35-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.10.2](https://img.shields.io/badge/AppVersion-0.10.2-informational?style=flat-square)
![Version: 0.2.36](https://img.shields.io/badge/Version-0.2.36-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.10.2](https://img.shields.io/badge/AppVersion-0.10.2-informational?style=flat-square)

## Source Code

Expand Down Expand Up @@ -224,7 +224,7 @@ helm uninstall mycluster -n default
| image.tag | string | `"v0.10.2"` | The image tag |
| initializer.registry | string | `"docker.io"` | Initializer image registry |
| initializer.repository | string | `"greptime/greptimedb-initializer"` | Initializer image repository |
| initializer.tag | string | `"v0.1.3-alpha.8"` | Initializer image tag |
| initializer.tag | string | `"v0.1.3"` | Initializer image tag |
| logging | object | `{"filters":[],"format":"text","level":"info","logsDir":"/data/greptimedb/logs","onlyLogToStdout":false,"persistentWithData":false,"slowQuery":{"enabled":false,"sampleRatio":"1.0","threshold":"10s"}}` | Global logging configuration |
| logging.filters | list | `[]` | The log filters, use the syntax of `target[span\{field=value\}]=level` to filter the logs. |
| logging.format | string | `"text"` | The log format for greptimedb, only support "json" and "text" |
Expand Down Expand Up @@ -277,7 +277,7 @@ helm uninstall mycluster -n default
| monitoring.vector.resources | object | `{"limits":{"cpu":"50m","memory":"64Mi"},"requests":{"cpu":"50m","memory":"64Mi"}}` | vector resource |
| monitoring.vector.tag | string | `"nightly-alpine"` | vector image tag |
| mysqlServicePort | int | `4002` | GreptimeDB mysql service port |
| objectStorage | object | `{"gcs":{},"oss":{},"s3":{}}` | Configure to object storage |
| objectStorage | object | `{"azblob":{},"gcs":{},"oss":{},"s3":{}}` | Configure to object storage |
| postgresServicePort | int | `4003` | GreptimeDB postgres service port |
| prometheusMonitor | object | `{"enabled":false,"interval":"30s","labels":{"release":"prometheus"}}` | Configure to prometheus PodMonitor |
| prometheusMonitor.enabled | bool | `false` | Create PodMonitor resource for scraping metrics using PrometheusOperator |
Expand Down
11 changes: 11 additions & 0 deletions charts/greptimedb-cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,17 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- else if .Values.objectStorage.azblob }}
azblob: {{- toYaml .Values.objectStorage.azblob | nindent 6 }}
{{- if .Values.objectStorage }}
{{- if .Values.objectStorage.credentials }}
{{- if .Values.objectStorage.credentials.existingSecretName }}
secretName: {{ .Values.objectStorage.credentials.existingSecretName }}
{{- else }}
secretName: {{ default "storage-credentials" .Values.objectStorage.credentials.secretName }}
{{- end }}
{{- end }}
{{- end }}
{{- else }}
{}
{{- end }}
Expand Down
10 changes: 10 additions & 0 deletions charts/greptimedb-cluster/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@ data:
service-account-key: {{ .Values.objectStorage.credentials.serviceAccountKey }}
{{- else }}
stringData:
{{- if .Values.objectStorage.credentials.accessKeyId }}
access-key-id: {{ .Values.objectStorage.credentials.accessKeyId }}
{{- end }}
{{- if .Values.objectStorage.credentials.secretAccessKey }}
secret-access-key: {{ .Values.objectStorage.credentials.secretAccessKey }}
{{- end }}
{{- if .Values.objectStorage.credentials.accountName }}
account-name: {{ .Values.objectStorage.credentials.accountName }}
{{- end }}
{{- if .Values.objectStorage.credentials.accountKey }}
account-key: {{ .Values.objectStorage.credentials.accountKey }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
12 changes: 11 additions & 1 deletion charts/greptimedb-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ initializer:
# -- Initializer image repository
repository: greptime/greptimedb-initializer
# -- Initializer image tag
tag: v0.1.3-alpha.8
tag: v0.1.3

base:
# -- The pod template for base
Expand Down Expand Up @@ -734,6 +734,10 @@ objectStorage:
# accessKeyId: "you-should-set-the-access-key-id-here"
# secretAccessKey: "you-should-set-the-secret-access-key-here"

# # Azure cloudProvider accountName and accountKey
# accountName: "you-should-set-the-account-name-here"
# accountKey: "you-should-set-the-account-key-here"

# # GCP cloudProvider serviceAccountKey JSON-formatted base64 value
# serviceAccountKey: "you-should-set-the-base64-service-account-key-here"

Expand Down Expand Up @@ -767,6 +771,12 @@ objectStorage:
# root: "mycluster"
# endpoint: "https://storage.googleapis.com"

# configure to use azblob storage
azblob: {}
# container: ""
# endpoint: ""
# root: "mycluster"

# -- Configure to remote wal
remoteWal:
# -- Enable remote wal
Expand Down
4 changes: 2 additions & 2 deletions charts/greptimedb-standalone/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: greptimedb-standalone
description: A Helm chart for deploying standalone greptimedb
type: application
version: 0.1.34
version: 0.1.35
appVersion: 0.10.2
home: https://github.com/GreptimeTeam/greptimedb
sources:
Expand All @@ -11,7 +11,7 @@ keywords:
- database
- greptimedb
maintainers:
- name: daviderli614
- name: liyang
email: [email protected]
url: https://github.com/daviderli614
- name: zyy17
Expand Down
4 changes: 2 additions & 2 deletions 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.34](https://img.shields.io/badge/Version-0.1.34-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.10.2](https://img.shields.io/badge/AppVersion-0.10.2-informational?style=flat-square)
![Version: 0.1.35](https://img.shields.io/badge/Version-0.1.35-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.10.2](https://img.shields.io/badge/AppVersion-0.10.2-informational?style=flat-square)

## Source Code
- https://github.com/GreptimeTeam/greptimedb
Expand Down Expand Up @@ -74,7 +74,7 @@ helm uninstall greptimedb-standalone -n default
| mysqlServicePort | int | `4002` | GreptimeDB mysql service port |
| nameOverride | string | `""` | Overrides the chart's name |
| nodeSelector | object | `{}` | NodeSelector to apply pod |
| objectStorage | object | `{"gcs":{},"oss":{},"s3":{}}` | Configure to object storage |
| objectStorage | object | `{"azblob":{},"gcs":{},"oss":{},"s3":{}}` | Configure to object storage |
| persistence.enableStatefulSetAutoDeletePVC | bool | `false` | Enable StatefulSetAutoDeletePVC feature |
| persistence.enabled | bool | `true` | Enable persistent disk |
| persistence.mountPath | string | `"/data/greptimedb"` | Mount path of persistent disk. |
Expand Down
26 changes: 21 additions & 5 deletions charts/greptimedb-standalone/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ Create the name of the service account to use
{{- end }}

{{- define "greptimedb-standalone.objectStorageConfig" -}}
{{- if or .Values.objectStorage.s3 .Values.objectStorage.oss .Values.objectStorage.gcs }}
{{- if or .Values.objectStorage.s3 .Values.objectStorage.oss .Values.objectStorage.gcs .Values.objectStorage.azblob }}
{{- $provider := "" }}
{{- $bucket := "" }}
{{- $root := "" }}
{{- $container := "" }}
{{- $cache_path := "" }}
{{- $cache_capacity := "" }}

Expand All @@ -87,26 +88,39 @@ Create the name of the service account to use
{{- $root = .Values.objectStorage.gcs.root }}
{{- $cache_path = .Values.objectStorage.gcs.cache_path }}
{{- $cache_capacity = .Values.objectStorage.gcs.cache_capacity }}
{{- else if .Values.objectStorage.azblob }}
{{- $provider = "Azblob" }}
{{- $container = .Values.objectStorage.azblob.container }}
{{- $root = .Values.objectStorage.azblob.root }}
{{- $cache_path = .Values.objectStorage.azblob.cache_path }}
{{- $cache_capacity = .Values.objectStorage.azblob.cache_capacity }}
{{- end }}

{{- if and $provider $bucket }}
{{- if $provider }}
[storage]
# Storage provider type: S3, Oss, or Gcs
# Storage provider type: S3, Oss, Azblob, or Gcs
type = "{{ $provider }}"

{{- if $bucket }}
# Bucket name in the storage provider
bucket = "{{ $bucket }}"
{{- end }}

{{- if $container }}
# The container name for the Azure blob
container = "{{ $container }}"
{{- end }}

# Root path within the bucket
root = "{{ $root }}"

# Cache path configuration
{{- if $cache_path }}
# Cache path configuration
cache_path = "{{ $cache_path }}"
{{- end }}

# The cache capacity
{{- if $cache_capacity }}
# The cache capacity
cache_capacity = "{{ $cache_capacity }}"
{{- end }}

Expand All @@ -119,6 +133,8 @@ Create the name of the service account to use
{{- else if .Values.objectStorage.gcs }}
endpoint = "{{ .Values.objectStorage.gcs.endpoint }}"
scope = "{{ .Values.objectStorage.gcs.scope }}"
{{- else if .Values.objectStorage.azblob }}
endpoint = "{{ .Values.objectStorage.azblob.endpoint }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down
16 changes: 12 additions & 4 deletions charts/greptimedb-standalone/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ data:
GREPTIMEDB_STANDALONE__STORAGE__CREDENTIAL: {{ .Values.objectStorage.credentials.serviceAccountKey | b64enc }}
{{- else }}
stringData:
{{- if .Values.objectStorage.s3}}
{{- if .Values.objectStorage.credentials.accessKeyId}}
GREPTIMEDB_STANDALONE__STORAGE__ACCESS_KEY_ID: {{ .Values.objectStorage.credentials.accessKeyId }}
{{- end }}
{{- if .Values.objectStorage.credentials.secretAccessKey}}
GREPTIMEDB_STANDALONE__STORAGE__SECRET_ACCESS_KEY: {{ .Values.objectStorage.credentials.secretAccessKey }}
{{ else if .Values.objectStorage.oss }}
GREPTIMEDB_STANDALONE__STORAGE__ACCESS_KEY_ID: {{ .Values.objectStorage.credentials.accessKeyId }}
{{- end }}
{{- if .Values.objectStorage.credentials.accessKeySecret}}
GREPTIMEDB_STANDALONE__STORAGE__ACCESS_KEY_SECRET: {{ .Values.objectStorage.credentials.accessKeySecret }}
{{- end }}
{{- end }}
{{- if .Values.objectStorage.credentials.accountName}}
GREPTIMEDB_STANDALONE__STORAGE__ACCOUNT_NAME: {{ .Values.objectStorage.credentials.accountName }}
{{- end }}
{{- if .Values.objectStorage.credentials.accountKey}}
GREPTIMEDB_STANDALONE__STORAGE__ACCOUNT_KEY: {{ .Values.objectStorage.credentials.accountKey }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
16 changes: 16 additions & 0 deletions charts/greptimedb-standalone/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ objectStorage:
# # AliCloud cloudProvider secretAccessKey
# accessKeySecret: "you-should-set-the-access-key-secret-here"

# # Azure cloudProvider accountName and accountKey
# accountName: "you-should-set-the-account-name-here"
# accountKey: "you-should-set-the-account-key-here"

# # GCP cloudProvider serviceAccountKey JSON-formatted base64 value
# serviceAccountKey: "you-should-set-the-base64-service-account-key-here"

Expand Down Expand Up @@ -102,6 +106,18 @@ objectStorage:
# The cache capacity
# cache_capacity = ""

# configure to use azblob storage
azblob: {}
# container: ""
# endpoint: ""
# root: "greptimedb-standalone"

# # Cache path configuration
# cache_path: ""

# The cache capacity
# cache_capacity = ""

# -- Environment variables
env:
GREPTIMEDB_STANDALONE__HTTP__ADDR: "0.0.0.0:4000"
Expand Down

0 comments on commit d74366e

Please sign in to comment.