-
Notifications
You must be signed in to change notification settings - Fork 82
feat(k8s-dbs): dbs纳管rustfs #14920 #14952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jay3cx
wants to merge
1
commit into
TencentBlueKing:v1.5.0
Choose a base branch
from
jay3cx:feat/add_rustfs/#14920
base: v1.5.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
dbm-services/k8s-dbs/k8s-utils/helm/storageAddon/rustfs/Chart.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| apiVersion: v1 | ||
| appVersion: 1.0.0 | ||
| description: A Helm chart for Kubernetes | ||
| name: rustfs | ||
| version: 1.0.0 |
168 changes: 168 additions & 0 deletions
168
dbm-services/k8s-dbs/k8s-utils/helm/storageAddon/rustfs/templates/_helpers.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,168 @@ | ||
| {{/* vim: set filetype=mustache: */}} | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "rustfs.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 "rustfs.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 -}} | ||
|
|
||
| {{/* | ||
| Create chart name and version as used by the chart label. | ||
| */}} | ||
| {{- define "rustfs.chart" -}} | ||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Common labels | ||
| */}} | ||
| {{- define "rustfs.labels" -}} | ||
| helm.sh/chart: {{ include "rustfs.chart" . }} | ||
| {{ include "rustfs.selectorLabels" . }} | ||
| {{- if .Chart.AppVersion }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Selector labels | ||
| */}} | ||
| {{- define "rustfs.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "rustfs.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Return the appropriate apiVersion for poddisruptionbudget. | ||
| */}} | ||
| {{- define "rustfs.pdb.apiVersion" -}} | ||
| {{- if semverCompare "<1.21-0" .Capabilities.KubeVersion.Version -}} | ||
| {{- print "policy/v1beta1" -}} | ||
| {{- else -}} | ||
| {{- print "policy/v1" -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Return the appropriate apiVersion for statefulset. | ||
| */}} | ||
| {{- define "rustfs.statefulset.apiVersion" -}} | ||
| {{- if semverCompare "<1.16-0" .Capabilities.KubeVersion.Version -}} | ||
| {{- print "apps/v1beta2" -}} | ||
| {{- else -}} | ||
| {{- print "apps/v1" -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Determine secret name. | ||
| */}} | ||
| {{- define "rustfs.secretName" -}} | ||
| {{- if .Values.existingSecret -}} | ||
| {{- .Values.existingSecret }} | ||
| {{- else -}} | ||
| {{- include "rustfs.fullname" . -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Properly format optional additional arguments to RustFS binary | ||
| */}} | ||
| {{- define "rustfs.extraArgs" -}} | ||
| {{- range .Values.extraArgs -}} | ||
| {{ " " }}{{ . }} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Return the proper Docker Image Registry Secret Names | ||
| */}} | ||
| {{- define "rustfs.imagePullSecrets" -}} | ||
| {{- if .Values.global }} | ||
| {{- if .Values.global.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- range .Values.global.imagePullSecrets }} | ||
| - name: {{ . }} | ||
| {{- end }} | ||
| {{- else if .Values.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{ toYaml .Values.imagePullSecrets }} | ||
| {{- end -}} | ||
| {{- else if .Values.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{ toYaml .Values.imagePullSecrets }} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Formats volumeMount for RustFS tls keys and trusted certs | ||
| */}} | ||
| {{- define "rustfs.tlsKeysVolumeMount" -}} | ||
| {{- if .Values.tls.enabled }} | ||
| - name: cert-secret-volume | ||
| mountPath: {{ .Values.certsPath }} | ||
| {{- end }} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Formats volume for RustFS tls keys and trusted certs | ||
| */}} | ||
| {{- define "rustfs.tlsKeysVolume" -}} | ||
| {{- if .Values.tls.enabled }} | ||
| - name: cert-secret-volume | ||
| secret: | ||
| secretName: {{ .Values.tls.certSecret }} | ||
| items: | ||
| - key: {{ .Values.tls.publicCrt }} | ||
| path: public.crt | ||
| - key: {{ .Values.tls.privateKey }} | ||
| path: private.key | ||
| {{- end }} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Expand the name of the clusterdefinition. | ||
| */}} | ||
| {{- define "rustfs.cdName" -}} | ||
| rustfs-{{ .Chart.Version }} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Expand the name of the componentdefinition. | ||
| */}} | ||
| {{- define "rustfs.cmpdName" -}} | ||
| rustfs-{{ .Chart.Version }} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Expand the name of the componentversion. | ||
| */}} | ||
| {{- define "rustfs.cmpvName" -}} | ||
| rustfs-{{ .Chart.Version }} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Expand the name of the configmap. | ||
| */}} | ||
| {{- define "rustfs.config" -}} | ||
| rustfs-configuration-{{ .Chart.Version }} | ||
| {{- end -}} |
17 changes: 17 additions & 0 deletions
17
dbm-services/k8s-dbs/k8s-utils/helm/storageAddon/rustfs/templates/clusterdefinition.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| apiVersion: apps.kubeblocks.io/v1alpha1 | ||
| kind: ClusterDefinition | ||
| metadata: | ||
| name: {{ include "rustfs.cdName" . }} | ||
| labels: | ||
| {{- include "rustfs.labels" . | nindent 4 }} | ||
| spec: | ||
| topologies: | ||
| - name: standalone | ||
| default: true | ||
| components: | ||
| - name: rustfs | ||
| compDef: {{ include "rustfs.cmpdName" . }}-standalone | ||
| - name: distributed | ||
| components: | ||
| - name: rustfs | ||
| compDef: {{ include "rustfs.cmpdName" . }}-distributed | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 规范下,参考 rw 或者 vm |
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
规范下,参考 rw 或者 vm