Install Prometheus
Guide to set up prometheus on your kubernetes cluster.
Install Open Source Prometheus
Harness supports using open source Prometheus to monitor your self-managed enterprise edition deployment. This guide walks you through installing Prometheus using the Bitnami kube-prometheus Helm chart and the monitoring.coreos.com CRDs.
Prerequisites
Helm 3 installed
Access to your Kubernetes cluster
Namespace
prometheus(or any preferred namespace)
Step 1: Configure Prometheus Settings
Create an override file override-prometheus.yaml to customize resources and enable Prometheus to scrape metrics from pods using annotations:
prometheus:
resourcesPreset: "large"
image:
repository: bitnamilegacy/prometheus
thanos:
image:
repository: bitnamilegacy/thanos
additionalScrapeConfigs:
enabled: true
type: internal
internal:
jobList:
- job_name: 'kubernetes-pods'
scrape_interval: 30s
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: true
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: kubernetes_pod_name
kube-state-metrics:
image:
repository: bitnamilegacy/kube-state-metrics
node-exporter:
image:
repository: bitnamilegacy/node-exporter
operator:
image:
repository: bitnamilegacy/prometheus-operator
alertmanager:
image:
repository: bitnamilegacy/alertmanager
blackboxExporter:
image:
repository: bitnamilegacy/blackbox-exporter
thanosRuler:
image:
repository: bitnamilegacy/thanosThis chart automatically installs the necessary CRDs. Use the
--skip-crdsflag in the Helm install command if you want to avoid CRD installation.
Step 2: Install the Bitnami Kube-Prometheus Chart
For connected environments:
For air-gapped environments:
Step 3: Access Prometheus
Option 1: Port Forwarding
Then visit: http://localhost:9090
Option 2: Expose via Ingress
Option 3: Expose via Istio VirtualService
Last updated
Was this helpful?