Skip to content

Openstack Exporter

We are using Prometheus for monitoring and metrics collection along with the openstack exporter to gather openstack specific resource metrics. For more information see: Prometheus docs and Openstack Exporter

Deploy the Openstack Exporter

Note

To deploy metric exporters you will first need to deploy the Prometheus Operator, see: Deploy Prometheus.

Create clouds-yaml secret

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

Tip

See the documentation on generating your own clouds.yaml file which can be used to populate the monitoring configuration file.

From your generated clouds.yaml file, create a new manifest for your cloud config:

printf -v m "$(cat ~/.config/openstack/clouds.yaml)"; \
    m="$m" yq -I6 -n '."clouds.yaml" = strenv(m)' | \
        tee /tmp/generated-clouds-yaml

generated file will look similar to this

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'

If you're using self-signed certs then you may need to add keystone certificates to the generated clouds yaml:

ks_cert="$(kubectl get secret -n openstack keystone-tls-public -o json | jq -r '.data."tls.crt"' | base64 -d)" \
        yq -I6 '."clouds.yaml" |= (from_yaml | .clouds.default.cacert = strenv(ks_cert) | to_yaml)' \
        </tmp/generated-clouds-yaml | tee /tmp/generated-clouds-certs-yaml

Now create a secret from your manifest:

kubectl --namespace openstack create secret generic clouds-yaml-secret \
        --from-file /tmp/generated-clouds-yaml

If using self-signed certs then use:

kubectl --namespace openstack create secret generic clouds-yaml-secret \
        --from-file /tmp/generated-clouds-certs-yaml

Install openstack-metrics-exporter helm chart

cd /opt/genestack/submodules/openstack-exporter/charts

helm upgrade --install os-metrics ./prometheus-openstack-exporter \
  --namespace=openstack \
    --timeout 15m \
    -f /opt/genestack/base-helm-configs/monitoring/openstack-metrics-exporter/openstack-metrics-exporter-helm-overrides.yaml \
    --set clouds_yaml_config="$(kubectl --namespace openstack get secret clouds-yaml-secret -o jsonpath='{.data.generated-clouds-yaml}' | base64 -d)"

If you're using self-signed certs run:

cd /opt/genestack/submodules/openstack-exporter/charts

helm upgrade --install os-metrics ./prometheus-openstack-exporter \
  --namespace=openstack \
    --timeout 15m \
    -f /opt/genestack/base-helm-configs/monitoring/openstack-metrics-exporter/openstack-metrics-exporter-helm-overrides.yaml \
    --set clouds_yaml_config="$(kubectl --namespace openstack get secret clouds-yaml-secret -o jsonpath='{.data.generated-clouds-certs-yaml}' | base64 -d)"

Success

If the installation is successful, you should see the related exporter pods in the openstack namespace.

kubectl -n openstack  get pods -w | grep os-metrics

Example

os-metrics-prometheus-openstack-exporter-76bf579887-bwz5k   1/1     Running     0             7s