Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring adding openstack metrics exporter #94

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/helm-prometheus-openstack-metrics-exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Helm GitHub Actions for openstack-metrics-exporter

on:
pull_request:
paths:
- helm-configs/monitoring/openstack-metrics-exporter/**
- kustomize/monitoring/openstack-metrics-exporter/**
- .github/workflows/helm-openstack-metrics-exporter.yaml
jobs:
helm:
name: Helm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: azure/setup-helm@v3
with:
version: latest
token: "${{ secrets.GITHUB_TOKEN }}"
id: helm
- name: Kubectl Install
working-directory: /usr/local/bin/
run: |
if [ ! -f /usr/local/bin/kubectl ]; then
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
fi
- name: Pull Openstack Exporter submodules
run: |
git submodule update --init submodules/openstack-exporter
- name: Run Helm Template
run: |
cd submodules/openstack-exporter/charts/
${{ steps.helm.outputs.helm-path }} template os-metrics ./prometheus-openstack-exporter \
--namespace=openstack \
--wait \
--timeout 120m \
-f ${{ github.workspace }}/helm-configs/monitoring/openstack-metrics-exporter/openstack-metrics-exporter-helm-overrides.yaml > /tmp/rendered.yaml
- name: Return helm Build
uses: actions/upload-artifact@v2
with:
name: helm-openstack-exporter-artifact-${{ matrix.overlays }}
path: /tmp/rendered.yaml
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -13,3 +13,6 @@
[submodule "submodules/mariadb-operator"]
path = submodules/mariadb-operator
url = https://github.com/mariadb-operator/mariadb-operator
[submodule "submodules/openstack-exporter"]
path = submodules/openstack-exporter
url = https://github.com/openstack-exporter/helm-charts
24 changes: 24 additions & 0 deletions docs/openstack-metrics-exporter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Openstack MetricsExporter

We are using Prometheus for monitoring and metrics collection backend along with the openstack exporter to gather openstack resource metrics
For more information see: https://prometheus.io and https://github.com/openstack-exporter/openstack-exporter

## Deploy the Prometheus Openstack Exporter

### Create clouds-yaml secret
Modify genestack/helm-configs/monitoring/openstack-metrics-exporter/clouds-yaml with the appropriate settings and create the secret.

```shell
kubectl create secret generic clouds-yaml-secret --from-file /opt/genestack/helm-configs/monitoring/openstack-metrics-exporter/clouds-yaml
```

### Install openstack-metrics-exporter helm chart
```shell
cd /opt/genestack/submodules/openstack-exporter/helm-charts/charts

helm upgrade --install os-metrics ./prometheus-openstack-exporter \
--namespace=openstack \
--timeout 15m \
-f /opt/genestack/helm-configs/monitoring/openstack-metrics-exporter/openstack-metrics-exporter-helm-overrides.yaml \
--set clouds_yaml_config="$(kubectl get secret clouds-yaml-secret -o jsonpath='{.data.clouds-yaml}' | base64 -d)"
```
11 changes: 11 additions & 0 deletions helm-configs/monitoring/openstack-metrics-exporter/clouds-yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
clouds.yaml: |
clouds:
default:
region_name: RegionOne
auth:
username: admin
password: <admin-password>
project_name: admin
project_domain_name: default
user_domain_name: default
auth_url: 'http://keystone-api.openstack.svc.cluster.local:5000/v3'
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
# Choose endpoint type (this will override the value of clouds.yaml)
endpoint_type: public
# Ignored when multicloud.enabled: true
cloud: default

replicaCount: 1

image:
repository: ghcr.io/openstack-exporter/openstack-exporter
tag: 1.7.0
pullPolicy: Always

serviceMonitor:
interval: 3m
scrapeTimeout: 30s

multicloud:
# Enable multicloud (i.e. /probe?... targets)
# Doc: https://github.com/openstack-exporter/openstack-exporter#description
enabled: false
# Monitor the exporter's internal metrics (i.e. /metrics)
selfmonitor: false
# List of clouds to scrape, and the services to scrape from them
clouds:
- name: default
services:
- volume
- image
- identity
- compute
- network
- placement
- load-balancer
- object-store
#- container-infra
#- dns
#- baremetal
- gnocchi
#- database
- orchestration

# - name: cloud1
# services:
# - volume
# - name: cloud2
# services:
# - volume
# - image
# - identity
# - compute
# - network
# - placement # NB this needs the openstack-exporter release > 1.4.0

# Add extra args to the exporter.
# Doc: https://github.com/openstack-exporter/openstack-exporter#command-line-options
#extraArgs:
# - --disable-service.baremetal
# - --disable-service.container-infra
# - --disable-service.object-store

# Add extra environment variables
# extraEnvs:
# "ENV_VAR": "value"

# Add extra labels
#commonLabels:
# prometheus.io/scrape: "true"
# prometheus.io/monitor: "true"

# Generate a secret for clouds.yaml
# Doc: https://github.com/openstack-exporter/openstack-exporter#openstack-configuration
clouds_yaml_config: |
clouds.yaml: |
clouds:
default:
region_name: RegionOne
auth:
username: admin
password: <admin-password>
project_name: admin
project_domain_name: default
user_domain_name: default
auth_url: 'http://keystone-api.openstack.svc.cluster.local:5000/v3'
# In case of multicloud.enabled
# cloud1:
# ...
# cloud2:
# ...
1 change: 1 addition & 0 deletions submodules/openstack-exporter
Submodule openstack-exporter added at fe6942
Loading