Skip to content

Commit

Permalink
chore: upgrade risingwave addon to v1.0 API (#1195)
Browse files Browse the repository at this point in the history
Co-authored-by: Y-Rookie <[email protected]>
  • Loading branch information
Y-Rookie and Y-Rookie authored Nov 14, 2024
1 parent 466d4c1 commit 53cfd20
Show file tree
Hide file tree
Showing 20 changed files with 304 additions and 118 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ KubeBlocks add-ons.
| qdrant | qdrant-1.10.0<br>qdrant-1.5.0<br>qdrant-1.7.3<br>qdrant-1.8.1<br>qdrant-1.8.4 | High-performance, massive-scale Vector Database for the next generation of AI. | iziang |
| rabbitmq | rabbitmq-3.10.25<br>rabbitmq-3.11.28<br>rabbitmq-3.12.14<br>rabbitmq-3.13.2<br>rabbitmq-3.8.14<br>rabbitmq-3.9.29 | RabbitMQ is a reliable and mature messaging and streaming broker. | xuriwuyun |
| redis | redis-7.0.6<br>redis-7.2.4<br>redis-cluster-7.0.6<br>redis-cluster-7.2.4<br>redis-sentinel-7.0.6<br>redis-sentinel-7.2.4<br>redis-twemproxy-0.5.0 | Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps. | Y-Rookie |
| risingwave | risingwave-v1.0.0 | RisingWave is a distributed SQL streaming database that enables cost-efficient and reliable processing of streaming data. | RisingWave Labs |
| risingwave | risingwave-compactor-v1.0.0<br>risingwave-compute-v1.0.0<br>risingwave-connector-v1.0.0<br>risingwave-frontend-v1.0.0<br>risingwave-meta-v1.0.0 | RisingWave is a distributed SQL streaming database that enables cost-efficient and reliable processing of streaming data. | RisingWave Labs |
| starrocks-ce | starrocks-ce-be-3.2.2<br>starrocks-ce-be-3.3.0<br>starrocks-ce-fe-3.2.2<br>starrocks-ce-fe-3.3.0 | A Linux Foundation project, is the next-generation data platform designed to make data-intensive real-time analytics fast and easy. | yandongxiao iziang |
| tdengine | tdengine-3.0.5 | TDengine is an open source, high-performance, cloud native time-series database optimized for Internet of Things (IoT), Connected Cars, Industrial IoT and DevOps. | leon-inf |
| tidb | tidb-6.5.10<br>tidb-7.1.5<br>tidb-7.5.2<br>tidb-pd-6.5.10<br>tidb-pd-7.1.5<br>tidb-pd-7.5.2<br>tikv-6.5.10<br>tikv-7.1.5<br>tikv-7.5.2 | TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. | csuzhangxc cjc7373 |
Expand Down
4 changes: 2 additions & 2 deletions addons-cluster/risingwave/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ hummock+s3://{{ .Values.risingwave.stateStore.s3 }}
{{/*
Cluster envs.
*/}}
{{- define "risingwave-cluster.envs" }}
{{- define "risingwave-cluster.envs" -}}
- name: RW_STATE_STORE
value: hummock+s3://{{ .Values.risingwave.stateStore.s3.bucket }}
- name: AWS_REGION
Expand All @@ -97,5 +97,5 @@ Cluster envs.
- name: RW_ETCD_ENDPOINTS
value: {{ .Values.risingwave.metaStore.etcd.endpoints }}
- name: RW_ETCD_AUTH
value: {{ .Values.risingwave.metaStore.etcd.authentication.enabled}}
value: {{ .Values.risingwave.metaStore.etcd.authentication.enabled | quote }}
{{- end }}
10 changes: 5 additions & 5 deletions addons-cluster/risingwave/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
name: frontend
replicas: {{ .Values.risingwave.frontend.replicas }}
env:
{{ include "risingwave-cluster.envs" . | nindent 6 }}
{{- include "risingwave-cluster.envs" . | nindent 6 }}
serviceAccountName: {{ include "risingwave-cluster.serviceAccountName" . }}
{{- with .Values.risingwave.frontend.resources }}
resources:
Expand All @@ -31,7 +31,7 @@ spec:
name: meta
replicas: {{ .Values.risingwave.meta.replicas }}
env:
{{ include "risingwave-cluster.envs" . | nindent 6 }}
{{- include "risingwave-cluster.envs" . | nindent 6 }}
serviceAccountName: {{ include "risingwave-cluster.serviceAccountName" . }}
{{- with .Values.risingwave.meta.resources }}
resources:
Expand All @@ -50,7 +50,7 @@ spec:
name: compute
replicas: {{ .Values.risingwave.compute.replicas }}
env:
{{ include "risingwave-cluster.envs" . | nindent 6 }}
{{- include "risingwave-cluster.envs" . | nindent 6 }}
serviceAccountName: {{ include "risingwave-cluster.serviceAccountName" . }}
{{- with .Values.risingwave.compute.resources }}
resources:
Expand All @@ -69,7 +69,7 @@ spec:
name: compactor
replicas: {{ .Values.risingwave.compactor.replicas }}
env:
{{ include "risingwave-cluster.envs" . | nindent 6 }}
{{- include "risingwave-cluster.envs" . | nindent 6 }}
serviceAccountName: {{ include "risingwave-cluster.serviceAccountName" . }}
{{- with .Values.risingwave.compactor.resources }}
resources:
Expand All @@ -88,7 +88,7 @@ spec:
name: connector
replicas: {{ .Values.risingwave.connector.replicas }}
env:
{{ include "risingwave-cluster.envs" . | nindent 6 }}
{{- include "risingwave-cluster.envs" . | nindent 6 }}
serviceAccountName: {{ include "risingwave-cluster.serviceAccountName" . }}
{{- with .Values.risingwave.connector.resources }}
resources:
Expand Down
8 changes: 0 additions & 8 deletions addons-cluster/risingwave/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ fullnameOverride: ""
##
terminationPolicy: Delete

## Service configurations
##
service:
## @param service.type RisingWave SQL frontend service type, valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
##
type: ClusterIP

serviceAccount:
## @param serviceAccount.name is the name of the service account to use.
## Used by all RisingWave component pods.
Expand Down
2 changes: 1 addition & 1 deletion addons/risingwave/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ maintainers:
url: https://www.risingwave-labs.com

annotations:
addon.kubeblocks.io/kubeblocks-version: ">=0.9.0"
addon.kubeblocks.io/kubeblocks-version: ">=1.0.0"
addon.kubeblocks.io/model: "streaming"
addon.kubeblocks.io/provider: "community"
104 changes: 101 additions & 3 deletions addons/risingwave/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,110 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Common risingwave annotations
*/}}
{{- define "risingwave.annotations" -}}
helm.sh/resource-policy: keep
{{- end }}

