From 258eecdab4e62e1a7bc015f66ff3395d0cd5d16b Mon Sep 17 00:00:00 2001 From: sh2 Date: Sat, 22 Jun 2024 17:33:18 +0800 Subject: [PATCH] follow-up: update docs and ci pipeline to utilize gateway-addons-helm (#3610) * update opentelemetry-collector version Signed-off-by: shawnh2 * update makefile cmd to utilize gateway-addons-helm Signed-off-by: shawnh2 * update docs according to gateway-addons-helm Signed-off-by: shawnh2 * correct prometheus server name config Signed-off-by: shawnh2 * fix e2e test labels Signed-off-by: shawnh2 * correct grafana datasource url Signed-off-by: shawnh2 * add template doc Signed-off-by: shawnh2 * specify helm-generate Signed-off-by: shawnh2 * remove tags Signed-off-by: shawnh2 * fix gen-check Signed-off-by: shawnh2 --------- Signed-off-by: shawnh2 --- charts/gateway-addons-helm/Chart.lock | 6 +- charts/gateway-addons-helm/Chart.yaml | 14 +- charts/gateway-addons-helm/README.md | 9 +- charts/gateway-addons-helm/values.yaml | 10 +- examples/fluent-bit/README.md | 8 - examples/fluent-bit/helm-values.yaml | 61 ---- examples/grafana/helm-values.yaml | 12 - examples/loki/loki.yaml | 282 ------------------ examples/otel-collector/helm-values.yaml | 55 ---- examples/prometheus/helm-values.yaml | 24 -- examples/tempo/helm-values.yaml | 2 - .../latest/install/gateway-addons-helm-api.md | 9 +- .../observability/gateway-observability.md | 12 +- .../observability/grafana-integration.md | 20 +- .../observability/proxy-observability.md | 32 +- .../observability/rate-limit-observability.md | 13 +- .../content/en/template/o11y_prerequisites.md | 12 + .../latest/install/gateway-addons-helm-api.md | 9 +- test/e2e/testdata/metric.yaml | 2 +- tools/make/kube.mk | 54 +--- 20 files changed, 42 insertions(+), 604 deletions(-) delete mode 100644 examples/fluent-bit/README.md delete mode 100644 examples/fluent-bit/helm-values.yaml delete mode 100644 examples/grafana/helm-values.yaml delete mode 100644 examples/loki/loki.yaml delete mode 100644 examples/otel-collector/helm-values.yaml delete mode 100644 examples/prometheus/helm-values.yaml delete mode 100644 examples/tempo/helm-values.yaml create mode 100644 site/content/en/template/o11y_prerequisites.md diff --git a/charts/gateway-addons-helm/Chart.lock b/charts/gateway-addons-helm/Chart.lock index 297e11c9610..4b6f92ac77c 100644 --- a/charts/gateway-addons-helm/Chart.lock +++ b/charts/gateway-addons-helm/Chart.lock @@ -16,6 +16,6 @@ dependencies: version: 1.3.1 - name: opentelemetry-collector repository: https://open-telemetry.github.io/opentelemetry-helm-charts - version: 0.60.0 -digest: sha256:52aabfaf2c568f7b77da5cf5a771e936e052df2c66afdfd53a2c892452f06d6b -generated: "2024-06-11T22:19:54.569241+08:00" + version: 0.73.1 +digest: sha256:4c16df8d7efc27aff566fa5dfd2eba6527adbf3fc8e94e7e3ccfc0cee7836f1c +generated: "2024-06-20T11:46:59.148579+08:00" diff --git a/charts/gateway-addons-helm/Chart.yaml b/charts/gateway-addons-helm/Chart.yaml index 3d40fbf7d2d..84ac6228f62 100644 --- a/charts/gateway-addons-helm/Chart.yaml +++ b/charts/gateway-addons-helm/Chart.yaml @@ -29,35 +29,23 @@ dependencies: version: 25.21.0 repository: https://prometheus-community.github.io/helm-charts condition: prometheus.enabled - tags: - - metrics - name: grafana repository: https://grafana.github.io/helm-charts version: 8.0.0 condition: grafana.enabled - tags: - - metrics - name: fluent-bit repository: https://fluent.github.io/helm-charts version: 0.30.4 condition: fluent-bit.enabled - tags: - - logging - name: loki version: 4.8.0 repository: https://grafana.github.io/helm-charts condition: loki.enabled - tags: - - logging - name: tempo repository: https://grafana.github.io/helm-charts version: 1.3.1 condition: tempo.enabled - tags: - - tracing - name: opentelemetry-collector repository: https://open-telemetry.github.io/opentelemetry-helm-charts - version: 0.60.0 + version: 0.73.1 condition: opentelemetry-collector.enabled - tags: - - metrics diff --git a/charts/gateway-addons-helm/README.md b/charts/gateway-addons-helm/README.md index b5d9388d9dc..7d545d0b90f 100644 --- a/charts/gateway-addons-helm/README.md +++ b/charts/gateway-addons-helm/README.md @@ -25,7 +25,7 @@ An Add-ons Helm chart for Envoy Gateway | https://grafana.github.io/helm-charts | grafana | 8.0.0 | | https://grafana.github.io/helm-charts | loki | 4.8.0 | | https://grafana.github.io/helm-charts | tempo | 1.3.1 | -| https://open-telemetry.github.io/opentelemetry-helm-charts | opentelemetry-collector | 0.60.0 | +| https://open-telemetry.github.io/opentelemetry-helm-charts | opentelemetry-collector | 0.73.1 | | https://prometheus-community.github.io/helm-charts | prometheus | 25.21.0 | ## Usage @@ -79,7 +79,7 @@ To uninstall the chart: | grafana.datasources."datasources.yaml".apiVersion | int | `1` | | | grafana.datasources."datasources.yaml".datasources[0].name | string | `"Prometheus"` | | | grafana.datasources."datasources.yaml".datasources[0].type | string | `"prometheus"` | | -| grafana.datasources."datasources.yaml".datasources[0].url | string | `"http://prometheus-server"` | | +| grafana.datasources."datasources.yaml".datasources[0].url | string | `"http://prometheus"` | | | grafana.enabled | bool | `true` | | | grafana.fullnameOverride | string | `"grafana"` | | | grafana.service.type | string | `"LoadBalancer"` | | @@ -125,16 +125,13 @@ To uninstall the chart: | prometheus.kube-state-metrics.enabled | bool | `false` | | | prometheus.prometheus-node-exporter.enabled | bool | `false` | | | prometheus.prometheus-pushgateway.enabled | bool | `false` | | -| prometheus.server.fullnameOverride | string | `"prometheus-server"` | | +| prometheus.server.fullnameOverride | string | `"prometheus"` | | | prometheus.server.global.scrape_interval | string | `"15s"` | | | prometheus.server.image.repository | string | `"prom/prometheus"` | | | prometheus.server.persistentVolume.enabled | bool | `false` | | | prometheus.server.readinessProbeInitialDelay | int | `0` | | | prometheus.server.securityContext | object | `{}` | | | prometheus.server.service.type | string | `"LoadBalancer"` | | -| tags.logging | bool | `false` | | -| tags.metrics | bool | `true` | | -| tags.tracing | bool | `false` | | | tempo.enabled | bool | `true` | | | tempo.fullnameOverride | string | `"tempo"` | | | tempo.service.type | string | `"LoadBalancer"` | | diff --git a/charts/gateway-addons-helm/values.yaml b/charts/gateway-addons-helm/values.yaml index e810eaf0a03..e63e0bdee72 100644 --- a/charts/gateway-addons-helm/values.yaml +++ b/charts/gateway-addons-helm/values.yaml @@ -1,9 +1,3 @@ -tags: - metrics: true - logging: false - tracing: false - - # Values for Grafana dependency grafana: enabled: true @@ -14,7 +8,7 @@ grafana: datasources: - name: Prometheus type: prometheus - url: http://prometheus-server + url: http://prometheus adminPassword: admin service: type: LoadBalancer @@ -47,7 +41,7 @@ prometheus: prometheus-node-exporter: enabled: false server: - fullnameOverride: prometheus-server + fullnameOverride: prometheus persistentVolume: enabled: false readinessProbeInitialDelay: 0 diff --git a/examples/fluent-bit/README.md b/examples/fluent-bit/README.md deleted file mode 100644 index e6221742d6d..00000000000 --- a/examples/fluent-bit/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Fluent-bit - - -``` -helm repo add fluent https://fluent.github.io/helm-charts -helm repo update -helm upgrade --install fluent-bit fluent/fluent-bit -f examples/fluent-bit/helm-values.yaml -n monitoring --create-namespace --version 0.30.4 -``` \ No newline at end of file diff --git a/examples/fluent-bit/helm-values.yaml b/examples/fluent-bit/helm-values.yaml deleted file mode 100644 index 8e6edf6c50e..00000000000 --- a/examples/fluent-bit/helm-values.yaml +++ /dev/null @@ -1,61 +0,0 @@ -testFramework: - enabled: false -podAnnotations: - prometheus.io/scrape: "true" - prometheus.io/port: "2020" - prometheus.io/path: /api/v1/metrics/prometheus - fluentbit.io/exclude: "true" -## https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/classic-mode/configuration-file -config: - service: | - [SERVICE] - Daemon Off - Flush {{ .Values.flush }} - Log_Level {{ .Values.logLevel }} - Parsers_File parsers.conf - Parsers_File custom_parsers.conf - HTTP_Server On - HTTP_Listen 0.0.0.0 - HTTP_Port {{ .Values.metricsPort }} - Health_Check On - - ## https://docs.fluentbit.io/manual/pipeline/inputs - inputs: | - [INPUT] - Name tail - Path /var/log/containers/*.log - multiline.parser docker, cri - Tag kube.* - Mem_Buf_Limit 5MB - Skip_Long_Lines On - - ## https://docs.fluentbit.io/manual/pipeline/filters - filters: | - [FILTER] - Name kubernetes - Match kube.* - Merge_Log On - Keep_Log Off - K8S-Logging.Parser On - K8S-Logging.Exclude On - - [FILTER] - Name grep - Match kube.* - Regex $kubernetes['container_name'] ^envoy$ - - [FILTER] - Name parser - Match kube.* - Key_Name log - Parser envoy - Reserve_Data True - - ## https://docs.fluentbit.io/manual/pipeline/outputs - outputs: | - [OUTPUT] - Name loki - Match kube.* - Host loki.monitoring.svc.cluster.local - Port 3100 - Labels job=fluentbit, app=$kubernetes['labels']['app'], k8s_namespace_name=$kubernetes['namespace_name'], k8s_pod_name=$kubernetes['pod_name'], k8s_container_name=$kubernetes['container_name'] diff --git a/examples/grafana/helm-values.yaml b/examples/grafana/helm-values.yaml deleted file mode 100644 index 49000b76798..00000000000 --- a/examples/grafana/helm-values.yaml +++ /dev/null @@ -1,12 +0,0 @@ -datasources: - datasources.yaml: - apiVersion: 1 - datasources: - - name: Prometheus - type: prometheus - url: http://prometheus-server - -adminPassword: admin - -service: - type: LoadBalancer diff --git a/examples/loki/loki.yaml b/examples/loki/loki.yaml deleted file mode 100644 index 3f15a75b45e..00000000000 --- a/examples/loki/loki.yaml +++ /dev/null @@ -1,282 +0,0 @@ ---- -# Source: loki/templates/serviceaccount.yaml -apiVersion: v1 -kind: ServiceAccount -metadata: - name: loki - labels: - helm.sh/chart: loki-4.8.0 - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/version: "2.7.3" - app.kubernetes.io/managed-by: Helm -automountServiceAccountToken: true ---- -# Source: loki/templates/configmap.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: loki - labels: - helm.sh/chart: loki-4.8.0 - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/version: "2.7.3" - app.kubernetes.io/managed-by: Helm -data: - config.yaml: | - auth_enabled: false - common: - compactor_address: 'loki' - path_prefix: /var/loki - replication_factor: 1 - storage: - filesystem: - chunks_directory: /var/loki/chunks - rules_directory: /var/loki/rules - limits_config: - enforce_metric_name: false - max_cache_freshness_per_query: 10m - reject_old_samples: true - reject_old_samples_max_age: 168h - split_queries_by_interval: 15m - memberlist: - join_members: - - loki-memberlist - query_range: - align_queries_with_step: true - ruler: - storage: - type: local - runtime_config: - file: /etc/loki/runtime-config/runtime-config.yaml - schema_config: - configs: - - from: "2022-01-11" - index: - period: 24h - prefix: loki_index_ - object_store: filesystem - schema: v12 - store: boltdb-shipper - server: - grpc_listen_port: 9095 - http_listen_port: 3100 - storage_config: - hedging: - at: 250ms - max_per_second: 20 - up_to: 3 - table_manager: - retention_deletes_enabled: false - retention_period: 0 ---- -# Source: loki/templates/runtime-configmap.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: loki-runtime - labels: - helm.sh/chart: loki-4.8.0 - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/version: "2.7.3" - app.kubernetes.io/managed-by: Helm -data: - runtime-config.yaml: | - - {} ---- -# Source: loki/templates/service-memberlist.yaml -apiVersion: v1 -kind: Service -metadata: - name: loki-memberlist - labels: - helm.sh/chart: loki-4.8.0 - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/version: "2.7.3" - app.kubernetes.io/managed-by: Helm -spec: - type: ClusterIP - clusterIP: None - ports: - - name: tcp - port: 7946 - targetPort: http-memberlist - protocol: TCP - selector: - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/part-of: memberlist ---- -# Source: loki/templates/single-binary/service-headless.yaml -apiVersion: v1 -kind: Service -metadata: - name: loki-headless - labels: - helm.sh/chart: loki-4.8.0 - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/version: "2.7.3" - app.kubernetes.io/managed-by: Helm - variant: headless - prometheus.io/service-monitor: "false" -spec: - clusterIP: None - ports: - - name: http-metrics - port: 3100 - targetPort: http-metrics - protocol: TCP - selector: - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki ---- -# Source: loki/templates/single-binary/service.yaml -apiVersion: v1 -kind: Service -metadata: - name: loki - labels: - helm.sh/chart: loki-4.8.0 - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/version: "2.7.3" - app.kubernetes.io/managed-by: Helm -spec: - type: LoadBalancer - ports: - - name: http-metrics - port: 3100 - targetPort: http-metrics - protocol: TCP - - name: grpc - port: 9095 - targetPort: grpc - protocol: TCP - selector: - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/component: single-binary ---- -# Source: loki/templates/single-binary/statefulset.yaml -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: loki - labels: - helm.sh/chart: loki-4.8.0 - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/version: "2.7.3" - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/component: single-binary - app.kubernetes.io/part-of: memberlist -spec: - replicas: 1 - podManagementPolicy: Parallel - updateStrategy: - rollingUpdate: - partition: 0 - serviceName: loki-headless - revisionHistoryLimit: 10 - - persistentVolumeClaimRetentionPolicy: - whenDeleted: Delete - whenScaled: Delete - selector: - matchLabels: - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/component: single-binary - template: - metadata: - annotations: - checksum/config: a9239b6352e34bbfc748669ed46cb24211fc3491ee7f2c6381af805f8f08fe29 - labels: - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/component: single-binary - app.kubernetes.io/part-of: memberlist - spec: - serviceAccountName: loki - automountServiceAccountToken: true - enableServiceLinks: true - - securityContext: - fsGroup: 10001 - runAsGroup: 10001 - runAsNonRoot: true - runAsUser: 10001 - terminationGracePeriodSeconds: 30 - containers: - - name: loki - image: docker.io/grafana/loki:2.7.3 - imagePullPolicy: IfNotPresent - args: - - -config.file=/etc/loki/config/config.yaml - - -target=all - ports: - - name: http-metrics - containerPort: 3100 - protocol: TCP - - name: grpc - containerPort: 9095 - protocol: TCP - - name: http-memberlist - containerPort: 7946 - protocol: TCP - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - readinessProbe: - httpGet: - path: /ready - port: http-metrics - initialDelaySeconds: 30 - timeoutSeconds: 1 - volumeMounts: - - name: tmp - mountPath: /tmp - - name: config - mountPath: /etc/loki/config - - name: runtime-config - mountPath: /etc/loki/runtime-config - - name: storage - mountPath: /var/loki - resources: - {} - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchLabels: - app.kubernetes.io/name: loki - app.kubernetes.io/instance: loki - app.kubernetes.io/component: single-binary - topologyKey: kubernetes.io/hostname - - volumes: - - name: tmp - emptyDir: {} - - name: config - configMap: - name: loki - - name: runtime-config - configMap: - name: loki-runtime - volumeClaimTemplates: - - metadata: - name: storage - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: "10Gi" diff --git a/examples/otel-collector/helm-values.yaml b/examples/otel-collector/helm-values.yaml deleted file mode 100644 index 465005bdedf..00000000000 --- a/examples/otel-collector/helm-values.yaml +++ /dev/null @@ -1,55 +0,0 @@ -fullnameOverride: otel-collector -mode: deployment -config: - exporters: - prometheus: - endpoint: 0.0.0.0:19001 - logging: - verbosity: detailed - loki: - endpoint: "http://loki.monitoring.svc:3100/loki/api/v1/push" - otlp: - endpoint: tempo.monitoring.svc:4317 - tls: - insecure: true - extensions: - # The health_check extension is mandatory for this chart. - # Without the health_check extension the collector will fail the readiness and liveliness probes. - # The health_check extension can be modified, but should never be removed. - health_check: {} - processors: - attributes: - actions: - - action: insert - key: loki.attribute.labels - # k8s.pod.name is OpenTelemetry format for Kubernetes Pod name, - # Loki will convert this to k8s_pod_name label. - value: k8s.pod.name, k8s.namespace.name - receivers: - otlp: - protocols: - grpc: - endpoint: ${env:MY_POD_IP}:4317 - http: - endpoint: ${env:MY_POD_IP}:4318 - service: - extensions: - - health_check - pipelines: - metrics: - exporters: - - prometheus - receivers: - - otlp - logs: - exporters: - - loki - processors: - - attributes - receivers: - - otlp - traces: - exporters: - - otlp - receivers: - - otlp diff --git a/examples/prometheus/helm-values.yaml b/examples/prometheus/helm-values.yaml deleted file mode 100644 index 7cee4e7bcee..00000000000 --- a/examples/prometheus/helm-values.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# To simplify the deployment, disable non-essential components -alertmanager: - enabled: false -prometheus-pushgateway: - enabled: false -kube-state-metrics: - enabled: false -prometheus-node-exporter: - enabled: false -server: - fullnameOverride: prometheus - persistentVolume: - enabled: false - readinessProbeInitialDelay: 0 - global: - # Speed up scraping a bit from the default - scrape_interval: 15s - service: - # use LoadBalancer to expose prometheus - type: LoadBalancer - # use dockerhub - image: - repository: prom/prometheus - securityContext: null diff --git a/examples/tempo/helm-values.yaml b/examples/tempo/helm-values.yaml deleted file mode 100644 index 42838b76e43..00000000000 --- a/examples/tempo/helm-values.yaml +++ /dev/null @@ -1,2 +0,0 @@ -service: - type: LoadBalancer diff --git a/site/content/en/latest/install/gateway-addons-helm-api.md b/site/content/en/latest/install/gateway-addons-helm-api.md index 4401cc03efe..5401fbe7f83 100644 --- a/site/content/en/latest/install/gateway-addons-helm-api.md +++ b/site/content/en/latest/install/gateway-addons-helm-api.md @@ -27,7 +27,7 @@ An Add-ons Helm chart for Envoy Gateway | https://grafana.github.io/helm-charts | grafana | 8.0.0 | | https://grafana.github.io/helm-charts | loki | 4.8.0 | | https://grafana.github.io/helm-charts | tempo | 1.3.1 | -| https://open-telemetry.github.io/opentelemetry-helm-charts | opentelemetry-collector | 0.60.0 | +| https://open-telemetry.github.io/opentelemetry-helm-charts | opentelemetry-collector | 0.73.1 | | https://prometheus-community.github.io/helm-charts | prometheus | 25.21.0 | ## Values @@ -58,7 +58,7 @@ An Add-ons Helm chart for Envoy Gateway | grafana.datasources."datasources.yaml".apiVersion | int | `1` | | | grafana.datasources."datasources.yaml".datasources[0].name | string | `"Prometheus"` | | | grafana.datasources."datasources.yaml".datasources[0].type | string | `"prometheus"` | | -| grafana.datasources."datasources.yaml".datasources[0].url | string | `"http://prometheus-server"` | | +| grafana.datasources."datasources.yaml".datasources[0].url | string | `"http://prometheus"` | | | grafana.enabled | bool | `true` | | | grafana.fullnameOverride | string | `"grafana"` | | | grafana.service.type | string | `"LoadBalancer"` | | @@ -104,16 +104,13 @@ An Add-ons Helm chart for Envoy Gateway | prometheus.kube-state-metrics.enabled | bool | `false` | | | prometheus.prometheus-node-exporter.enabled | bool | `false` | | | prometheus.prometheus-pushgateway.enabled | bool | `false` | | -| prometheus.server.fullnameOverride | string | `"prometheus-server"` | | +| prometheus.server.fullnameOverride | string | `"prometheus"` | | | prometheus.server.global.scrape_interval | string | `"15s"` | | | prometheus.server.image.repository | string | `"prom/prometheus"` | | | prometheus.server.persistentVolume.enabled | bool | `false` | | | prometheus.server.readinessProbeInitialDelay | int | `0` | | | prometheus.server.securityContext | object | `{}` | | | prometheus.server.service.type | string | `"LoadBalancer"` | | -| tags.logging | bool | `false` | | -| tags.metrics | bool | `true` | | -| tags.tracing | bool | `false` | | | tempo.enabled | bool | `true` | | | tempo.fullnameOverride | string | `"tempo"` | | | tempo.service.type | string | `"LoadBalancer"` | | diff --git a/site/content/en/latest/tasks/observability/gateway-observability.md b/site/content/en/latest/tasks/observability/gateway-observability.md index 745821e3ddd..93ed8114bcc 100644 --- a/site/content/en/latest/tasks/observability/gateway-observability.md +++ b/site/content/en/latest/tasks/observability/gateway-observability.md @@ -7,17 +7,7 @@ This task show you how to config gateway control-plane observability, includes m ## Prerequisites -Follow the steps from the [Quickstart](../quickstart) to install Envoy Gateway and the example manifest. -Before proceeding, you should be able to query the example backend using HTTP. - -[OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) offers a vendor-agnostic implementation of how to receive, process and export telemetry data. -Install OTel-Collector: - -```shell -helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts -helm repo update -helm upgrade --install otel-collector open-telemetry/opentelemetry-collector -f https://raw.githubusercontent.com/envoyproxy/gateway/latest/examples/otel-collector/helm-values.yaml -n monitoring --create-namespace --version 0.60.0 -``` +{{% readfile "../../../template/o11y_prerequisites.md" %}} ## Metrics diff --git a/site/content/en/latest/tasks/observability/grafana-integration.md b/site/content/en/latest/tasks/observability/grafana-integration.md index f86b382278c..e8cbe7e2942 100644 --- a/site/content/en/latest/tasks/observability/grafana-integration.md +++ b/site/content/en/latest/tasks/observability/grafana-integration.md @@ -7,29 +7,11 @@ This task shows you how to visualise the metrics exposed to Prometheus using Gra ## Prerequisites -Follow the steps from the [Quickstart](../../quickstart) to install Envoy Gateway and the example manifest. -Before proceeding, you should be able to query the example backend using HTTP. +{{% readfile "../../../template/o11y_prerequisites.md" %}} Follow the steps from the [Gateway Observability](../gateway-observability) and [Proxy Observability](../proxy-observability#metrics) to enable Prometheus metrics for both Envoy Gateway (Control Plane) and Envoy Proxy (Data Plane). -[Prometheus](https://prometheus.io) is used to scrape metrics from the Envoy Gateway and Envoy Proxy instances. Install Prometheus: - -```shell -helm repo add prometheus-community https://prometheus-community.github.io/helm-charts -helm repo update -helm upgrade --install prometheus prometheus-community/prometheus -n monitoring --create-namespace -``` - -[Grafana](https://grafana.com/grafana/) is used to visualise the metrics exposed by the Envoy Gateway and Envoy Proxy instances. -Install Grafana: - -```shell -helm repo add grafana https://grafana.github.io/helm-charts -helm repo update -helm upgrade --install grafana grafana/grafana -f https://raw.githubusercontent.com/envoyproxy/gateway/latest/examples/grafana/helm-values.yaml -n monitoring --create-namespace -``` - Expose endpoints: ```shell diff --git a/site/content/en/latest/tasks/observability/proxy-observability.md b/site/content/en/latest/tasks/observability/proxy-observability.md index 90cab919325..5f24a76eaa9 100644 --- a/site/content/en/latest/tasks/observability/proxy-observability.md +++ b/site/content/en/latest/tasks/observability/proxy-observability.md @@ -7,38 +7,12 @@ This task show you how to config proxy observability, includes metrics, logs, an ## Prerequisites -Follow the steps from the [Quickstart](../quickstart) to install Envoy Gateway and the example manifest. -Before proceeding, you should be able to query the example backend using HTTP. +{{% readfile "../../../template/o11y_prerequisites.md" %}} -[FluentBit](https://fluentbit.io/) is used to collect logs from the EnvoyProxy instances and forward them to Loki. Install FluentBit: +By default, the Service type of `loki` is ClusterIP, you can change it to LoadBalancer type for further usage: ```shell -helm repo add fluent https://fluent.github.io/helm-charts -helm repo update -helm upgrade --install fluent-bit fluent/fluent-bit -f https://raw.githubusercontent.com/envoyproxy/gateway/latest/examples/fluent-bit/helm-values.yaml -n monitoring --create-namespace --version 0.30.4 -``` - -[Loki](https://grafana.com/oss/loki/) is used to store logs. Install Loki: - -```shell -kubectl apply -f https://raw.githubusercontent.com/envoyproxy/gateway/latest/examples/loki/loki.yaml -n monitoring -``` - -[Tempo](https://grafana.com/oss/tempo/) is used to store traces. Install Tempo: - -```shell -helm repo add grafana https://grafana.github.io/helm-charts -helm repo update -helm upgrade --install tempo grafana/tempo -f https://raw.githubusercontent.com/envoyproxy/gateway/latest/examples/tempo/helm-values.yaml -n monitoring --create-namespace --version 1.3.1 -``` - -[OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) offers a vendor-agnostic implementation of how to receive, process and export telemetry data. -Install OTel-Collector: - -```shell -helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts -helm repo update -helm upgrade --install otel-collector open-telemetry/opentelemetry-collector -f https://raw.githubusercontent.com/envoyproxy/gateway/latest/examples/otel-collector/helm-values.yaml -n monitoring --create-namespace --version 0.60.0 +kubectl patch service loki -n monitoring -p '{"spec": {"type": "LoadBalancer"}}' ``` Expose endpoints: diff --git a/site/content/en/latest/tasks/observability/rate-limit-observability.md b/site/content/en/latest/tasks/observability/rate-limit-observability.md index 478b85859b9..2cad2369d68 100644 --- a/site/content/en/latest/tasks/observability/rate-limit-observability.md +++ b/site/content/en/latest/tasks/observability/rate-limit-observability.md @@ -7,18 +7,9 @@ This guide show you how to config RateLimit observability, includes traces. ## Prerequisites -Follow the steps from the [Quickstart Guide](../quickstart) to install Envoy Gateway and the HTTPRoute example manifest. -Before proceeding, you should be able to query the example backend using HTTP. Follow the steps from the [Global Rate Limit](../traffic/global-rate-limit) to install RateLimit. +{{% readfile "../../../template/o11y_prerequisites.md" %}} -[OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) offers a vendor-agnostic implementation of how to receive, process and export telemetry data. - -Install OTel-Collector: - -```shell -helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts -helm repo update -helm upgrade --install otel-collector open-telemetry/opentelemetry-collector -f https://raw.githubusercontent.com/envoyproxy/gateway/latest/examples/otel-collector/helm-values.yaml -n monitoring --create-namespace --version 0.60.0 -``` +Follow the steps from the [Global Rate Limit](../traffic/global-rate-limit) to install RateLimit. ## Traces diff --git a/site/content/en/template/o11y_prerequisites.md b/site/content/en/template/o11y_prerequisites.md new file mode 100644 index 00000000000..74c547a946c --- /dev/null +++ b/site/content/en/template/o11y_prerequisites.md @@ -0,0 +1,12 @@ + +Follow the steps from the [Quickstart](../quickstart) to install Envoy Gateway and the example manifest. +Before proceeding, you should be able to query the example backend using HTTP. + +Envoy Gateway provides an add-ons Helm Chart, which includes all the needing components for observability. +By default, the [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) is disabled. + +Install the add-ons Helm Chart: + +```shell +helm install eg-addons oci://docker.io/envoyproxy/gateway-addons-helm --version v0.0.0-latest --set opentelemetry-collector.enabled=true -n monitoring --create-namespace +``` diff --git a/site/content/zh/latest/install/gateway-addons-helm-api.md b/site/content/zh/latest/install/gateway-addons-helm-api.md index 4401cc03efe..5401fbe7f83 100644 --- a/site/content/zh/latest/install/gateway-addons-helm-api.md +++ b/site/content/zh/latest/install/gateway-addons-helm-api.md @@ -27,7 +27,7 @@ An Add-ons Helm chart for Envoy Gateway | https://grafana.github.io/helm-charts | grafana | 8.0.0 | | https://grafana.github.io/helm-charts | loki | 4.8.0 | | https://grafana.github.io/helm-charts | tempo | 1.3.1 | -| https://open-telemetry.github.io/opentelemetry-helm-charts | opentelemetry-collector | 0.60.0 | +| https://open-telemetry.github.io/opentelemetry-helm-charts | opentelemetry-collector | 0.73.1 | | https://prometheus-community.github.io/helm-charts | prometheus | 25.21.0 | ## Values @@ -58,7 +58,7 @@ An Add-ons Helm chart for Envoy Gateway | grafana.datasources."datasources.yaml".apiVersion | int | `1` | | | grafana.datasources."datasources.yaml".datasources[0].name | string | `"Prometheus"` | | | grafana.datasources."datasources.yaml".datasources[0].type | string | `"prometheus"` | | -| grafana.datasources."datasources.yaml".datasources[0].url | string | `"http://prometheus-server"` | | +| grafana.datasources."datasources.yaml".datasources[0].url | string | `"http://prometheus"` | | | grafana.enabled | bool | `true` | | | grafana.fullnameOverride | string | `"grafana"` | | | grafana.service.type | string | `"LoadBalancer"` | | @@ -104,16 +104,13 @@ An Add-ons Helm chart for Envoy Gateway | prometheus.kube-state-metrics.enabled | bool | `false` | | | prometheus.prometheus-node-exporter.enabled | bool | `false` | | | prometheus.prometheus-pushgateway.enabled | bool | `false` | | -| prometheus.server.fullnameOverride | string | `"prometheus-server"` | | +| prometheus.server.fullnameOverride | string | `"prometheus"` | | | prometheus.server.global.scrape_interval | string | `"15s"` | | | prometheus.server.image.repository | string | `"prom/prometheus"` | | | prometheus.server.persistentVolume.enabled | bool | `false` | | | prometheus.server.readinessProbeInitialDelay | int | `0` | | | prometheus.server.securityContext | object | `{}` | | | prometheus.server.service.type | string | `"LoadBalancer"` | | -| tags.logging | bool | `false` | | -| tags.metrics | bool | `true` | | -| tags.tracing | bool | `false` | | | tempo.enabled | bool | `true` | | | tempo.fullnameOverride | string | `"tempo"` | | | tempo.service.type | string | `"LoadBalancer"` | | diff --git a/test/e2e/testdata/metric.yaml b/test/e2e/testdata/metric.yaml index 2d2c26311dc..e31c72fdab3 100644 --- a/test/e2e/testdata/metric.yaml +++ b/test/e2e/testdata/metric.yaml @@ -41,7 +41,7 @@ metadata: namespace: monitoring spec: selector: - app.kubernetes.io/instance: otel-collector + app.kubernetes.io/instance: eg-addons app.kubernetes.io/name: opentelemetry-collector component: standalone-collector ports: diff --git a/tools/make/kube.mk b/tools/make/kube.mk index 81d63e9cc25..31ea2c4c6d7 100644 --- a/tools/make/kube.mk +++ b/tools/make/kube.mk @@ -10,9 +10,6 @@ GATEWAY_RELEASE_URL ?= https://github.com/kubernetes-sigs/gateway-api/releases/d WAIT_TIMEOUT ?= 15m -FLUENT_BIT_CHART_VERSION ?= 0.30.4 -OTEL_COLLECTOR_CHART_VERSION ?= 0.73.1 -TEMPO_CHART_VERSION ?= 1.3.1 E2E_RUN_TEST ?= E2E_RUN_EG_UPGRADE_TESTS ?= false E2E_CLEANUP ?= true @@ -34,9 +31,9 @@ CONTROLLERGEN_OBJECT_FLAGS := object:headerFile="$(ROOT_DIR)/tools/boilerplate/ .PHONY: manifests manifests: $(tools/controller-gen) generate-gwapi-manifests ## Generate WebhookConfiguration and CustomResourceDefinition objects. - @$(LOG_TARGET) $(tools/controller-gen) crd:allowDangerousTypes=true paths="./..." output:crd:artifacts:config=charts/gateway-helm/crds/generated + .PHONY: generate-gwapi-manifests generate-gwapi-manifests: generate-gwapi-manifests: ## Generate GWAPI manifests and make it consistent with the go mod version. @@ -63,7 +60,7 @@ ifndef ignore-not-found endif .PHONY: kube-deploy -kube-deploy: manifests helm-generate ## Install Envoy Gateway into the Kubernetes cluster specified in ~/.kube/config. +kube-deploy: manifests helm-generate.gateway-helm ## Install Envoy Gateway into the Kubernetes cluster specified in ~/.kube/config. @$(LOG_TARGET) helm install eg charts/gateway-helm --set deployment.envoyGateway.imagePullPolicy=$(IMAGE_PULL_POLICY) -n envoy-gateway-system --create-namespace --debug --timeout='$(WAIT_TIMEOUT)' --wait --wait-for-jobs @@ -142,54 +139,17 @@ endif endif .PHONY: install-e2e-telemetry -install-e2e-telemetry: prepare-helm-repo install-fluent-bit install-loki install-tempo install-otel-collector install-prometheus +install-e2e-telemetry: helm-generate.gateway-addons-helm @$(LOG_TARGET) - kubectl rollout status daemonset fluent-bit -n monitoring --timeout 5m - kubectl rollout status statefulset loki -n monitoring --timeout 5m - kubectl rollout status statefulset tempo -n monitoring --timeout 5m - kubectl rollout status deployment otel-collector -n monitoring --timeout 5m - kubectl rollout status deployment prometheus -n monitoring --timeout 5m + helm install eg-addons charts/gateway-addons-helm --set grafana.enabled=false,opentelemetry-collector.enabled=true -n monitoring --create-namespace --timeout='$(WAIT_TIMEOUT)' --wait --wait-for-jobs + # Change loki service type from ClusterIP to LoadBalancer + kubectl patch service loki -n monitoring -p '{"spec": {"type": "LoadBalancer"}}' .PHONY: uninstall-e2e-telemetry uninstall-e2e-telemetry: @$(LOG_TARGET) - kubectl delete -f examples/loki/loki.yaml -n monitoring --ignore-not-found helm delete $(shell helm list -n monitoring -q) -n monitoring -.PHONY: prepare-helm-repo -prepare-helm-repo: - @$(LOG_TARGET) - helm repo add fluent https://fluent.github.io/helm-charts - helm repo add grafana https://grafana.github.io/helm-charts - helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts - helm repo add prometheus-community https://prometheus-community.github.io/helm-charts - helm repo update - -.PHONY: install-fluent-bit -install-fluent-bit: - @$(LOG_TARGET) - helm upgrade --install fluent-bit fluent/fluent-bit -f examples/fluent-bit/helm-values.yaml -n monitoring --create-namespace --version $(FLUENT_BIT_CHART_VERSION) - -.PHONY: install-loki -install-loki: - @$(LOG_TARGET) - kubectl apply -f examples/loki/loki.yaml -n monitoring - -.PHONY: install-tempo -install-tempo: - @$(LOG_TARGET) - helm upgrade --install tempo grafana/tempo -f examples/tempo/helm-values.yaml -n monitoring --create-namespace --version $(TEMPO_CHART_VERSION) - -.PHONY: install-prometheus -install-prometheus: - @$(LOG_TARGET) - helm upgrade --install prometheus prometheus-community/prometheus -f examples/prometheus/helm-values.yaml -n monitoring --create-namespace - -.PHONY: install-otel-collector -install-otel-collector: - @$(LOG_TARGET) - helm upgrade --install otel-collector open-telemetry/opentelemetry-collector -f examples/otel-collector/helm-values.yaml -n monitoring --create-namespace --version $(OTEL_COLLECTOR_CHART_VERSION) - .PHONY: create-cluster create-cluster: $(tools/kind) ## Create a kind cluster suitable for running Gateway API conformance. @$(LOG_TARGET) @@ -222,7 +182,7 @@ delete-cluster: $(tools/kind) ## Delete kind cluster. $(tools/kind) delete cluster --name envoy-gateway .PHONY: generate-manifests -generate-manifests: helm-generate ## Generate Kubernetes release manifests. +generate-manifests: helm-generate.gateway-helm ## Generate Kubernetes release manifests. @$(LOG_TARGET) @$(call log, "Generating kubernetes manifests") mkdir -p $(OUTPUT_DIR)/