[deployment] remove helm chart

This commit is contained in:
Artem Navoiev 2019-10-13 23:03:52 +03:00
parent bf6fe234b2
commit 3d3d87f718
21 changed files with 1 additions and 1245 deletions

View file

@ -1,26 +0,0 @@
# All these commands must run from repository root.
HELM_PROJECT=victoria-metrics
HELM_PATH=deployment/k8s/helm/${HELM_PROJECT}
HELM_APP_VERSION=1.0
helm-init:
@helm init
helm-install:
helm install $(HELM_PATH) -n $(ENV)
helm-install-dev:
ENV=dev $(MAKE) helm-install
helm-upgrade:
helm upgrade $(ENV) $(HELM_PATH)
helm-upgrade-dev:
ENV=dev $(MAKE) helm-upgrade
helm-delete:
helm del --purge $(ENV)
helm-delete-dev:
ENV=dev $(MAKE) helm-delete

View file

@ -1,37 +1 @@
### Victoria metrics helm chart
#### Create cluster from chart
```$bash
$ ENV=<env> make helm-install
```
for DEV env :
```$bash
$ make helm-install-dev
```
#### Upgrade cluster from chart
```$bash
$ ENV=<env> make helm-upgrade
```
for DEV env :
```$bash
$ make helm-upgrade-dev
```
#### Delete chart from cluster
```$bash
$ ENV=<env> make helm-delete
```
for DEV env :
```$bash
$ make helm-delete-dev
```
### Helm chart has been moved to [helm-chart](https://github.com/VictoriaMetrics/helm-charts) repository.

View file

@ -1,22 +0,0 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View file

@ -1,5 +0,0 @@
apiVersion: v1
appVersion: 1.26.0
description: Victoria Metrics Helm chart for Kubernetes
name: victoria-metrics
version: 0.2.0

View file

@ -1,8 +0,0 @@
# Victoria Metrics
## TL;DR;
1. Install helm chart. Check the output.
2. Specify Remote Write URL in Prometheus.
3. Configure Grafana's Prometheus Data Source.

View file

