From b563daee7663688d16bc1a91499ac009a6fde155 Mon Sep 17 00:00:00 2001 From: rafajpet Date: Mon, 25 Mar 2024 11:14:12 +0100 Subject: [PATCH] helm docs generation --- .pre-commit-config.yaml | 7 ++- .tool-versions | 2 +- README.md | 10 +++ Taskfile.yml | 3 + charts/aws-service-quotas-exporter/README.md | 62 +++++++++++++++++++ .../README.md.gotmpl | 14 +++++ .../aws-service-quotas-exporter/values.yaml | 52 +++++++++------- 7 files changed, 127 insertions(+), 23 deletions(-) create mode 100644 charts/aws-service-quotas-exporter/README.md create mode 100644 charts/aws-service-quotas-exporter/README.md.gotmpl diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30fa62a..23134e3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,12 @@ repos: rev: v1.57.1 hooks: - id: golangci-lint - + - repo: https://github.com/norwoodj/helm-docs + rev: v1.13.1 + hooks: + - id: helm-docs + args: + - --chart-search-root=charts # - repo: https://github.com/gruntwork-io/pre-commit # rev: v0.1.17 # hooks: diff --git a/.tool-versions b/.tool-versions index 1342112..72eb0dd 100644 --- a/.tool-versions +++ b/.tool-versions @@ -2,4 +2,4 @@ helm 3.14.2 awscli 2.7.14 pre-commit 2.20.0 task 3.35.1 -golang 1.22.0 +helm-docs 1.13.1 diff --git a/README.md b/README.md index 80a3fe4..33883c4 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,16 @@ Access help: docker run --rm -p 8080:8080 -i ghcr.io/lablabs/aws-service-quotas-exporter:latest --help ``` +## Helm chart repository +To deploy the exporter into Kubernetes, we recommend using our manager Helm repository: + +```bash +helm repo add cloudflare-exporter https://lablabs.github.io/aws-service-quotas-exporter/ +helm install aws-service-quotas-exporter/aws-service-quotas-exporter +``` + +for helm chart configuration / development, follow [./charts/aws-service-quotas-exporter](./charts/aws-service-quotas-exporter) + ## Contributing and reporting issues Feel free to create an issue in this repository if you have questions, suggestions or feature requests. diff --git a/Taskfile.yml b/Taskfile.yml index 0d45b98..ee58415 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -26,3 +26,6 @@ tasks: docker:build: cmds: - docker build -t {{ .DOCKER_IMAGE }} . + helm:docs: + cmds: + - helm-docs diff --git a/charts/aws-service-quotas-exporter/README.md b/charts/aws-service-quotas-exporter/README.md new file mode 100644 index 0000000..4cb168c --- /dev/null +++ b/charts/aws-service-quotas-exporter/README.md @@ -0,0 +1,62 @@ +# Helm Chart for aws-service-quotas-exporter + +## Repository +```bash +helm repo add cloudflare-exporter https://lablabs.github.io/aws-service-quotas-exporter/ +helm install aws-service-quotas-exporter/aws-service-quotas-exporter +``` + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| env | string | `nil` | Pod env section to configure | +| exporter.address | string | `"0.0.0.0:8080"` | Address of http endpoint | +| exporter.config.metrics | list | `[]` | Metrics config, example [config/example.yaml](../../config/example.yaml) | +| exporter.config.quotas | list | `[]` | Quotas config, example [config/example.yaml](../../config/example.yaml) | +| exporter.config.scrape | string | `nil` | | +| exporter.log.format | string | `"json"` | Log format, default json | +| exporter.log.level | string | `"DEBUG"` | Log level for exporter | +| fullnameOverride | string | `""` | full name override | +| image.pullPolicy | string | `"Always"` | pull Policy | +| image.repository | string | `"ghcr.io/lablabs/aws-service-quotas-exporter"` | image repository path | +| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. | +| imagePullSecrets | list | `[]` | image pull Secrets | +| livenessProbe.httpGet.path | string | `"/"` | | +| livenessProbe.httpGet.port | string | `"http"` | | +| nameOverride | string | `""` | helm name override | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | pod annotations | +| podLabels | object | `{}` | pod labels | +| podSecurityContext | object | `{}` | | +| readinessProbe.httpGet.path | string | `"/"` | | +| readinessProbe.httpGet.port | string | `"http"` | | +| replicaCount | int | `1` | number of replicca | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.port | int | `8080` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | +| serviceAccount.automount | bool | `true` | Automatically mount a ServiceAccount's API credentials? | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceMonitor.enabled | bool | `false` | When set true then use a ServiceMonitor to configure scraping | +| serviceMonitor.interval | string | `"30s"` | Set how frequently Prometheus should scrape | +| serviceMonitor.labels | object | `{}` | Service monitor labels | +| serviceMonitor.metricRelabelings | list | `[]` | | +| serviceMonitor.namespace | string | `""` | Set the namespace the ServiceMonitor should be deployed, if empty namespace will be .Release.Namespace | +| serviceMonitor.relabelings | list | `[]` | Set relabel_configs as per https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config | +| serviceMonitor.targetLabels | list | `[]` | Set of labels to transfer on the Kubernetes Service onto the target. | +| serviceMonitor.telemetryPath | string | `"/metrics"` | Set path to exporter telemtery-path | +| serviceMonitor.timeout | string | `"10s"` | Set timeout for scrape | +| tolerations | list | `[]` | | +| volumeMounts | list | `[]` | | +| volumes | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/charts/aws-service-quotas-exporter/README.md.gotmpl b/charts/aws-service-quotas-exporter/README.md.gotmpl new file mode 100644 index 0000000..f77c59b --- /dev/null +++ b/charts/aws-service-quotas-exporter/README.md.gotmpl @@ -0,0 +1,14 @@ +# Helm Chart for aws-service-quotas-exporter + + +## Repository +```bash +helm repo add cloudflare-exporter https://lablabs.github.io/aws-service-quotas-exporter/ +helm install aws-service-quotas-exporter/aws-service-quotas-exporter +``` + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} + +{{ template "helm-docs.versionFooter" . }} diff --git a/charts/aws-service-quotas-exporter/values.yaml b/charts/aws-service-quotas-exporter/values.yaml index f39aa5b..2ef780a 100644 --- a/charts/aws-service-quotas-exporter/values.yaml +++ b/charts/aws-service-quotas-exporter/values.yaml @@ -1,31 +1,36 @@ -# Default values for aws-service-quotas-exporter. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. +# -- number of replicca replicaCount: 1 image: + # -- image repository path repository: ghcr.io/lablabs/aws-service-quotas-exporter + # -- pull Policy pullPolicy: Always - # Overrides the image tag whose default is the chart appVersion. + # --Overrides the image tag whose default is the chart appVersion. tag: "" +# -- image pull Secrets imagePullSecrets: [] +# -- helm name override nameOverride: "" +# -- full name override fullnameOverride: "" serviceAccount: - # Specifies whether a service account should be created + # -- Specifies whether a service account should be created create: true - # Automatically mount a ServiceAccount's API credentials? + # -- Automatically mount a ServiceAccount's API credentials? automount: true - # Annotations to add to the service account + # -- Annotations to add to the service account annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template + # -- The name of the service account to use. + # --If not set and create is true, a name is generated using the fullname template name: "" +# -- pod annotations podAnnotations: {} +# -- pod labels podLabels: {} podSecurityContext: {} @@ -43,7 +48,7 @@ service: type: ClusterIP port: 8080 - +# -- Pod env section to configure env: # - name: "AWS_REGION" # value: "eu-central-1" @@ -96,30 +101,35 @@ tolerations: [] affinity: {} serviceMonitor: - # When set true then use a ServiceMonitor to configure scraping + # -- When set true then use a ServiceMonitor to configure scraping enabled: false - # Set the namespace the ServiceMonitor should be deployed, if empty namespace will be .Release.Namespace + # -- Set the namespace the ServiceMonitor should be deployed, if empty namespace will be .Release.Namespace namespace: "" - # Service monitor labels + # -- Service monitor labels labels: {} - # Set how frequently Prometheus should scrape + # -- Set how frequently Prometheus should scrape interval: 30s - # Set path to redis-exporter telemtery-path + # -- Set path to exporter telemtery-path telemetryPath: /metrics - # Set timeout for scrape + # -- Set timeout for scrape timeout: 10s - # Set relabel_configs as per https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config + # -- Set relabel_configs as per https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config relabelings: [] - # Set of labels to transfer on the Kubernetes Service onto the target. + # -- Set of labels to transfer on the Kubernetes Service onto the target. targetLabels: [] metricRelabelings: [] exporter: + # -- Address of http endpoint address: "0.0.0.0:8080" log: + # -- Log level for exporter level: "DEBUG" + # -- Log format, default json format: "json" config: -# scrape: -# quotas: [] -# metrics: [] + scrape: + # -- Quotas config, example [config/example.yaml](../../config/example.yaml) + quotas: [] + # -- Metrics config, example [config/example.yaml](../../config/example.yaml) + metrics: []