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 api exporter #71

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
55 changes: 55 additions & 0 deletions .github/workflows/helm-openstack-api-exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Helm GitHub Actions for openstack-exporter

on:
pull_request:
paths:
- helm-configs/monitoring/openstack-api-exporter/**
- kustomize/monitoring/openstack-api-exporter/**
- .github/workflows/helm-openstack-api-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 OSH 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
- name: Run Helm Template
run: |
cd submodules/openstack-helm-infra
${{ steps.helm.outputs.helm-path }} template prometheus-openstack-exporter ./prometheus-openstack-exporter \
--namespace=openstack \
--wait \
--timeout 120m \
-f ${{ github.workspace }}/helm-configs/monitoring/openstack-api-exporter/openstack-api-exporter-helm-overrides.yaml \
--post-renderer ${{ github.workspace }}/kustomize/kustomize.sh \
--post-renderer-args monitoring/openstack-api-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
20 changes: 20 additions & 0 deletions docs/openstack-api-exporter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Openstack API Exporter

We are using Prometheus for monitoring and metrics collection backend along with the openstack api 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 API Exporter


### Install openstack-api-exporter helm chart
```shell
cd /opt/genestack/submodules/openstack-helm-infra

helm upgrade --install prometheus-openstack-exporter ./prometheus-openstack-exporter \
--namespace=openstack \
--timeout 15m \
-f /opt/genestack/helm-configs/monitoring/openstack-api-exporter/openstack-api-exporter-helm-overrides.yaml \
--set endpoints.identity.auth.admin.password="$(kubectl --namespace openstack get secret keystone-admin -o jsonpath='{.data.password}' | base64 -d)" \
--post-renderer /opt/genestack/kustomize/kustomize.sh \
--post-renderer-args monitoring/openstack-api-exporter/base
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@

images:
tags:
prometheus_openstack_exporter: docker.io/openstackhelm/prometheus-openstack-exporter:ubuntu_bionic-20240210
dep_check: quay.io/airshipit/kubernetes-entrypoint:v1.0.0
image_repo_sync: docker.io/library/docker:17.07.0
ks_user: docker.io/openstackhelm/heat:2023.2-ubuntu_jammy
pull_policy: IfNotPresent
local_registry:
active: false
exclude:
- dep_check
- image_repo_sync

labels:
openstack_exporter:
node_selector_key: openstack-control-plane
node_selector_value: enabled
job:
node_selector_key: openstack-control-plane
node_selector_value: enabled

pod:
security_context:
exporter:
pod:
runAsUser: 65534
container:
openstack_metrics_exporter:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
ks_user:
pod:
runAsUser: 65534
container:
prometheus_openstack_exporter_ks_user:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
affinity:
anti:
type:
default: preferredDuringSchedulingIgnoredDuringExecution
topologyKey:
default: kubernetes.io/hostname
mounts:
prometheus_openstack_exporter:
prometheus_openstack_exporter:
init_container: null
replicas:
prometheus_openstack_exporter: 1
lifecycle:
upgrades:
deployments:
revision_history: 3
pod_replacement_strategy: RollingUpdate
rolling_update:
max_unavailable: 1
max_surge: 3
termination_grace_period:
prometheus_openstack_exporter:
timeout: 30
resources:
enabled: false
prometheus_openstack_exporter:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "4096Mi"
jobs:
image_repo_sync:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "4096Mi"
ks_user:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "4096Mi"
dependencies:
dynamic:
common:
local_image_registry:
jobs:
- prometheus-openstack-exporter-image-repo-sync
services:
- endpoint: node
service: local_image_registry
static:
image_repo_sync:
services:
- endpoint: internal
service: local_image_registry
ks_user:
services:
- endpoint: internal
service: identity
prometheus_openstack_exporter:
jobs:
- prometheus-openstack-exporter-ks-user
services:
- endpoint: internal
service: identity

conf:
prometheus_openstack_exporter:
OS_POLLING_INTERVAL: 30
TIMEOUT_SECONDS: 20
OS_RETRIES: 1

secrets:
identity:
admin: prometheus-openstack-exporter-keystone-admin
user: prometheus-openstack-exporter-keystone-user
oci_image_registry:
prometheus-openstack-exporter: prometheus-openstack-exporter-oci-image-registry-key
tls:
identity:
api:
# This name should be same as in keystone. Keystone
# secret will be used in these charts
#
public: keystone-tls-public
internal: keystone-tls-public


endpoints:
cluster_domain_suffix: cluster.local
local_image_registry:
name: docker-registry
namespace: docker-registry
hosts:
default: localhost
internal: docker-registry
node: localhost
host_fqdn_override:
default: null
port:
registry:
node: 5000
oci_image_registry:
name: oci-image-registry
namespace: oci-image-registry
auth:
enabled: false
prometheus-openstack-exporter:
username: prometheus-openstack-exporter
password: password
hosts:
default: localhost
host_fqdn_override:
default: null
port:
registry:
default: null
prometheus_openstack_exporter:
namespace: null
hosts:
default: openstack-metrics
host_fqdn_override:
default: null
path:
default: null
scheme:
default: 'http'
port:
exporter:
default: 9103
identity:
name: keystone
auth:
admin:
region_name: RegionOne
username: admin
password: password
project_name: admin
user_domain_name: default
project_domain_name: default
user:
role: admin
region_name: RegionOne
username: prometheus-openstack-exporter
password: password
project_name: service
user_domain_name: default
project_domain_name: default
hosts:
default: keystone
internal: keystone-api
host_fqdn_override:
default: null
path:
default: /v3
scheme:
default: 'http'
port:
api:
default: 80
internal: 5000

monitoring:
prometheus:
enabled: true
openstack_exporter:
scrape: true

network:
openstack_metrics_exporter:
port: 9103

network_policy:
prometheus-openstack-exporter:
ingress:
- {}
egress:
- {}

manifests:
certificates: false
configmap_bin: true
deployment: true
job_image_repo_sync: true
job_ks_user: true
network_policy: false
secret_keystone: true
secret_registry: true
service: true
14 changes: 14 additions & 0 deletions kustomize/monitoring/openstack-api-exporter/aio/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
bases:
- ../base

patches:
- target:
kind: HorizontalPodAutoscaler
name: 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: 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: prometheus-openstack-exporter
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resources:
- hpa-openstack-api-exporter.yaml
- all.yaml
Loading