Skip to content

Commit

Permalink
Support NebulaGraph.
Browse files Browse the repository at this point in the history
Co-authored-by: Shanshan.Ying <shanshan.ying@apecloud.com>
Co-authored-by: Cheng Xuntao <7731943+xtcyclist@users.noreply.github.com>
  • Loading branch information
xtcyclist and shanshanying committed Jun 21, 2023
1 parent 3481b65 commit cd8b3fe
Show file tree
Hide file tree
Showing 21 changed files with 1,097 additions and 0 deletions.
11 changes: 11 additions & 0 deletions deploy/nebula-cluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
name: nebula-cluster
description: Nebula Graph Cluster Helm Chart for KubeBlocks.
type: application
version: 0.5.1-beta.0
appVersion: "v3.5.0"
maintainers:
- name: Shanshan Ying
email: shanshan.ying@apecloud.com
- name: Xuntao Cheng
email: xuntao.cheng@vesoft.com
1 change: 1 addition & 0 deletions deploy/nebula-cluster/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Installed nebula-cluster!
59 changes: 59 additions & 0 deletions deploy/nebula-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "nebula-cluster.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
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 "nebula-cluster.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Expand the namespace of the chart.
*/}}
{{- define "nebula-cluster.namespace" -}}
{{ .Release.Namespace }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "nebula-cluster.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
The ImagePullSecrets.
*/}}
{{- define "nebula-cluster.imagePullSecrets" -}}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 2 }}
{{- end }}
{{- end }}

{{/*
Nebula cluster labels
*/}}
{{- define "nebula-cluster.labels" -}}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "nebula-cluster.chart" . }}
{{- end }}
86 changes: 86 additions & 0 deletions deploy/nebula-cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
name: {{ include "nebula-cluster.name" . }}
labels:
{{ include "nebula-cluster.labels" . | indent 4 }}
spec:
clusterDefinitionRef: nebula
clusterVersionRef: nebula-{{ default .Chart.AppVersion .Values.clusterVersionOverride }}
terminationPolicy: {{ .Values.nebula.terminationPolicy }}
componentSpecs:
- name: nebula-metad
componentDefRef: nebula-metad
replicas: {{ .Values.nebula.metad.replicas }}
{{- with .Values.nebula.metad.resources }}
resources:
{{- with .limits }}
limits:
cpu: {{ .cpu | quote }}
memory: {{ .memory | quote }}
{{- end }}
{{- with .requests }}
requests:
cpu: {{ .cpu | quote }}
memory: {{ .memory | quote }}
{{- end }}
{{- end }}
volumeClaimTemplates:
- name: data # ref clusterdefinition components.containers.volumeMounts.name
spec:
storageClassName: {{ .Values.nebula.storageClassName }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.nebula.metad.dataStorage }}
- name: nebula-graphd
componentDefRef: nebula-graphd
replicas: {{ .Values.nebula.graphd.replicas }}
{{- with .Values.nebula.graphd.resources }}
resources:
{{- with .limits }}
limits:
cpu: {{ .cpu | quote }}
memory: {{ .memory | quote }}
{{- end }}
{{- with .requests }}
requests:
cpu: {{ .cpu | quote }}
memory: {{ .memory | quote }}
{{- end }}
{{- end }}
volumeClaimTemplates:
- name: data # ref clusterdefinition components.containers.volumeMounts.name
spec:
storageClassName: {{ .Values.nebula.storageClassName }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.nebula.metad.dataStorage }}
- name: nebula-storaged
componentDefRef: nebula-storaged
replicas: {{ .Values.nebula.storaged.replicas }}
{{- with .Values.nebula.storaged.resources }}
resources:
{{- with .limits }}
limits:
cpu: {{ .cpu | quote }}
memory: {{ .memory | quote }}
{{- end }}
{{- with .requests }}
requests:
cpu: {{ .cpu | quote }}
memory: {{ .memory | quote }}
{{- end }}
{{- end }}
volumeClaimTemplates:
- name: data # ref clusterdefinition components.containers.volumeMounts.name
spec:
storageClassName: {{ .Values.nebula.storageClassName }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.nebula.storaged.dataStorage }}
69 changes: 69 additions & 0 deletions deploy/nebula-cluster/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## cluster settings for nebula graph
nebula:
## @param nebula.version, version of nebula-graph
## more info: check https://docs.nebula-graph.io/ for latest and LTS versions
version: v3.5.0
## @param nebula.storageClassName, storage class name
storageClassName: ""
## @param nebula.terminationPolicy, temination policy for nebula-cluster
terminationPolicy: Delete
graphd:
## @param nebula.graphd.image, container image for nebula-graphd
image: docker.io/vesoft/nebula-graphd:v3.5.0
## @param nebula.graph.replicas, number of nebula-graph instances
## in a nebula-graph cluster, all nebula-graphd instances are independent
replicas: 1
## @param nebula.graphd.serviceType
serviceType: NodePort
## @param nebula.graphd.resources
## resource management
## more info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources:
requests:
cpu: "500m"
memory: "500Mi"
limits:
cpu: "1"
memory: "500Mi"
## @param nebula.graphd.resoruces.logStorage
logStorage: "500Mi"
metad:
## @param nebula.metad.image, container image for nebula-metad
image: docker.io/vesoft/nebula-metad:v3.5.0
## @param nebula.metad.replicas, number of nebula-graph instances
## in a nebula-graph cluter, nebula-metad instances form a raft group
replicas: 1
## @param nebula.metad.resources
## resource management
## more info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources:
requests:
cpu: "500m"
memory: "500Mi"
limits:
cpu: "1"
memory: "1Gi"
## @param nebula.metad.logStorage
logStorage: "500Mi"
## @param nebula.metad.dataStorage
dataStorage: "2Gi"
storaged:
## @param nebula.storaged.image, container image for nebula-storaged
image: docker.io/vesoft/nebula-storaged:v3.5.0
## @param nebula.storaged.replicas, number of nebula-graph instances
## in a nebula-graph cluter, nebula-storaged instances form a raft group
replicas: 1
## @param nebula.storaged.resources
## resource management
## more info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources:
requests:
cpu: "500m"
memory: "500Mi"
limits:
cpu: "1"
memory: "1Gi"
## @param nebula.metad.logStorage
logStorage: "500Mi"
## @param nebula.metad.dataStorage
dataStorage: "10Gi"
18 changes: 18 additions & 0 deletions deploy/nebula/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v2
name: nebula
description: Nebula Graph Cluster Helm Chart for KubeBlocks.
version: 0.5.1-beta.0
appVersion: "v3.5.0"
home: https://nebula-graph.io
sources:
- https://github.com/vesoft-inc/nebula
keywords:
- kubernetes
- nebula-graph
- database
- graph database
maintainers:
- name: Shanshan Ying
email: shanshan.ying@apecloud.com
- name: Xuntao Cheng
email: xuntao.cheng@vesoft.com
Loading

0 comments on commit cd8b3fe

Please sign in to comment.