Skip to content

Commit

Permalink
Updating openstack exporter docs
Browse files Browse the repository at this point in the history
  • Loading branch information
the2hill authored and cloudnull committed Jul 17, 2024
1 parent 6a296a6 commit 5122b34
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions docs/prometheus-openstack-metrics-exporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,55 @@ Modify genestack/helm-configs/monitoring/openstack-metrics-exporter/clouds-yaml

See the [documentation](openstack-clouds.md) 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.
From your generated `clouds.yaml` file, create a new manifest for your cloud config:

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

!!! example "generated file will look similar to this"

``` yaml
--8<-- "helm-configs/monitoring/openstack-metrics-exporter/clouds-yaml"
--8<-- "base-helm-configs/monitoring/openstack-metrics-exporter/clouds-yaml"
```

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

``` shell
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/gen-clouds-yaml
</tmp/generated-clouds-yaml | tee /tmp/generated-clouds-certs-yaml
```

Now create a secrete from your manifest.
Now create a secret from your manifest:

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

### Install openstack-metrics-exporter helm chart
If using self-signed certs then use:

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

## Install openstack-metrics-exporter helm chart

``` shell
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:

``` shell
cd /opt/genestack/submodules/openstack-exporter/charts
Expand All @@ -55,7 +74,7 @@ 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.gen-clouds-yaml}' | base64 -d)"
--set clouds_yaml_config="$(kubectl --namespace openstack get secret clouds-yaml-secret -o jsonpath='{.data.generated-clouds-certs-yaml}' | base64 -d)"
```

!!! success
Expand Down

0 comments on commit 5122b34

Please sign in to comment.