@ -1,76 +0,0 @@
{{ if .Values.vminsert.enabled }}
Write API:
The Victoria Metrics write api can be accessed via port {{ .Values.vminsert.service.servicePort }} on the following DNS name from within your cluster:
{{ template "victoria-metrics.vminsert.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomainSuffix }}
Get the Victoria Metrics insert service URL by running these commands in the same shell:
{{- if contains "NodePort" .Values.vminsert.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "victoria-metrics.vminsert.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.vminsert.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "victoria-metrics.vminsert.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "victoria-metrics.vminsert.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.vminsert.service.servicePort }}
{{- else if contains "ClusterIP" .Values.vminsert.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ .Values.vminsert.name }}" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME {{ .Values.vminsert.service.servicePort }}
{{- end }}
You need to update your prometheus configuration file and add next lines into it:
prometheus.yml
```yaml
remote_write:
- url: "http://<insert-service>/insert/0/prometheus/"
```
for e.g. inside the kubernetes cluster:
```yaml
remote_write:
- url: "http://{{ template "victoria-metrics.vminsert.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomainSuffix }}:{{ .Values.vminsert.service.servicePort }}/insert/0/prometheus/"
```
{{- end }}
{{- if .Values.vmselect.enabled }}
Read API:
The Victoria Metrics read api can be accessed via port {{ .Values.vmselect.service.servicePort }} on the following DNS name from within your cluster:
{{ template "victoria-metrics.vmselect.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomainSuffix }}
Get the Victoria Metrics select service URL by running these commands in the same shell:
{{- if contains "NodePort" .Values.vmselect.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "victoria-metrics.vminsert.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.vmselect.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "victoria-metrics.vminsert.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "victoria-metrics.vmselect.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.vmselect.service.servicePort }}
{{- else if contains "ClusterIP" .Values.vmselect.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ .Values.vmselect.name }}" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME {{ .Values.vmselect.service.servicePort }}
{{- end }}
You need to update specify select service URL in your Grafana:
NOTE: you need to use Prometheus Data Source
Input for URL field in Grafana
```
http://<select-service>/select/0/prometheus/
```
for e.g. inside the kubernetes cluster:
```
http://{{ template "victoria-metrics.vmselect.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomainSuffix }}:{{ .Values.vmselect.service.servicePort }}/select/0/prometheus/"
```
{{- end }}

View file

@ -1,128 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "victoria-metrics.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "victoria-metrics.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create unified labels for victoria-metrics components
*/}}
{{- define "victoria-metrics.common.matchLabels" -}}
app.kubernetes.io/name: {{ include "victoria-metrics.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "victoria-metrics.common.metaLabels" -}}
helm.sh/chart: {{ include "victoria-metrics.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{- define "victoria-metrics.vmstorage.labels" -}}
{{ include "victoria-metrics.vmstorage.matchLabels" . }}
{{ include "victoria-metrics.common.metaLabels" . }}
{{- end -}}
{{- define "victoria-metrics.vmstorage.matchLabels" -}}
app: {{ .Values.vmstorage.name }}
{{ include "victoria-metrics.common.matchLabels" . }}
{{- end -}}
{{- define "victoria-metrics.vmselect.labels" -}}
{{ include "victoria-metrics.vmselect.matchLabels" . }}
{{ include "victoria-metrics.common.metaLabels" . }}
{{- end -}}
{{- define "victoria-metrics.vmselect.matchLabels" -}}
app: {{ .Values.vmselect.name }}
{{ include "victoria-metrics.common.matchLabels" . }}
{{- end -}}
{{- define "victoria-metrics.vminsert.labels" -}}
{{ include "victoria-metrics.vminsert.matchLabels" . }}
{{ include "victoria-metrics.common.metaLabels" . }}
{{- end -}}
{{- define "victoria-metrics.vminsert.matchLabels" -}}
app: {{ .Values.vminsert.name }}
{{ include "victoria-metrics.common.matchLabels" . }}
{{- end -}}
{{/*
Create a fully qualified vmstorage name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "victoria-metrics.vmstorage.fullname" -}}
{{- if .Values.vmstorage.fullnameOverride -}}
{{- .Values.vmstorage.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- printf "%s-%s" .Release.Name .Values.vmstorage.name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.vmstorage.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create a fully qualified vmselect name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "victoria-metrics.vmselect.fullname" -}}
{{- if .Values.vmselect.fullnameOverride -}}
{{- .Values.vmselect.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- printf "%s-%s" .Release.Name .Values.vmselect.name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.vmselect.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create a fully qualified vmselect name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "victoria-metrics.vminsert.fullname" -}}
{{- if .Values.vminsert.fullnameOverride -}}
{{- .Values.vminsert.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- printf "%s-%s" .Release.Name .Values.vminsert.name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.vminsert.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "victoria-metrics.vminsert.vmstorage-pod-fqdn" -}}
{{- $pod := include "victoria-metrics.vmstorage.fullname" . -}}
{{- $svc := include "victoria-metrics.vmstorage.fullname" . -}}
{{- $namespace := .Release.Namespace -}}
{{- $dnsSuffix := .Values.clusterDomainSuffix -}}
{{- range $i := until (.Values.vmstorage.replicaCount | int) -}}
{{- printf "- --storageNode=%s-%d.%s.%s.svc.%s:8400\n" $pod $i $svc $namespace $dnsSuffix -}}
{{- end -}}
{{- end -}}
{{- define "victoria-metrics.vmselect.vmstorage-pod-fqdn" -}}
{{- $pod := include "victoria-metrics.vmstorage.fullname" . -}}
{{- $svc := include "victoria-metrics.vmstorage.fullname" . -}}
{{- $namespace := .Release.Namespace -}}
{{- $dnsSuffix := .Values.clusterDomainSuffix -}}
{{- range $i := until (.Values.vmstorage.replicaCount | int) -}}
{{- printf "- --storageNode=%s-%d.%s.%s.svc.%s:8401\n" $pod $i $svc $namespace $dnsSuffix -}}
{{- end -}}
{{- end -}}

View file

@ -1,71 +0,0 @@
{{- if .Values.vminsert.enabled -}}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
{{- include "victoria-metrics.vminsert.labels" . | nindent 4 }}
name: {{ template "victoria-metrics.vminsert.fullname" . }}
spec:
selector:
matchLabels:
{{- include "victoria-metrics.vminsert.matchLabels" . | nindent 6 }}
replicas: {{ .Values.vminsert.replicaCount }}
template:
metadata:
{{- if .Values.vminsert.podAnnotations }}
annotations:
{{ toYaml .Values.vminsert.podAnnotations | indent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.vminsert.labels" . | nindent 8 }}
spec:
{{- if .Values.vminsert.priorityClassName }}
priorityClassName: "{{ .Values.vminsert.priorityClassName }}"
{{- end }}
containers:
- name: {{ template "victoria-metrics.name" . }}-{{ .Values.vminsert.name }}
image: "{{ .Values.vminsert.image.repository }}:{{ .Values.vminsert.image.tag }}"
imagePullPolicy: "{{ .Values.vminsert.image.pullPolicy }}"
args:
{{- include "victoria-metrics.vminsert.vmstorage-pod-fqdn" . | nindent 12 }}
{{- range $key, $value := .Values.vminsert.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
ports:
- name: http
containerPort: 8480
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 15
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
resources:
{{ toYaml .Values.vminsert.resources | indent 12 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.vminsert.nodeSelector }}
nodeSelector:
{{ toYaml .Values.vminsert.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.vminsert.securityContext }}
securityContext:
{{ toYaml .Values.vminsert.securityContext | indent 8 }}
{{- end }}
{{- if .Values.vminsert.tolerations }}
tolerations:
{{ toYaml .Values.vminsert.tolerations | indent 8 }}
{{- end }}
{{- if .Values.vminsert.affinity }}
affinity:
{{ toYaml .Values.vminsert.affinity | indent 8 }}
{{- end }}
{{- end }}

View file

@ -1,31 +0,0 @@
{{- if and .Values.vminsert.enabled .Values.vminsert.ingress.enabled }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
{{- if .Values.vminsert.ingress.annotations }}
annotations:
{{ toYaml .Values.vminsert.ingress.annotations | indent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.vminsert.labels" . | nindent 4 }}
{{ if .Values.vminsert.ingress.extraLabels }}
{{ toYaml .Values.vminsert.ingress.extraLabels | indent 4 }}
{{ end }}
name: {{ template "victoria-metrics.vminsert.fullname" . }}
spec:
rules:
{{- $serviceName := include "victoria-metrics.vminsert.fullname" . }}
{{- range .Values.vminsert.ingress.hosts }}
- host: {{ .name }}
http:
paths:
- path: {{ .path }}
backend:
serviceName: {{ $serviceName }}
servicePort: http
{{- end -}}
{{- if .Values.vminsert.ingress.tls }}
tls:
{{ toYaml .Values.vminsert.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}

View file

@ -1,30 +0,0 @@
{{- if and .Values.vminsert.enabled .Values.vminsert.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- if .Values.vminsert.serviceMonitor.annotations }}
annotations:
{{ toYaml .Values.vminsert.serviceMonitor.annotations | indent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.vminsert.labels" . | nindent 4 }}
{{- if .Values.vminsert.serviceMonitor.extraLabels }}
{{ toYaml .Values.vminsert.serviceMonitor.extraLabels | indent 4 }}
{{- end }}
name: {{ template "victoria-metrics.vminsert.fullname" . }}
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "victoria-metrics.vminsert.matchLabels" . | nindent 6 }}
endpoints:
- port: http
{{- if .Values.vminsert.serviceMonitor.interval }}
interval: {{ .Values.vminsert.serviceMonitor.interval }}
{{- end }}
{{- if .Values.vminsert.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.vminsert.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- end }}

View file

@ -1,40 +0,0 @@
{{- if .Values.vminsert.enabled -}}
apiVersion: v1
kind: Service
metadata:
{{- if .Values.vminsert.service.annotations }}
annotations:
{{ toYaml .Values.vminsert.service.annotations | indent 4}}
{{- end }}
labels:
{{- include "victoria-metrics.vminsert.labels" . | nindent 4 }}
{{- if .Values.vminsert.service.labels }}
{{ toYaml .Values.vminsert.service.labels | indent 4}}
{{- end }}
name: {{ template "victoria-metrics.vminsert.fullname" . }}
spec:
{{- if .Values.vminsert.service.clusterIP }}
clusterIP: {{ .Values.vminsert.service.clusterIP }}
{{- end }}
{{- if .Values.vminsert.service.externalIPs }}
externalIPs:
{{ toYaml .Values.vminsert.service.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.vminsert.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.vminsert.service.loadBalancerIP }}
{{- end }}
{{- if .Values.vminsert.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range $cidr := .Values.vminsert.service.loadBalancerSourceRanges }}
- {{ $cidr }}
{{- end }}
{{- end }}
ports:
- name: http
port: {{ .Values.vminsert.service.servicePort }}
protocol: TCP
targetPort: http
selector:
{{- include "victoria-metrics.vminsert.matchLabels" . | nindent 4 }}
type: "{{ .Values.vminsert.service.type }}"
{{- end }}

View file

@ -1,83 +0,0 @@
{{- if and .Values.vmselect.enabled (not .Values.vmselect.statefulSet.enabled) -}}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 4 }}
name: {{ template "victoria-metrics.vmselect.fullname" . }}
spec:
selector:
matchLabels:
{{- include "victoria-metrics.vmselect.matchLabels" . | nindent 6 }}
replicas: {{ .Values.vmselect.replicaCount }}
template:
metadata:
{{- if .Values.vmselect.podAnnotations }}
annotations:
{{ toYaml .Values.vmselect.podAnnotations | indent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 8 }}
spec:
{{- if .Values.vmselect.priorityClassName }}
priorityClassName: "{{ .Values.vmselect.priorityClassName }}"
{{- end }}
containers:
- name: {{ template "victoria-metrics.name" . }}-{{ .Values.vmselect.name }}
image: "{{ .Values.vmselect.image.repository }}:{{ .Values.vmselect.image.tag }}"
imagePullPolicy: "{{ .Values.vmselect.image.pullPolicy }}"
args:
- {{ printf "%s=%s" "--cacheDataPath" .Values.vmselect.cacheMountPath | quote}}
{{- include "victoria-metrics.vmselect.vmstorage-pod-fqdn" . | nindent 12 }}
{{- range $key, $value := .Values.vmselect.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
ports:
- name: http
containerPort: 8481
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 15
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
volumeMounts:
- mountPath: {{ .Values.vmselect.cacheMountPath }}
name: cache-volume
resources:
{{ toYaml .Values.vmselect.resources | indent 12 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.vmselect.nodeSelector }}
nodeSelector:
{{ toYaml .Values.vmselect.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.vmselect.securityContext }}
securityContext:
{{ toYaml .Values.vmselect.securityContext | indent 8 }}
{{- end }}
{{- if .Values.vmselect.tolerations }}
tolerations:
{{ toYaml .Values.vmselect.tolerations | indent 8 }}
{{- end }}
{{- if .Values.vmselect.affinity }}
affinity:
{{ toYaml .Values.vmselect.affinity | indent 8 }}
{{- end }}
volumes:
- name: cache-volume
{{- if .Values.vmselect.persistentVolume.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.vmselect.persistentVolume.existingClaim }}{{ .Values.vmselect.persistentVolume.existingClaim }}{{- else }}{{ template "victoria-metrics.vmselect.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
{{- end -}}
{{- end }}

View file

@ -1,31 +0,0 @@
{{- if and .Values.vmselect.enabled .Values.vmselect.ingress.enabled }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
{{- if .Values.vmselect.ingress.annotations }}
annotations:
{{ toYaml .Values.vmselect.ingress.annotations | indent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 4 }}
{{ if .Values.vmselect.ingress.extraLabels }}
{{ toYaml .Values.vmselect.ingress.extraLabels | indent 4 }}
{{ end }}
name: {{ template "victoria-metrics.vmselect.fullname" . }}
spec:
rules:
{{- $serviceName := include "victoria-metrics.vmselect.fullname" . }}
{{- range .Values.vmselect.ingress.hosts }}
- host: {{ .name }}
http:
paths:
- path: {{ .path }}
backend:
serviceName: {{ $serviceName }}
servicePort: http
{{- end -}}
{{- if .Values.vmselect.ingress.tls }}
tls:
{{ toYaml .Values.vmselect.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}

View file

@ -1,24 +0,0 @@
{{- if and .Values.vmselect.enabled .Values.vmselect.statefulSet.enabled -}}
apiVersion: v1
kind: Service
metadata:
{{- if .Values.vmselect.statefulSet.service.annotations }}
annotations:
{{ toYaml .Values.vmselect.statefulSet.service.annotations | indent 4}}
{{- end }}
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 4 }}
{{- if .Values.vmselect.statefulSet.service.labels }}
{{ toYaml .Values.vmselect.statefulSet.service.labels | indent 4}}
{{- end }}
name: {{ template "victoria-metrics.vmselect.fullname" . }}
spec:
clusterIP: None
ports:
- name: http
port: {{ .Values.vmselect.statefulSet.service.servicePort }}
protocol: TCP
targetPort: http
selector:
{{- include "victoria-metrics.vmselect.matchLabels" . | nindent 4 }}
{{- end -}}

View file

@ -1,30 +0,0 @@
{{- if and .Values.vmselect.enabled .Values.vmselect.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- if .Values.vmselect.serviceMonitor.annotations }}
annotations:
{{ toYaml .Values.vmselect.serviceMonitor.annotations | indent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 4 }}
{{- if .Values.vmselect.serviceMonitor.extraLabels }}
{{ toYaml .Values.vmselect.serviceMonitor.extraLabels | indent 4 }}
{{- end }}
name: {{ template "victoria-metrics.vmselect.fullname" . }}
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "victoria-metrics.vmselect.matchLabels" . | nindent 6 }}
endpoints:
- port: http
{{- if .Values.vmselect.serviceMonitor.interval }}
interval: {{ .Values.vmselect.serviceMonitor.interval }}
{{- end }}
{{- if .Values.vmselect.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.vmselect.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- end }}

View file

@ -1,40 +0,0 @@
{{- if and .Values.vmselect.enabled (not .Values.vmselect.statefulSet.enabled) -}}
apiVersion: v1
kind: Service
metadata:
{{- if .Values.vmselect.service.annotations }}
annotations:
{{ toYaml .Values.vmselect.service.annotations | indent 4}}
{{- end }}
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 4 }}
{{- if .Values.vmselect.service.labels }}
{{ toYaml .Values.vmselect.service.labels | indent 4}}
{{- end }}
name: {{ template "victoria-metrics.vmselect.fullname" . }}
spec:
{{- if .Values.vmselect.service.clusterIP }}
clusterIP: {{ .Values.vmselect.service.clusterIP }}
{{- end }}
{{- if .Values.vmselect.service.externalIPs }}
externalIPs:
{{ toYaml .Values.vmselect.service.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.vmselect.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.vmselect.service.loadBalancerIP }}
{{- end }}
{{- if .Values.vmselect.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range $cidr := .Values.vmselect.service.loadBalancerSourceRanges }}
- {{ $cidr }}
{{- end }}
{{- end }}
ports:
- name: http
port: {{ .Values.vmselect.service.servicePort }}
protocol: TCP
targetPort: http
selector:
{{- include "victoria-metrics.vmselect.matchLabels" . | nindent 4 }}
type: "{{ .Values.vmselect.service.type }}"
{{- end }}

View file

@ -1,103 +0,0 @@
{{- if and .Values.vmselect.enabled .Values.vmselect.statefulSet.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 4 }}
name: {{ template "victoria-metrics.vmselect.fullname" . }}
spec:
serviceName: {{ template "victoria-metrics.vmselect.fullname" . }}
selector:
matchLabels:
{{- include "victoria-metrics.vmselect.matchLabels" . | nindent 6 }}
replicas: {{ .Values.vmselect.replicaCount }}
podManagementPolicy: {{ .Values.vmselect.podManagementPolicy }}
template:
metadata:
{{- if .Values.vmselect.podAnnotations }}
annotations:
{{ toYaml .Values.vmselect.podAnnotations | indent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 8 }}
spec:
{{- if .Values.vmselect.priorityClassName }}
priorityClassName: "{{ .Values.vmselect.priorityClassName }}"
{{- end }}
containers:
- name: {{ template "victoria-metrics.name" . }}-{{ .Values.vmselect.name }}
image: "{{ .Values.vmselect.image.repository }}:{{ .Values.vmselect.image.tag }}"
imagePullPolicy: "{{ .Values.vmselect.image.pullPolicy }}"
args:
- {{ printf "%s=%s" "--cacheDataPath" .Values.vmselect.cacheMountPath | quote}}
{{- include "victoria-metrics.vmselect.vmstorage-pod-fqdn" . | nindent 12 }}
{{- range $key, $value := .Values.vmselect.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
ports:
- name: http
containerPort: 8481
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 15
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
volumeMounts:
- mountPath: {{ .Values.vmselect.cacheMountPath }}
name: cache-volume
resources:
{{ toYaml .Values.vmselect.resources | indent 12 }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.vmselect.nodeSelector }}
nodeSelector:
{{ toYaml .Values.vmselect.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.vmselect.securityContext }}
securityContext:
{{ toYaml .Values.vmselect.securityContext | indent 8 }}
{{- end }}
{{- if .Values.vmselect.tolerations }}
tolerations:
{{ toYaml .Values.vmselect.tolerations | indent 8 }}
{{- end }}
{{- if .Values.vmselect.affinity }}
affinity:
{{ toYaml .Values.vmselect.affinity | indent 8 }}
{{- end }}
{{- if .Values.vmselect.persistentVolume.enabled }}
volumeClaimTemplates:
- metadata:
name: cache-volume
{{- if .Values.vmselect.persistentVolume.annotations }}
annotations:
{{ toYaml .Values.vmselect.persistentVolume.annotations | indent 10 }}
{{- end }}
spec:
accessModes:
{{ toYaml .Values.vmselect.persistentVolume.accessModes | indent 10 }}
resources:
requests:
storage: "{{ .Values.vmselect.persistentVolume.size }}"
{{- if .Values.vmselect.persistentVolume.storageClass }}
{{- if (eq "-" .Values.vmselect.persistentVolume.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.vmselect.persistentVolume.storageClass }}"
{{- end }}
{{- end }}
{{- else }}
volumes:
- name: cache-volume
emptyDir: {}
{{- end }}
{{- end }}

View file

@ -1,30 +0,0 @@
{{- if and .Values.vmstorage.enabled .Values.vmstorage.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- if .Values.vmstorage.serviceMonitor.annotations }}
annotations:
{{ toYaml .Values.vmstorage.serviceMonitor.annotations | indent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmstorage.labels" . | nindent 4 }}
{{- if .Values.vmstorage.serviceMonitor.extraLabels }}
{{ toYaml .Values.vmstorage.serviceMonitor.extraLabels | indent 4 }}
{{- end }}
name: {{ template "victoria-metrics.vmstorage.fullname" . }}
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "victoria-metrics.vmstorage.matchLabels" . | nindent 6 }}
endpoints:
- port: http
{{- if .Values.vmstorage.serviceMonitor.interval }}
interval: {{ .Values.vmstorage.serviceMonitor.interval }}
{{- end }}
{{- if .Values.vmstorage.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.vmstorage.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- end }}

View file

@ -1,32 +0,0 @@
{{- if .Values.vmstorage.enabled -}}
apiVersion: v1
kind: Service
metadata:
{{- if .Values.vmstorage.service.annotations }}
annotations:
{{ toYaml .Values.vmstorage.service.annotations | indent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmstorage.labels" . | nindent 4 }}
{{- if .Values.vmstorage.service.labels }}
{{ toYaml .Values.vmstorage.service.labels | indent 4 }}
{{- end }}
name: {{ template "victoria-metrics.vmstorage.fullname" . }}
spec:
clusterIP: None
ports:
- port: {{ .Values.vmstorage.service.servicePort }}
targetPort: http
protocol: TCP
name: http
- port: {{ .Values.vmstorage.service.vmselectPort }}
targetPort: vmselect
protocol: TCP
name: vmselect
- port: {{ .Values.vmstorage.service.vminsertPort }}
targetPort: vminsert
protocol: TCP
name: vminsert
selector:
{{- include "victoria-metrics.vmstorage.matchLabels" . | nindent 4 }}
{{- end -}}

View file

@ -1,139 +0,0 @@
{{- if .Values.vmstorage.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
{{- if .Values.vmstorage.annotations }}
annotations:
{{ toYaml .Values.vmstorage.annotations | indent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmstorage.labels" . | nindent 4 }}
name: {{ template "victoria-metrics.vmstorage.fullname" . }}
spec:
serviceName: {{ template "victoria-metrics.vmstorage.fullname" . }}
selector:
matchLabels:
{{- include "victoria-metrics.vmstorage.matchLabels" . | nindent 6 }}
replicas: {{ .Values.vmstorage.replicaCount }}
podManagementPolicy: {{ .Values.vmstorage.podManagementPolicy }}
template:
metadata:
{{- if .Values.vmstorage.podAnnotations }}
annotations:
{{ toYaml .Values.vmstorage.podAnnotations | indent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmstorage.labels" . | nindent 8 }}
spec:
{{- if .Values.vmstorage.affinity }}
affinity:
{{ toYaml .Values.vmstorage.affinity | indent 8 }}
{{- end }}
{{- if .Values.vmstorage.priorityClassName }}
priorityClassName: "{{ .Values.vmstorage.priorityClassName }}"
{{- end }}
{{- if .Values.vmstorage.schedulerName }}
schedulerName: "{{ .Values.vmstorage.schedulerName }}"
{{- end }}
containers:
- name: {{ template "victoria-metrics.name" . }}-{{ .Values.vmstorage.name }}
image: "{{ .Values.vmstorage.image.repository }}:{{ .Values.vmstorage.image.tag }}"
imagePullPolicy: "{{ .Values.vmstorage.image.pullPolicy }}"
args:
- {{ printf "%s=%d" "--retentionPeriod" (int .Values.vmstorage.retentionPeriod) | quote}}
- {{ printf "%s=%s" "--storageDataPath" .Values.vmstorage.persistentVolume.mountPath | quote}}
{{- range $key, $value := .Values.vmstorage.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
ports:
- name: http
containerPort: 8482
- name: vminsert
containerPort: 8400
- name: vmselect
containerPort: 8401
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
resources:
{{ toYaml .Values.vmstorage.resources | indent 12 }}
volumeMounts:
- name: vmstorage-volume
mountPath: {{ .Values.vmstorage.persistentVolume.mountPath }}
subPath: {{ .Values.vmstorage.persistentVolume.subPath }}
{{- range .Values.vmstorage.extraHostPathMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- range .Values.vmstorage.extraConfigmapMounts }}
- name: {{ $.Values.vmstorage.name }}-{{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- range .Values.vmstorage.extraSecretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.vmstorage.nodeSelector }}
nodeSelector:
{{ toYaml .Values.vmstorage.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.vmstorage.securityContext }}
securityContext:
{{ toYaml .Values.vmstorage.securityContext | indent 8 }}
{{- end }}
{{- if .Values.vmstorage.tolerations }}
tolerations:
{{ toYaml .Values.vmstorage.tolerations | indent 8 }}
{{- end }}
{{- if .Values.vmstorage.affinity }}
affinity:
{{ toYaml .Values.vmstorage.affinity | indent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.vmstorage.terminationGracePeriodSeconds }}
{{- if .Values.vmstorage.persistentVolume.enabled }}
volumeClaimTemplates:
- metadata:
name: vmstorage-volume
{{- if .Values.vmstorage.persistentVolume.annotations }}
annotations:
{{ toYaml .Values.vmstorage.persistentVolume.annotations | indent 10 }}
{{- end }}
spec:
accessModes:
{{ toYaml .Values.vmstorage.persistentVolume.accessModes | indent 10 }}
resources:
requests:
storage: "{{ .Values.vmstorage.persistentVolume.size }}"
{{- if .Values.vmstorage.persistentVolume.storageClass }}
{{- if (eq "-" .Values.vmstorage.persistentVolume.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.vmstorage.persistentVolume.storageClass }}"
{{- end }}
{{- end }}
{{- else }}
volumes:
- name: vmstorage-volume
emptyDir: {}
{{- end }}
{{- end }}

View file

@ -1,259 +0,0 @@
# Default values for victoria-metrics.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
## Tour k8s cluster domain suffix, uses for pods' FQDN
## Ref: https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/
##
clusterDomainSuffix: cluster.local
vmselect:
enabled: true
name: vmselect
image:
repository: victoriametrics/vmselect
tag: v1.27.3-cluster
pullPolicy: IfNotPresent
priorityClassName: ""
extraArgs: {}
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
##
tolerations: []
# - key: "key"
# operator: "Equal|Exists"
# value: "value"
# effect: "NoSchedule|PreferNoSchedule"
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
podAnnotations: {}
replicaCount: 2
resources: {}
# limits:
# cpu: 50m
# memory: 64Mi
# requests:
# cpu: 50m
# memory: 64Mi
securityContext: {}
## Root folder for cache
##
cacheMountPath: /cache
service:
annotations: {}
labels: {}
clusterIP: ""
## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
##
externalIPs: []
loadBalancerIP: ""
loadBalancerSourceRanges: []
servicePort: 8481
type: ClusterIP
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: 'true'
extraLabels: {}
hosts: []
# - name: vmselect.local
# path: /select
tls: []
# - secretName: vmselect-ingress-tls
# hosts:
# - vmselect.local
statefulSet:
## Creates statefulset instead of deployment, useful when you want to keep the cache
enabled: false
podManagementPolicy: OrderedReady
## Headless service for statefulset
service:
annotations: {}
labels: {}
servicePort: 8481
persistentVolume:
## If true, vmselect will create/use a Persistent Volume Claim
## If false, use emptyDir
##
enabled: false
## Must match those of existing PV or dynamic provisioner
## Ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
accessModes:
- ReadWriteOnce
annotations: {}
## Requires vmselect.persistentVolume.enabled: true
## If defined, PVC must be created manually before volume will be bound
existingClaim: ""
## Vmselect data Persistent Volume mount root path
##
size: 2Gi
subPath: ""
serviceMonitor:
enabled: false
extraLabels: {}
annotations: {}
# interval: 15s
# scrapeTimeout: 5s
vminsert:
enabled: true
name: vminsert
image:
repository: victoriametrics/vminsert
tag: v1.27.3-cluster
pullPolicy: IfNotPresent
priorityClassName: ""
extraArgs: {}
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
##
tolerations: []
# - key: "key"
# operator: "Equal|Exists"
# value: "value"
# effect: "NoSchedule|PreferNoSchedule"
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
podAnnotations: {}
replicaCount: 2
resources: {}
# limits:
# cpu: 50m
# memory: 64Mi
# requests:
# cpu: 50m
# memory: 64Mi
securityContext: {}
service:
annotations: {}
labels: {}
clusterIP: ""
## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
##
externalIPs: []
loadBalancerIP: ""
loadBalancerSourceRanges: []
servicePort: 8480
type: ClusterIP
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: 'true'
extraLabels: {}
hosts: []
# - name: vminsert.local
# path: /insert
tls: []
# - secretName: vminsert-ingress-tls
# hosts:
# - vminsert.local
serviceMonitor:
enabled: false
extraLabels: {}
annotations: {}
# interval: 15s
# scrapeTimeout: 5s
vmstorage:
enabled: true
name: vmstorage
image:
repository: victoriametrics/vmstorage
tag: v1.27.3-cluster
pullPolicy: IfNotPresent
priorityClassName: ""
fullnameOverride:
## Data retention period in month
##
retentionPeriod: 1
## Additional vmstorage container arguments
##
extraArgs: {}
## Node tolerations for server scheduling to nodes with taints
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
##
tolerations: []
# - key: "key"
# operator: "Equal|Exists"
# value: "value"
# effect: "NoSchedule|PreferNoSchedule"
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## Pod affinity
##
affinity: {}
## Use an alternate scheduler, e.g. "stork".
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
##
# schedulerName:
persistentVolume:
## If true, vmstorage will create/use a Persistent Volume Claim
## If false, use emptyDir
##
enabled: true
## Must match those of existing PV or dynamic provisioner
## Ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
accessModes:
- ReadWriteOnce
annotations: {}
## Requires vmstorage.persistentVolume.enabled: true
## If defined, PVC must be created manually before volume will be bound
existingClaim: ""
## Vmstorage data Persistent Volume mount root path
##
mountPath: /storage
size: 8Gi
subPath: ""
podAnnotations: {}
replicaCount: 2
podManagementPolicy: OrderedReady
## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
# limits:
# cpu: 500m
# memory: 512Mi
# requests:
# cpu: 500m
# memory: 512Mi
## Security context to be added to server pods
##
securityContext: {}
service:
annotations: {}
labels: {}
servicePort: 8482
vminsertPort: 8400
vmselectPort: 8401
terminationGracePeriodSeconds: 60
serviceMonitor:
enabled: false
extraLabels: {}
annotations: {}
# interval: 15s
# scrapeTimeout: 5s