{{/*
Define risingwave compactor component definition name
*/}}
{{- define "risingwave-compactor.cmpdName" -}}
risingwave-compactor-{{ .Chart.Version }}
{{- end -}}

{{/*
Define risingwave compactor component definition regular expression name pattern
*/}}
{{- define "risingwave-compactor.cmpdRegexpPattern" -}}
^risingwave-compactor-
{{- end -}}

{{/*
Define risingwave compute component definition name
*/}}
{{- define "risingwave-compute.cmpdName" -}}
risingwave-compute-{{ .Chart.Version }}
{{- end -}}

{{/*
Define risingwave compute component definition regular expression name pattern
*/}}
{{- define "risingwave-compute.cmpdRegexpPattern" -}}
^risingwave-compute-
{{- end -}}

{{/*
Define risingwave connector component definition name
*/}}
{{- define "risingwave-connector.cmpdName" -}}
risingwave-connector-{{ .Chart.Version }}
{{- end -}}

{{/*
Define risingwave connector component definition regular expression name pattern
*/}}
{{- define "risingwave-connector.cmpdRegexpPattern" -}}
^risingwave-connector-
{{- end -}}

{{/*
Define risingwave frontend component definition name
*/}}
{{- define "risingwave-frontend.cmpdName" -}}
risingwave-frontend-{{ .Chart.Version }}
{{- end -}}

{{/*
Define risingwave frontend component definition regular expression name pattern
*/}}
{{- define "risingwave-frontend.cmpdRegexpPattern" -}}
^risingwave-frontend-
{{- end -}}

{{/*
Define risingwave meta component definition name
*/}}
{{- define "risingwave-meta.cmpdName" -}}
risingwave-meta-{{ .Chart.Version }}
{{- end -}}

{{/*
Define risingwave meta component definition regular expression name pattern
*/}}
{{- define "risingwave-meta.cmpdRegexpPattern" -}}
^risingwave-meta-
{{- end -}}

{{/*
Define risingwave config template name
*/}}
{{- define "risingwave.configTplName" -}}
risingwave-configuration-tpl
{{- end -}}

{{/*
Define risingwave compute env config template name
*/}}
{{- define "risingwave-compute.envConfigTplName" -}}
risingwave-compute-envs-tpl
{{- end -}}

{{/*
Define risingwave connector env config template name
*/}}
{{- define "risingwave-connector.envConfigTplName" -}}
risingwave-connector-envs-tpl
{{- end -}}

