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 981c427 commit caba2ae
Show file tree
Hide file tree
Showing 12 changed files with 115 additions and 96 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
50 changes: 50 additions & 0 deletions .github/workflows/helm-prometheus-openstack-metrics-exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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:
strategy:
matrix:
overlays:
- base
- aio
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-helm-infra
${{ 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 \
--post-renderer ${{ github.workspace }}/kustomize/kustomize.sh \
--post-renderer-args monitoring/openstack-metrics-exporter/${{ matrix.overlays }} > /tmp/rendered.yaml
- name: Return helm Build
uses: actions/upload-artifact@v2
with:
name: helm-openstack-exporter-artifact-${{ matrix.overlays }}
path: /tmp/rendered.yaml
24 changes: 24 additions & 0 deletions docs/openstack-exporter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
##Openstack Exporter

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)"
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ image:
pullPolicy: Always

serviceMonitor:
interval: 1m
interval: 3m
scrapeTimeout: 30s

multicloud:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bases:
patches:
- target:
kind: HorizontalPodAutoscaler
name: prometheus-openstack-exporter
name: os-api-prometheus-openstack-exporter
patch: |-
- op: replace
path: /spec/minReplicas
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: prometheus-openstack-exporter
name: os-api-prometheus-openstack-exporter
namespace: openstack
spec:
maxReplicas: 3
Expand All @@ -16,4 +16,4 @@ spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: prometheus-openstack-exporter
name: os-api-prometheus-openstack-exporter
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
bases:
- ../base

patches:
- target:
kind: HorizontalPodAutoscaler
name: os-metrics-prometheus-openstack-exporter
patch: |-
- op: replace
path: /spec/minReplicas
value: 1
- op: replace
path: /spec/maxReplicas
value: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: os-metrics-prometheus-openstack-exporter
namespace: openstack
spec:
maxReplicas: 3
minReplicas: 1
metrics:
- resource:
name: cpu
target:
averageUtilization: 50
type: Utilization
type: Resource
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: os-metrics-prometheus-openstack-exporter
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resources:
- hpa-openstack-metrics-exporter.yaml
- all.yaml
11 changes: 0 additions & 11 deletions kustomize/monitoring/openstack-metrics-exporter/clouds-yaml

This file was deleted.

This file was deleted.

71 changes: 0 additions & 71 deletions kustomize/monitoring/openstack-metrics-exporter/values.yaml

This file was deleted.

0 comments on commit caba2ae

Please sign in to comment.