-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f4f212
commit 5241fe8
Showing
14 changed files
with
107 additions
and
188 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 |
---|---|---|
@@ -1,51 +1,52 @@ | ||
{{- if .Values.printNotes }} | ||
{{- if .Values.server.enabled }} | ||
{{- $ctx := dict "helm" . "appKey" "server" }} | ||
{{- $fullname := include "vm.plain.fullname" $ctx }} | ||
The VictoriaMetrics write api can be accessed via port {{ .Values.server.service.servicePort }} on the following DNS name from within your cluster: | ||
{{ include "victoria-metrics.server.fullname" . }}.{{ include "vm.namespace" . }}.svc.cluster.local | ||
|
||
{{ include "vm.url" $ctx }} | ||
|
||
Metrics Ingestion: | ||
Get the Victoria Metrics service URL by running these commands in the same shell: | ||
|
||
{{- if contains "NodePort" .Values.server.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ include "vm.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "victoria-metrics.server.fullname" . }}) | ||
export NODE_PORT=$(kubectl get --namespace {{ include "vm.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ $fullname }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ include "vm.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.server.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 {{ include "vm.namespace" . }} -w {{ include "victoria-metrics.server.fullname" . }}' | ||
You can watch the status of by running 'kubectl get svc --namespace {{ include "vm.namespace" . }} -w {{ $fullname }}' | ||
|
||
export SERVICE_IP=$(kubectl get svc --namespace {{ include "vm.namespace" . }} {{ include "victoria-metrics.server.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ include "vm.namespace" . }} {{ $fullname }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
echo http://$SERVICE_IP:{{ .Values.server.service.servicePort }} | ||
{{- else if contains "ClusterIP" .Values.server.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ include "vm.namespace" . }} -l "app={{ .Values.server.name }}" -o jsonpath="{.items[0].metadata.name}") | ||
kubectl --namespace {{ include "vm.namespace" . }} port-forward $POD_NAME {{ .Values.server.service.servicePort }} | ||
{{- end }} | ||
|
||
Write url inside the kubernetes cluster: | ||
http://{{ include "victoria-metrics.server.fullname" . }}.{{ include "vm.namespace" . }}.svc.cluster.local:{{ .Values.server.service.servicePort }}/api/v1/write | ||
{{ include "vm.url" $ctx }}/api/v1/write | ||
|
||
{{- if .Values.server.scrape.enabled }} | ||
|
||
Metrics Scrape: | ||
Pull-based scrapes are enabled | ||
Scrape config can be displayed by running this command:: | ||
{{- if eq .Values.server.scrape.configMap "" }} | ||
kubectl get cm {{ include "victoria-metrics.server.fullname" . }}-scrapeconfig -n {{ include "vm.namespace" . }} | ||
kubectl get cm {{ $fullname }}-scrapeconfig -n {{ include "vm.namespace" . }} | ||
{{- else }} | ||
kubectl get cm .Values.server.scrape.configMap -n {{ include "vm.namespace" . }} | ||
{{- end }} | ||
|
||
The target’s information is accessible via api: | ||
Inside cluster: | ||
http://{{ include "victoria-metrics.server.fullname" . }}.{{ include "vm.namespace" . }}.svc.cluster.local:{{ .Values.server.service.servicePort }}/targets | ||
{{ include "vm.url" $ctx }}/targets | ||
Outside cluster: | ||
You need to port-forward service (see instructions above) and call | ||
http://<service-host-port>/targets | ||
{{- end }} | ||
|
||
Read Data: | ||
The following url can be used as the datasource url in Grafana:: | ||
http://{{ include "victoria-metrics.server.fullname" . }}.{{ include "vm.namespace" . }}.svc.cluster.local:{{ .Values.server.service.servicePort }} | ||
{{ include "vm.url" $ctx }} | ||
{{- end }} | ||
{{- 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
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
13 changes: 8 additions & 5 deletions
13
charts/victoria-metrics-single/templates/clusterrolebinding.yaml
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 |
---|---|---|
@@ -1,19 +1,22 @@ | ||
{{- if and .Values.rbac.create (not .Values.rbac.namespaced) .Values.server.scrape.enabled }} | ||
{{- $ctx := dict "helm" . "appKey" "server" }} | ||
{{- $fullname := include "vm.plain.fullname" $ctx }} | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "victoria-metrics.fullname" . }}-clusterrolebinding | ||
{{- $ctx := merge (deepCopy .) (dict "extraLabels" .Values.rbac.extraLabels) }} | ||
labels: {{ include "victoria-metrics.common.metaLabels" $ctx | nindent 4 }} | ||
name: {{ $fullname }}-clusterrolebinding | ||
{{- $_ := set $ctx "extraLabels" .Values.rbac.extraLabels }} | ||
labels: {{ include "vm.metaLabels" $ctx | nindent 4 }} | ||
{{- $_ := unset $ctx "extraLabels" }} | ||
{{- with .Values.rbac.annotations }} | ||
annotations: {{ toYaml . | nindent 4 }} | ||
{{- end }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "victoria-metrics.serviceAccountName" . }} | ||
name: {{ .Values.serviceAccount.name | default $fullname }} | ||
namespace: {{ include "vm.namespace" . }} | ||
roleRef: | ||
kind: ClusterRole | ||
name: {{ include "victoria-metrics.fullname" . }}-clusterrole | ||
name: {{ $fullname }}-clusterrole | ||
apiGroup: rbac.authorization.k8s.io | ||
{{- 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
6 changes: 4 additions & 2 deletions
6
charts/victoria-metrics-single/templates/relabel-configmap.yaml
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
{{- if and .Values.server.relabel.enabled (eq .Values.server.relabel.configMap "") }} | ||
{{- $ctx := dict "helm" . "appKey" "server" }} | ||
{{- $fullname := include "vm.plain.fullname" $ctx }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "victoria-metrics.server.fullname" . }}-relabelconfig | ||
name: {{ $fullname }}-relabelconfig | ||
namespace: {{ include "vm.namespace" . }} | ||
labels: {{ include "victoria-metrics.server.labels" . | nindent 4 }} | ||
labels: {{ include "vm.labels" $ctx | nindent 4 }} | ||
data: | ||
relabel.yml: |{{ toYaml .Values.server.relabel.config | nindent 4 }} | ||
{{- end }} |
6 changes: 4 additions & 2 deletions
6
charts/victoria-metrics-single/templates/scrape-configmap.yaml
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
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
Oops, something went wrong.