diff --git a/.github/workflows/build_image.yaml b/.github/workflows/build_image.yaml index a4a56c0..8bbefd3 100644 --- a/.github/workflows/build_image.yaml +++ b/.github/workflows/build_image.yaml @@ -61,6 +61,11 @@ jobs: uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=edge,branch=develop + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action diff --git a/README.md b/README.md new file mode 100644 index 0000000..761161e --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# Cloudian metrics exporter + +This Prometheus exporter provides a metrics endpoint with metrics from a [Cloudian](https://cloudian.com/) installation. + +**Note**: This is not affiliated in any way with Cloudian and Cloudian does not offer support for this. + +## Configuration + +The exporter requires the following configuration using environment variables: + +* CLOUDIAN_URL: Cloudian CMC REST api base URL (e.g. https://cmc.company.com:19443) +* CLOUDIAN_USERNAME: REST api username (usually sysadmin) +* CLOUDIAN_PASSWORD: REST api password +* EXPORTER_REFRESH: Interval (in minutes) in which the metric values are updated [5] +* EXPORTER_LOGLEVEL: Loglevel to use [info] +* EXPORTER_LISTEN: Port to listen to [8080] + +## Usage + +Aside from building the go binary and running it, a container is available as well. Run it using e.g.: + + docker run --rm -it -P -e CLOUDIAN_URL=... -e CLOUDIAN_USERNAME=... -e CLOUDIAN_PASSWORD=... ghcr.io/dodevops/cloudian-exporter:main + diff --git a/charts/cloudian-exporter/Chart.yaml b/charts/cloudian-exporter/Chart.yaml index e2697d1..d77c9a3 100644 --- a/charts/cloudian-exporter/Chart.yaml +++ b/charts/cloudian-exporter/Chart.yaml @@ -2,5 +2,12 @@ apiVersion: v2 name: cloudian-exporter description: A Helm chart for cloudian-exporter type: application -version: 0.1.0 +version: 0.1.1 appVersion: "latest" +keywords: + - cloudian + - s3 + - prometheus +home: https://github.com/dodevops/cloudian-exporter +sources: + - https://github.com/dodevops/cloudian-exporter diff --git a/charts/cloudian-exporter/README.md b/charts/cloudian-exporter/README.md new file mode 100644 index 0000000..ae47d24 --- /dev/null +++ b/charts/cloudian-exporter/README.md @@ -0,0 +1,25 @@ +# cloudian-exporter + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) + +A Helm chart for cloudian-exporter + +**Homepage:** + +## Source Code + +* + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| configuration.cloudian.authSecret.name | string | `""` | name that holds the cmc credentials | +| configuration.cloudian.authSecret.passwordKey | string | `"password"` | secret key that holds the password | +| configuration.cloudian.authSecret.usernameKey | string | `"username"` | secret key that holds the username | +| configuration.cloudian.url | string | `""` | url to the cloudian cmc REST api | +| configuration.exporter.loglevel | string | `""` | exporter log level | +| configuration.exporter.refresh | int | `5` | refresh interval for cloudian metrics | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.14.0](https://github.com/norwoodj/helm-docs/releases/v1.14.0) diff --git a/charts/cloudian-exporter/templates/deployment.yaml b/charts/cloudian-exporter/templates/deployment.yaml index 76a0097..3ad558a 100644 --- a/charts/cloudian-exporter/templates/deployment.yaml +++ b/charts/cloudian-exporter/templates/deployment.yaml @@ -39,14 +39,31 @@ spec: protocol: TCP livenessProbe: httpGet: - path: / + path: /metrics port: http readinessProbe: httpGet: - path: / + path: /metrics port: http resources: {{- toYaml .Values.resources | nindent 12 }} + env: + - name: CLOUDIAN_URL + value: {{.Values.configuration.cloudian.url | quote}} + - name: CLOUDIAN_USERNAME + valueFrom: + secretKeyRef: + key: {{.Values.configuration.cloudian.authSecret.usernameKey | quote}} + name: {{.Values.configuration.cloudian.authSecret.name | quote}} + - name: CLOUDIAN_PASSWORD + valueFrom: + secretKeyRef: + key: {{.Values.configuration.cloudian.authSecret.passwordKey | quote}} + name: {{.Values.configuration.cloudian.authSecret.name | quote}} + - name: EXPORTER_REFRESH + value: {{.Values.configuration.exporter.refresh | quote}} + - name: EXPORTER_LOGLEVEL + value: {{.Values.configuration.exporter.loglevel | quote}} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/cloudian-exporter/values.yaml b/charts/cloudian-exporter/values.yaml index eb2d41a..c2a6ecf 100644 --- a/charts/cloudian-exporter/values.yaml +++ b/charts/cloudian-exporter/values.yaml @@ -83,10 +83,19 @@ affinity: {} configuration: cloudian: + # -- url to the cloudian cmc REST api url: "" - authSecret: "" + authSecret: + # -- name that holds the cmc credentials + name: "" + # -- secret key that holds the username + usernameKey: "username" + # -- secret key that holds the password + passwordKey: "password" exporter: + # -- exporter log level loglevel: "" + # -- refresh interval for cloudian metrics refresh: 5 serviceMonitor: