-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add VictoriaMetrics addon (#479)
- Loading branch information
1 parent
38effb0
commit 053db17
Showing
16 changed files
with
6,898 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains 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,9 @@ | ||
apiVersion: v2 | ||
name: victoria-metrics-cluster | ||
description: A VictoriaMetrics cluster Helm chart for KubeBlocks. | ||
|
||
type: application | ||
|
||
version: 0.1.0 | ||
|
||
appVersion: "v1.100.1" |
Empty file.
This file contains 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,66 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "victoria-metrics-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 "victoria-metrics-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 }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "victoria-metrics-cluster.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "victoria-metrics-cluster.labels" -}} | ||
helm.sh/chart: {{ include "victoria-metrics-cluster.chart" . }} | ||
{{ include "victoria-metrics-cluster.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "victoria-metrics-cluster.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "victoria-metrics-cluster.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "victoria-metrics-cluster.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "victoria-metrics-cluster.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "clustername" -}} | ||
{{ include "victoria-metrics-cluster.fullname" .}} | ||
{{- end}} |
This file contains 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,68 @@ | ||
apiVersion: apps.kubeblocks.io/v1alpha1 | ||
kind: Cluster | ||
metadata: | ||
name: {{ include "clustername" . }} | ||
labels: | ||
{{- include "victoria-metrics-cluster.labels" . | nindent 4 }} | ||
spec: | ||
clusterDefinitionRef: victoria-metrics | ||
clusterVersionRef: victoria-metrics-{{ default .Chart.AppVersion .Values.clusterVersionOverride }} | ||
terminationPolicy: {{ .Values.terminationPolicy }} | ||
componentSpecs: | ||
- name: vminsert | ||
componentDefRef: vminsert | ||
replicas: {{ .Values.vminsert.replicas | default 1 }} | ||
{{- with .Values.vminsert.resources }} | ||
resources: | ||
{{- with .limits }} | ||
limits: | ||
cpu: {{ .cpu | quote }} | ||
memory: {{ .memory | quote }} | ||
{{- end }} | ||
{{- with .requests }} | ||
requests: | ||
cpu: {{ .cpu | quote }} | ||
memory: {{ .memory | quote }} | ||
{{- end }} | ||
{{- end }} | ||
- name: vmselect | ||
componentDefRef: vmselect | ||
replicas: {{ .Values.vmselect.replicas | default 1 }} | ||
{{- with .Values.vmselect.resources }} | ||
resources: | ||
{{- with .limits }} | ||
limits: | ||
cpu: {{ .cpu | quote }} | ||
memory: {{ .memory | quote }} | ||
{{- end }} | ||
{{- with .requests }} | ||
requests: | ||
cpu: {{ .cpu | quote }} | ||
memory: {{ .memory | quote }} | ||
{{- end }} | ||
{{- end }} | ||
- name: vmstorage | ||
componentDefRef: vmstorage | ||
replicas: {{ .Values.vmstorage.replicas | default 1 }} | ||
{{- with .Values.vmstorage.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: vmstorage-volume | ||
spec: | ||
storageClassName: {{ .Values.storageClassName }} | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: {{ .Values.vmstorage.volume.storage | default "10Gi" }} |
Oops, something went wrong.