Grafana Mimir Installation
This content is not available in your language yet.
Grafana Mimir is a Metrics Aggregation for LGTM Observability Stack
Prerequisites
Section titled “Prerequisites”Kubernetes Cluster
Section titled “Kubernetes Cluster”Grafana Mimir will be installed on 🟢 Management Kubernetes Cluster
- 📥Ingress Service provided as Kubernetes Ingress Class (
IngressClass) - 🛡️TLS Certificate for Grafana Mimir provided as Kubernetes Secret
- Grafana Mimir will be exposed as HTTPS with Kubernetes Ingress.
Application Dependencies
Section titled “Application Dependencies”- 📦S3 API-compatible Object Storage ; For Metrics Storage
- 🪣S3 Buckets: A Unit of Logical Storage with 🌏Region specified.
- Grafana Mimir uses 3 separated buckets.
- Metrics Storage (TSDB)
- Alert Manager Component
- Ruler Component
- Grafana Mimir uses 3 separated buckets.
- 🔑Credentials to Access S3 Bucket: Access Key, Secret Key.
- Create/Gather a Dedicated Access Key/Secret Key for Grafana Mimir to access to its buckets.
- 🪣S3 Buckets: A Unit of Logical Storage with 🌏Region specified.
Complete Prerequisites
Section titled “Complete Prerequisites”Kubernetes Cluster
Section titled “Kubernetes Cluster”Prepare Shell Variables
Section titled “Prepare Shell Variables”Ensure you have defined and loaded your Global Shell Variables as described in Shell Variables.
-
Connect to
🟢 ManagementKubernetes Cluster ; i.e w/ Kubeconfig FileEnsure you have defined and loaded your Global Shell Variables as described in Shell Variables.
Terminal window source $HOME/opstella-installation/shell-values/kubernetes/management_cluster.vars.shsource $HOME/opstella-installation/shell-values/tools/observability.vars.shTerminal window export KUBECONFIG="$HOME/opstella-installation/kubeconfigs/management_cluster.yaml" -
Set
🟢 ManagementKubernetes Cluster InformationEnsure
GRAFANA_MIMIR_DOMAIN,K8S_INTERNAL_DOMAIN,K8S_INGRESSCLASS_NAME,K8S_STORAGECLASS_NAME,K8S_INGRESS_TLS_CERTIFICATE_SECRET_NAMEare defined as per the Shell Variables guide. -
Create Kubernetes Secret for 🛡️ TLS Certificate for Grafana Mimir in Namespace
observability-system.Kubernetes Ingress for Grafana Mimir will associate TLS Certificate with Kubernetes Secret named
wildcard-${BASE_DOMAIN}-tls.export K8S_INGRESS_TLS_CERTIFICATE_SECRET_NAME="wildcard-${BASE_DOMAIN}-tls"Create one using from
.crtand.keyfile.Terminal window kubectl create secret tls $K8S_INGRESS_TLS_CERTIFICATE_SECRET_NAME \--cert=/path/to/cert/file --key=/path/to/key/file \--namespace observability-system💡 Should return
secret/wildcard-${BASE_DOMAIN}-tls createdmessage.
Application Dependencies
Section titled “Application Dependencies”S3 API-compatible Object Storage
Section titled “S3 API-compatible Object Storage”Set S3 API-compatible Object Storage Information for Grafana Mimir.
-
Set S3 Connection with Domain
export GRAFANA_MIMIR_S3_DOMAIN="http://seaweedfs-s3.apps-supporting-services.svc:9000" -
Set 🪣S3 Buckets
Grafana Mimir uses 3 separated buckets.
-
Metrics Storage (TSDB) named
grafana-mimir-tsdbexport GRAFANA_MIMIR_S3_BLOCKS_STORAGE_BUCKET_NAME="grafana-mimir-tsdb" -
Alert Manager Component named
grafana-mimir-alertmanagerexport GRAFANA_MIMIR_S3_ALERTMANAGER_STORAGE_BUCKET_NAME="grafana-mimir-alertmanager" -
Ruler Component named
grafana-mimir-rulerexport GRAFANA_MIMIR_S3_RULER_STORAGE_BUCKET_NAME="grafana-mimir-ruler"
-
-
Set 🌏S3 Region
export GRAFANA_MIMIR_S3_BUCKET_REGION="us-east-1" -
Set 🔑Credentials to Access S3 Bucket
Access Key
export GRAFANA_MIMIR_S3_ACCESS_KEY="grafana-mimir"Secret Key
export GRAFANA_MIMIR_S3_ACCESS_SECRET="${SEAWEEDFS_HA_S3_GRAFANA_MIMIR_PASSWORD}"
Pre-Installation
Section titled “Pre-Installation”Grafana Mimir Preparation
Section titled “Grafana Mimir Preparation”-
Set Grafana Mimir Entrypoint Domain
export GRAFANA_MIMIR_DOMAIN="mimir.${BASE_DOMAIN}" -
Create Helm Values Configuration
Terminal window cat <<EOF > $HOME/opstella-installation/helm-values/grafana-mimir-full-values.yaml## OPSTELLA_CUSTOMIZE: Global Variablesglobal:## -- Definitions to set up nginx resolver (nginx gateway that proxied within microservices)## OPSTELLA_CUSTOMIZE/RKE2: Defaults was 'kube-dns'/Change for RKE2# -- Definitions to set up nginx resolver# -- configures DNS service namednsService: ${K8S_INTERNAL_DNS_SERVICE}clusterDomain: "${K8S_INTERNAL_DOMAIN}."## OPSTELLA_CUSTOMIZE: Disable Built-in MinIO (it's not intended for Production uses!)minio:enabled: false# -- A reverse proxy deployment that is meant to receive traffic for Mimir or GEM.# When enterprise.enabled is true the GEM gateway is deployed. Otherwise, it is an nginx.# Options except those under gateway.nginx apply to both versions - nginx and GEM gateway.gateway:# -- Whether to render the manifests related to the gateway component.# This controls the behaviour both when enterprise.enabled=true and when enterprise.enabled=false.## OPSTELLA_CUSTOMIZE: Utilise Ingress, Disable NGINX Configurationsenabled: false## OPSTELLA_CUSTOMIZE: Utilise Ingress, Disable NGINX Deploymentnginx:enabled: false## OPSTELLA_CUSTOMIZE: Expose to K8s Ingress## -- Use either this ingress or the gateway, but not both at once.## If you enable this, make sure to disable the gateway's ingress.ingress:enabled: trueingressClassName: ${K8S_INGRESSCLASS_NAME}hosts:- ${GRAFANA_MIMIR_DOMAIN}tls:- hosts:- ${GRAFANA_MIMIR_DOMAIN}secretName: ${K8S_INGRESS_TLS_CERTIFICATE_SECRET_NAME}## OPSTELLA_CUSTOMIZE: Configure Mimirmimir:structuredConfig:## Utilize Object Storage : S3(-compatible)common:storage:backend: s3s3:bucket_lookup_type: auto ## Bucket lookup style type, used to access bucket in S3-compatible service. Default is auto. Supported values are: auto, path, virtual-hosted.endpoint: ${GRAFANA_MIMIR_S3_DOMAIN}region: ${GRAFANA_MIMIR_S3_BUCKET_REGION}access_key_id: ${GRAFANA_MIMIR_S3_ACCESS_KEY}secret_access_key: ${GRAFANA_MIMIR_S3_ACCESS_SECRET}blocks_storage:s3:bucket_name: ${GRAFANA_MIMIR_S3_BLOCKS_STORAGE_BUCKET_NAME}alertmanager_storage:s3:bucket_name: ${GRAFANA_MIMIR_S3_ALERTMANAGER_STORAGE_BUCKET_NAME}ruler_storage:s3:bucket_name: ${GRAFANA_MIMIR_S3_RULER_STORAGE_BUCKET_NAME}alertmanager:## TODO: OPSTELLA_CUSTOMIZE/TEMP: Disable Persistence until we can measure the workload## OPSTELLA_NOTE: Alertmanager persist the alerts for long-termpersistentVolume:## It is advisable to enable volume persistence in ingester to avoid losing metricsenabled: false ## true: DEFAULT FROM CHART ##ingester:## OPSTELLA_CUSTOMIZE: Disable Zone-Aware Replication for Non-Cloud Environment## -- Zone-aware replication for ingesterzoneAwareReplication:enabled: false## TODO: OPSTELLA_CUSTOMIZE/TEMP: Disable Persistence until we can measure the workloadpersistentVolume:## CHART_IMPORTANT_NOTE: It is advisable to enable volume persistence in ingester to avoid losing metricsenabled: false ## true: DEFAULT FROM CHART ##compactor:## TODO: OPSTELLA_CUSTOMIZE/TEMP: Disable Persistence until we can measure the workload## OPSTELLA_NOTE: Compactor requires a TSDB Block CachingpersistentVolume:enabled: false ## true: DEFAULT FROM CHART ##store_gateway:## OPSTELLA_CUSTOMIZE: Disable Zone-Aware Replication for Non-Cloud Environment## -- Zone-aware replication for store-gatewayzoneAwareReplication:enabled: true## TODO: OPSTELLA_CUSTOMIZE/TEMP: Disable Persistence until we can measure the workload## OPSTELLA_NOTE: Store-Gateway component requires fetching a portion of TSDB then compact data.persistentVolume:enabled: false ## true: DEFAULT FROM CHART ##EOF
Helm Chart Preparation
Section titled “Helm Chart Preparation”-
Add Grafana Helm Repository
Terminal window helm repo add grafana https://grafana.github.io/helm-chartshelm repo update
Installation
Section titled “Installation”-
Install Grafana Mimir
-
Install a Helm Release with specific Helm Chart Version
--version 5.6.0(App Version: 2.15.0)Terminal window helm install grafana-mimir grafana/mimir-distributed --version 5.6.0 \--namespace observability-system \-f $HOME/opstella-installation/helm-values/grafana-mimir-full-values.yaml
-
Post-Installation
Section titled “Post-Installation”Grafana Mimir Testing
Section titled “Grafana Mimir Testing”-
Get Pods Status
Terminal window kubectl get pods -n observability-system💡 Grafana Mimir (Distributed Deployment Mode Components) Pods should be
RunningNAME READY STATUS RESTARTS AGE... (deducted)grafana-mimir-alertmanager-0 1/1 Running 0 Xdgrafana-mimir-chunks-cache-0 1/1 Running 0 Xdgrafana-mimir-compactor-0 1/1 Running 0 Xdgrafana-mimir-distributor-XXXXXXX-YYYYY 1/1 Running 0 Xdgrafana-mimir-index-cache-0 1/1 Running 0 Xdgrafana-mimir-ingester-0 1/1 Running 0 Xdgrafana-mimir-ingester-0 1/1 Running 0 Xdgrafana-mimir-ingester-0 1/1 Running 0 Xdgrafana-mimir-metadata-cache-0 1/1 Running 0 Xdgrafana-mimir-nginx-XXXXXXX-YYYYY 1/1 Running 0 Xdgrafana-mimir-overrides-exporter-XXXXXXX-YYYYY 1/1 Running 0 Xdgrafana-mimir-querier-XXXXXXX-YYYYY 1/1 Running 0 Xdgrafana-mimir-querier-XXXXXXX-YYYYY 1/1 Running 0 Xdgrafana-mimir-query-frontend-XXXXXXX-YYYYY 1/1 Running 0 Xdgrafana-mimir-query-scheduler-XXXXXXX-YYYYY 1/1 Running 0 Xdgrafana-mimir-query-scheduler-XXXXXXX-YYYYY 1/1 Running 0 Xdgrafana-mimir-results-cache-0 1/1 Running 0 Xdgrafana-mimir-ruler-XXXXXXX-YYYYY 1/1 Running 0 Xdgrafana-mimir-store-gateway-0 1/1 Running 0 Xd
Finished?
Use the below navigation to proceed