{{/*
Default config template.
*/}}
{{- define "risingwave.conftpl.default" }}
- name: risingwave-configuration
templateRef: {{ include "risingwave.name" . }}-conf-tpl
templateRef: {{ include "risingwave.configTplName" . }}
namespace: {{ .Release.Namespace }}
volumeName: risingwave-configuration
{{- end }}
Expand Down Expand Up @@ -115,7 +213,7 @@ Connector service vars.
- name: CONNECTOR_SVC
valueFrom:
serviceVarRef:
compDef: risingwave-connector
compDef: {{ include "risingwave-connector.cmpdRegexpPattern" . }}
optional: false
host: Required
{{- end }}
Expand All @@ -127,7 +225,7 @@ Meta service vars.
- name: META_SVC
valueFrom:
serviceVarRef:
compDef: risingwave-meta
compDef: {{ include "risingwave-meta.cmpdRegexpPattern" . }}
optional: false
host: Required
{{- end }}
34 changes: 18 additions & 16 deletions addons/risingwave/templates/cmpd-compactor.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
apiVersion: apps.kubeblocks.io/v1
kind: ComponentDefinition
metadata:
name: risingwave-compactor-{{ .Chart.Version }}
name: {{ include "risingwave-compactor.cmpdName" . }}
labels:
{{- include "risingwave.labels" . | nindent 4 }}
annotations:
{{- include "risingwave.annotations" . | nindent 4 }}
spec:
provider: Community
description: {{ .Chart.Description }}
serviceKind: risingwave
serviceVersion: {{ .Chart.AppVersion }}
services:
- name: default
spec:
ports:
- port: 6660
targetPort: svc
name: svc
- port: 1260
targetPort: metrics
name: metrics
configs:
{{- include "risingwave.conftpl.default" . | indent 4 }}
vars:
{{- include "risingwave.vars.meta" . | indent 4 }}
runtime:
containers:
- name: compactor
Expand Down Expand Up @@ -47,18 +63,4 @@ spec:
volumeMounts:
{{- include "risingwave.volumeMount.conftpl.default" . | indent 10 }}
{{- include "risingwave.probe.liveness" . | indent 8 }}
{{- include "risingwave.probe.readiness" . | indent 8 }}
vars:
{{- include "risingwave.vars.meta" . | indent 4 }}
services:
- name: default
spec:
ports:
- port: 6660
targetPort: svc
name: svc
- port: 1260
targetPort: metrics
name: metrics
configs:
{{- include "risingwave.conftpl.default" . | indent 4 }}
{{- include "risingwave.probe.readiness" . | indent 8 }}
50 changes: 26 additions & 24 deletions addons/risingwave/templates/cmpd-compute.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
apiVersion: apps.kubeblocks.io/v1
kind: ComponentDefinition
metadata:
name: risingwave-compute-{{ .Chart.Version }}
name: {{ include "risingwave-compute.cmpdName" . }}
labels:
{{- include "risingwave.labels" . | nindent 4 }}
annotations:
{{- include "risingwave.annotations" . | nindent 4 }}
spec:
provider: Community
description: {{ .Chart.Description }}
serviceKind: risingwave
serviceVersion: {{ .Chart.AppVersion }}
services:
- name: default
spec:
ports:
- port: 5688
targetPort: svc
name: svc
- port: 1222
targetPort: metrics
name: metrics
configs:
{{- include "risingwave.conftpl.default" . | indent 4 }}
- name: risingwave-compute-envs
templateRef: {{ include "risingwave-compute.envConfigTplName" . }}
namespace: {{ .Release.Namespace }}
volumeName: risingwave-compute-envs
asEnvFrom:
- compute
updateStrategy: BestEffortParallel
vars:
{{- include "risingwave.vars.connector" . | indent 4 }}
{{- include "risingwave.vars.meta" . | indent 4 }}
runtime:
containers:
- name: compute
Expand Down Expand Up @@ -49,26 +73,4 @@ spec:
volumeMounts:
{{- include "risingwave.volumeMount.conftpl.default" . | indent 10 }}
{{- include "risingwave.probe.liveness" . | indent 8 }}
{{- include "risingwave.probe.readiness" . | indent 8 }}
vars:
{{- include "risingwave.vars.connector" . | indent 4 }}
{{- include "risingwave.vars.meta" . | indent 4 }}
services:
- name: default
spec:
ports:
- port: 5688
targetPort: svc
name: svc
- port: 1222
targetPort: metrics
name: metrics
configs:
{{- include "risingwave.conftpl.default" . | indent 4 }}
- name: risingwave-compute-envs
templateRef: {{ include "risingwave.name" . }}-compute-envs-tpl
namespace: {{ .Release.Namespace }}
volumeName: risingwave-compute-envs
asEnvFrom:
- compute
updateStrategy: BestEffortParallel
{{- include "risingwave.probe.readiness" . | indent 8 }}
Loading

0 comments on commit 53cfd20

Please sign in to comment.