From 5e2cb78cce4353b532243101ef8e22f2cad9df97 Mon Sep 17 00:00:00 2001 From: Andrii Chubatiuk Date: Fri, 1 Nov 2024 17:13:59 +0200 Subject: [PATCH] Updated k8s guides (#7411) ### Describe Your Changes - updated dependencies versions - removed Helm v2 from docs - fixed VMAgent configuration ### Checklist The following checks are **mandatory**: - [ ] My change adheres [VictoriaMetrics contributing guidelines](https://docs.victoriametrics.com/contributing/). --- .../examples/guide-vmcluster-vmagent-values.yaml | 6 +++--- .../k8s-ha-monitoring-via-vm-cluster/README.md | 7 +++---- .../k8s-monitoring-via-vm-cluster/README.md | 16 +++++++--------- .../k8s-monitoring-via-vm-single/README.md | 8 +++----- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/docs/guides/examples/guide-vmcluster-vmagent-values.yaml b/docs/guides/examples/guide-vmcluster-vmagent-values.yaml index 008b136a9..4eaa09676 100644 --- a/docs/guides/examples/guide-vmcluster-vmagent-values.yaml +++ b/docs/guides/examples/guide-vmcluster-vmagent-values.yaml @@ -1,5 +1,5 @@ -remoteWriteUrls: - - http://vmcluster-victoria-metrics-cluster-vminsert.default.svc.cluster.local:8480/insert/0/prometheus/ +remoteWrite: + - url: http://vmcluster-victoria-metrics-cluster-vminsert.default.svc.cluster.local:8480/insert/0/prometheus/ config: global: @@ -219,4 +219,4 @@ config: target_label: kubernetes_namespace - source_labels: [__meta_kubernetes_pod_name] action: replace - target_label: kubernetes_pod_name \ No newline at end of file + target_label: kubernetes_pod_name diff --git a/docs/guides/k8s-ha-monitoring-via-vm-cluster/README.md b/docs/guides/k8s-ha-monitoring-via-vm-cluster/README.md index efc8c4fb8..c1075365e 100644 --- a/docs/guides/k8s-ha-monitoring-via-vm-cluster/README.md +++ b/docs/guides/k8s-ha-monitoring-via-vm-cluster/README.md @@ -144,8 +144,8 @@ helm install vmagent vm/victoria-metrics-agent -f https://docs.victoriametrics.c Here is full file content `guide-vmcluster-vmagent-values.yaml` ```yaml -remoteWriteUrls: - - http://vmcluster-victoria-metrics-cluster-vminsert.default.svc.cluster.local:8480/insert/0/prometheus/ +remoteWrite: + - url: http://vmcluster-victoria-metrics-cluster-vminsert.default.svc.cluster.local:8480/insert/0/prometheus/ scrape_configs: - job_name: vmagent @@ -222,8 +222,7 @@ scrape_configs: target_label: systemd_service_name replacement: '${1}' ``` - -* `remoteWriteUrls: - http://vmcluster-victoria-metrics-cluster-vminsert.default.svc.cluster.local:8480/insert/0/prometheus/` configures `vmagent` to write scraped metrics to the `vmselect service`. +* By updating `remoteWrite` we configuring [vmagent](https://docs.victoriametrics.com/vmagent/) to write scraped metrics into the `vminsert` service. * The `metric_relabel_configs` section allows you to process Kubernetes metrics for the Grafana dashboard. diff --git a/docs/guides/k8s-monitoring-via-vm-cluster/README.md b/docs/guides/k8s-monitoring-via-vm-cluster/README.md index 083d0010d..555e885b4 100644 --- a/docs/guides/k8s-monitoring-via-vm-cluster/README.md +++ b/docs/guides/k8s-monitoring-via-vm-cluster/README.md @@ -8,17 +8,15 @@ **Precondition** We will use: -* [Kubernetes cluster 1.19.9-gke.1900](https://cloud.google.com/kubernetes-engine) -> We use GKE cluster from [GCP](https://cloud.google.com/) but this guide also applies on any Kubernetes cluster. For example [Amazon EKS](https://aws.amazon.com/ru/eks/). -* [Helm 3 ](https://helm.sh/docs/intro/install) -* [kubectl 1.21](https://kubernetes.io/docs/tasks/tools/install-kubectl) +* [Kubernetes cluster 1.31.1-gke.1678000](https://cloud.google.com/kubernetes-engine) +> We use GKE cluster from [GCP](https://cloud.google.com/) but this guide is also applied on any Kubernetes cluster. For example [Amazon EKS](https://aws.amazon.com/ru/eks/). +* [Helm 3.14+](https://helm.sh/docs/intro/install) +* [kubectl 1.31](https://kubernetes.io/docs/tasks/tools/install-kubectl) ![VMCluster on K8s](scheme.webp) ## 1. VictoriaMetrics Helm repository -> For this guide we will use Helm 3 but if you already use Helm 2 please see this [https://github.com/VictoriaMetrics/helm-charts#for-helm-v2](https://github.com/VictoriaMetrics/helm-charts#for-helm-v2) - You need to add the VictoriaMetrics Helm repository to install VictoriaMetrics components. We’re going to use [VictoriaMetrics Cluster](https://docs.victoriametrics.com/cluster-victoriametrics/). You can do this by running the following command: ```shell @@ -166,8 +164,8 @@ helm install vmagent vm/victoria-metrics-agent -f https://docs.victoriametrics.c Here is full file content `guide-vmcluster-vmagent-values.yaml` ```yaml -remoteWriteUrls: - - http://vmcluster-victoria-metrics-cluster-vminsert.default.svc.cluster.local:8480/insert/0/prometheus/ +remoteWrite: + - url: http://vmcluster-victoria-metrics-cluster-vminsert.default.svc.cluster.local:8480/insert/0/prometheus/ config: global: @@ -390,7 +388,7 @@ config: target_label: kubernetes_pod_name ``` -* By adding `remoteWriteUrls: - http://vmcluster-victoria-metrics-cluster-vminsert.default.svc.cluster.local:8480/insert/0/prometheus/` we configuring [vmagent](https://docs.victoriametrics.com/vmagent/) to write scraped metrics into the `vmselect service`. +* By updating `remoteWrite` we configuring [vmagent](https://docs.victoriametrics.com/vmagent/) to write scraped metrics into the `vminsert` service. * The second part of this yaml file is needed to add the `metric_relabel_configs` section that helps us to show Kubernetes metrics on the Grafana dashboard. diff --git a/docs/guides/k8s-monitoring-via-vm-single/README.md b/docs/guides/k8s-monitoring-via-vm-single/README.md index 91343e6f7..3e739b3d8 100644 --- a/docs/guides/k8s-monitoring-via-vm-single/README.md +++ b/docs/guides/k8s-monitoring-via-vm-single/README.md @@ -8,17 +8,15 @@ **Precondition** We will use: -* [Kubernetes cluster 1.19.9-gke.1900](https://cloud.google.com/kubernetes-engine) +* [Kubernetes cluster 1.31.1-gke.1678000](https://cloud.google.com/kubernetes-engine) > We use GKE cluster from [GCP](https://cloud.google.com/) but this guide is also applied on any Kubernetes cluster. For example [Amazon EKS](https://aws.amazon.com/ru/eks/). -* [Helm 3 ](https://helm.sh/docs/intro/install) -* [kubectl 1.21](https://kubernetes.io/docs/tasks/tools/install-kubectl) +* [Helm 3.14+](https://helm.sh/docs/intro/install) +* [kubectl 1.31](https://kubernetes.io/docs/tasks/tools/install-kubectl) ![VictoriaMetrics Single on Kubernetes cluster](k8s-scheme.webp) ## 1. VictoriaMetrics Helm repository -> For this guide we will use Helm 3 but if you already use Helm 2 please see this [https://github.com/VictoriaMetrics/helm-charts#for-helm-v2](https://github.com/VictoriaMetrics/helm-charts#for-helm-v2) - You need to add the VictoriaMetrics Helm repository to install VictoriaMetrics components. We’re going to use [VictoriaMetrics Single](https://docs.victoriametrics.com/single-server-victoriametrics/). You can do this by running the following command: