Skip to content

Commit

Permalink
feat: Documentation and environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dploeger committed Oct 30, 2024
1 parent 3a11e14 commit e481c14
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

9 changes: 8 additions & 1 deletion charts/cloudian-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 25 additions & 0 deletions charts/cloudian-exporter/README.md
Original file line number Diff line number Diff line change
@@ -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:** <https://github.com/dodevops/cloudian-exporter>

## Source Code

* <https://github.com/dodevops/cloudian-exporter>

## 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)
21 changes: 19 additions & 2 deletions charts/cloudian-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
11 changes: 10 additions & 1 deletion charts/cloudian-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e481c14

Please sign in to comment.