1
0
mirror of https://github.com/nginxinc/nginx-prometheus-exporter.git synced 2025-04-21 10:45:53 +03:00
2024-02-15 09:36:21 -08:00

1.2 KiB

NGINX Prometheus Exporter in Kubernetes

This example shows how to run NGINX Prometheus Exporter in a Kubernetes cluster.

Prerequisites

Create a kind cluster

You can create a kind cluster with the following command:

kind create cluster

For details, see the kind documentation.

Deploy the NGINX Hello application and NGINX Prometheus Exporter

You can deploy the NGINX Hello application and NGINX Prometheus Exporter with the following command:

kubectl apply -f nginx-hello.yaml

Configure port forwarding

Port forwarding is used to access the NGINX Hello application and NGINX Prometheus Exporter from your local machine.

You can configure port forwarding with the following command:

kubectl port-forward service/nginx-demo 8080:80 9113:9113

Verification

You can access the NGINX Hello application at http://localhost:8080 and the NGINX Prometheus Exporter at http://localhost:9113.