Skip to content

Commit

Permalink
Monitoring: adding openstack metrics exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
the2hill committed Feb 26, 2024
1 parent 518d3d4 commit 2f84e98
Show file tree
Hide file tree
Showing 16 changed files with 148 additions and 264 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Helm GitHub Actions for openstack-exporter
name: Helm GitHub Actions for openstack-api-exporter

on:
pull_request:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Helm GitHub Actions for openstack-exporter
name: Helm GitHub Actions for openstack-metrics-exporter

on:
pull_request:
paths:
- helm-configs/monitoring/openstack-exporter/**
- kustomize/monitoring/openstack-exporter/**
- .github/workflows/helm-openstack-exporter.yaml
- helm-configs/monitoring/openstack-metrics-exporter/**
- kustomize/monitoring/openstack-metrics-exporter/**
- .github/workflows/helm-openstack-metrics-exporter.yaml
jobs:
helm:
strategy:
Expand All @@ -30,24 +30,19 @@ jobs:
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 OSH submodules
- name: Pull Openstack Exporter submodules
run: |
git submodule update --init submodules/openstack-helm
git submodule update --init submodules/openstack-helm-infra
- name: Make OSH submodule
run: |
cd submodules/openstack-helm-infra
make prometheus-openstack-exporter
git submodule update --init submodules/openstack-exporter
- name: Run Helm Template
run: |
cd submodules/openstack-helm-infra
${{ steps.helm.outputs.helm-path }} template prometheus-openstack-exporter ./prometheus-openstack-exporter \
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-exporter/openstack-exporter-helm-overrides.yaml \
-f ${{ github.workspace }}/helm-configs/monitoring/openstack-metrics-exporter/openstack-metrics-exporter-helm-overrides.yaml \
--post-renderer ${{ github.workspace }}/kustomize/kustomize.sh \
--post-renderer-args monitoring/openstack-exporter/${{ matrix.overlays }} > /tmp/rendered.yaml
--post-renderer-args monitoring/openstack-metrics-exporter/${{ matrix.overlays }} > /tmp/rendered.yaml
- name: Return helm Build
uses: actions/upload-artifact@v2
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
```

This file was deleted.

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'
Loading

0 comments on commit 2f84e98

Please sign in to comment.