Skip to content

Commit

Permalink
refactor: use the rqlite helm chart (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
g1eny0ung authored Apr 8, 2024
1 parent 0f7ead2 commit c373ab7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 26 deletions.
6 changes: 6 additions & 0 deletions charts/hstreamdb/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: rqlite
repository: https://rqlite.github.io/helm-charts
version: 1.7.0
digest: sha256:154165408ed6ee455f9bd7b0c29dfadf613b31e24c5c1178b2f9d4e47fa12d43
generated: "2024-04-03T16:44:36.635842+08:00"
5 changes: 5 additions & 0 deletions charts/hstreamdb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ version: 0.3.0
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "latest"

dependencies:
- name: rqlite
version: "^1.7.0"
repository: https://rqlite.github.io/helm-charts
Binary file added charts/hstreamdb/charts/rqlite-1.7.0.tgz
Binary file not shown.
16 changes: 5 additions & 11 deletions charts/hstreamdb/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,16 @@ Below are custom templates for hstreamdb.
Create volumeClaimTemplate for hstore.
*/}}
{{- define "hstreamdb.hstore.volumeClaimTemplate" -}}
{{- $globalStorageClassName := default "standard" .Values.storageClassName }}
{{- if .Values.storageClassName }}
spec:
storageClassName: {{ print $globalStorageClassName }}
storageClassName: {{ .Values.storageClassName }}
resources:
requests:
storage: {{ .Values.hstore.storage }}
{{- end }}

{{/*
Create volumeClaimTemplate for hmeta.
*/}}
{{- define "hstreamdb.hmeta.volumeClaimTemplate" -}}
{{- $globalStorageClassName := default "standard" .Values.storageClassName }}
{{- else }}
spec:
storageClassName: {{ print $globalStorageClassName }}
resources:
requests:
storage: {{ .Values.hmeta.storage }}
storage: {{ .Values.hstore.storage }}
{{- end }}
{{- end }}
11 changes: 4 additions & 7 deletions charts/hstreamdb/templates/hstreamdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ spec:
{{- with .Values.clusterConfig }}
{{- toYaml . | nindent 4 }}
{{- end }}
rqlite:
host: {{ include "hstreamdb.fullname" . }}-{{ .Values.rqlite.nameOverride }}
port: {{ default 80 .Values.rqlite.service.port }}
namespace: {{ .Release.Namespace | quote }}
hserver:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
Expand Down Expand Up @@ -53,13 +57,6 @@ spec:
{{- if .Values.adminServer.container }}
{{- toYaml .Values.adminServer.container | nindent 6 }}
{{- end }}
hmeta:
image: rqlite/rqlite:{{ .Values.hmeta.rqlite.version }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
replicas: {{ .Values.hmeta.replicaCount }}
container:
name: {{ .Values.hmeta.name }}
volumeClaimTemplate: {{ include "hstreamdb.hmeta.volumeClaimTemplate" . | indent 6 }}
{{- if .Values.console.enabled }}
console:
image: {{ .Values.console.image }}
Expand Down
15 changes: 7 additions & 8 deletions charts/hstreamdb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ hserver:
replicaCount: 3
container:

storageClassName: "standard"
storageClassName:

hstore:
# Name of the hstore component.
Expand All @@ -47,14 +47,13 @@ adminServer:
replicaCount: 1
container:

hmeta:
# Name of the hmeta component.
name: hmeta
rqlite:
# Override the name of the rqlite component to prevent potential conflicts.
# You don't need to change this value in most cases.
nameOverride: internal-rqlite
replicaCount: 3
# Storage size for PVC requests. Must be set.
storage: 1Gi
rqlite:
version: 7.21.4
persistence:
size: 1Gi

console:
enabled: false
Expand Down
2 changes: 2 additions & 0 deletions examples/kafka-mode/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
clusterConfig:
kafkaMode: true

0 comments on commit c373ab7

Please sign in to comment.