Skip to content

Latest commit

 

History

History
70 lines (44 loc) · 2.35 KB

File metadata and controls

70 lines (44 loc) · 2.35 KB

Installation Prometheus, Grafana, and AlertManager Using Prometheus Operator

This section will walk you through the process of installing Prometheus, Grafana, and AlertManager using the Prometheus Operator. Follow these steps to set up the monitoring stack on your Kubernetes cluster.

Step 1: Clone the Repository and Navigate to the Installation Directory

To begin, clone the Prometheus Operator repository and change your current directory to the installation directory:

git clone https://github.com/prometheus-operator/kube-prometheus.git && cd kube-prometheus

Step 2: Create Namespace and Custom Resource Definitions (CRDs)

Execute the following commands to create the necessary namespace and Custom Resource Definitions (CRDs) for Prometheus Operator:

# Create the namespace and CRDs, then wait for them to become available before proceeding.
kubectl create -f manifests/setup

# Wait until the "servicemonitors" CRD is created. A message of "No resources found" indicates success.
until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done

# Create the remaining resources.
kubectl create -f manifests/

Wait until all pods have a running status by running:

kubectl get po -A -w

Step 3: Expose Services for Prometheus, Grafana, and AlertManager

In separate terminal windows, run the following commands to expose the services:

Expose Prometheus Service

kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090

Expose AlertManager Service

kubectl --namespace monitoring port-forward svc/alertmanager-main 9093

Expose Grafana Service

kubectl --namespace monitoring port-forward svc/grafana 3000

Step 4: Access the User Interfaces in Your Browser

After successfully exposing the services, you can access the following UIs in your web browser:

That's it! You have now installed and configured Prometheus, Grafana, and AlertManager on your Kubernetes cluster using Prometheus Operator.

For more information visit the official Documentation


Previous | Next