Compare commits

...

52 Commits

Author SHA1 Message Date
volker.raschek 0dcea5cfc4 core(Makefile): remove deploy to chart server
continuous-integration/drone/push Build is passing
2024-11-27 18:35:52 +01:00
volker.raschek e38c4fbdfe doc(CONTRIBUTING): init 2024-11-27 18:35:37 +01:00
volker.raschek 0a4d677938 fix(helmignore): extend ignore list
continuous-integration/drone/push Build is passing
2024-11-27 18:03:06 +01:00
CSRBot 171d9a695e chore(deps): update dependency markdownlint-cli to ^0.43.0
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-27 11:26:12 +00:00
volker.raschek 853c65a8ef Merge pull request 'chore(deps): update docker.io/library/node docker tag to v23' (#7) from renovate/docker.io-library-node-23.x into master
continuous-integration/drone/push Build is passing
Reviewed-on: #7
2024-11-27 10:02:29 +00:00
CSRBot c93c4dd4eb chore(deps): update docker.io/library/node docker tag to v23
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-26 23:25:34 +00:00
volker.raschek 4105bb9e0f doc(README): add badge of artifacthub.com
continuous-integration/drone/push Build is passing
2024-11-26 22:44:58 +01:00
volker.raschek 7ea826a2a1 fix(prometheusRule): use the fullname as group name
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2024-11-26 22:30:48 +01:00
volker.raschek aa8c279fe0 doc(README): update link of the exporterConfig.yaml documentation
continuous-integration/drone/push Build is failing
2024-11-26 22:19:52 +01:00
volker.raschek dfd4c1f991 doc(README): update introduction
continuous-integration/drone/push Build is passing
2024-11-26 22:14:27 +01:00
volker.raschek d6c2e4f992 doc(README): wrong order of helm install arguments
continuous-integration/drone/push Build is passing
2024-11-26 22:10:00 +01:00
volker.raschek ae7652a335 doc(README): update default value of enableHttp2
continuous-integration/drone/push Build is passing
2024-11-26 22:03:07 +01:00
volker.raschek 16cfa36fda fix(podMonitor,serviceMonitor): enable http2 by default
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is passing
2024-11-26 21:49:49 +01:00
volker.raschek 94fbc5e38f fix(deployment): concat lists correctly
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is passing
2024-11-26 21:01:45 +01:00
volker.raschek dcc7bae921 fix(secret): adapt of the web config secret
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing
2024-11-26 20:39:41 +01:00
volker.raschek 503c622df5 fix(deployment): adapt projected volume spec 2024-11-26 20:35:32 +01:00
volker.raschek bf9bd4853f fix(deployment): use correct webconfig filename
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing
2024-11-26 20:24:58 +01:00
volker.raschek 80a8e8096d fix(pod,podMonitor,service): avoid error of immutable labels
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing
2024-11-26 20:13:53 +01:00
volker.raschek 79b61b0035 core(renovate): update configuration
continuous-integration/drone/push Build is failing
2024-11-26 20:06:18 +01:00
volker.raschek d33b17b973 Merge pull request 'chore(deps): update prometheus-postgres-exporter docker tag to v0.16.0' (#5) from renovate/prometheus-postgres-exporter-0.x into master
continuous-integration/drone/push Build is failing
Reviewed-on: #5
2024-11-26 19:01:45 +00:00
volker.raschek a0d241c90c doc(README): adapt bookmark
continuous-integration/drone/push Build is failing
2024-11-26 20:00:46 +01:00
volker.raschek 1d061fe95f fix(serviceMonitor): bind the port always to the port of the service
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing
2024-11-26 19:59:11 +01:00
volker.raschek bb4a5d48b4 test(deployment): topologySpreadConstraints
continuous-integration/drone/push Build is passing
2024-11-26 19:55:26 +01:00
volker.raschek 1f6550d169 test(deployment): tolerations 2024-11-26 19:55:26 +01:00
volker.raschek a01c7d8c45 test(deployment): terminationGracePeriodSeconds 2024-11-26 19:55:26 +01:00
volker.raschek 2dd99e8b13 fix(deployment): restartPolicy 2024-11-26 19:55:26 +01:00
volker.raschek 4945cd1c2e test(deployment): imagePullSecrets 2024-11-26 19:55:26 +01:00
volker.raschek ed10c5362a test(deployment): hostNetwork, hostname, subdomain 2024-11-26 19:55:26 +01:00
volker.raschek 70abc21fb4 test(deployment): dnsPolicy 2024-11-26 19:55:26 +01:00
volker.raschek 8618b52ef6 test(deployment): dnsConfig 2024-11-26 19:55:26 +01:00
volker.raschek 967d36cafb test(deployment): priorityClassName 2024-11-26 19:55:26 +01:00
volker.raschek 8f36f688d0 test(deployment): nodeSelector 2024-11-26 19:55:26 +01:00
volker.raschek 8d1f6622b8 doc(README): adapt key name of exporterConfig secret 2024-11-26 19:55:26 +01:00
volker.raschek bd04d4a349 fix(values): suppres warning of overwriting table with non-table 2024-11-26 19:55:26 +01:00
volker.raschek 3105f2a408 test(deployment): securityContext 2024-11-26 19:55:26 +01:00
volker.raschek 3a96e4ac5d test(deployment): resources 2024-11-26 19:55:26 +01:00
volker.raschek abd73d82f2 test(deployment,secrets): volume and volumeMounts 2024-11-26 19:55:26 +01:00
volker.raschek 19b5ac5969 test(deployment,secrets): imageRegistry, imageRepository, imagePullPolicy 2024-11-26 19:55:26 +01:00
volker.raschek 7b98e68b03 fix(deployment,secrets): deploy always the web-config secret 2024-11-26 19:55:26 +01:00
volker.raschek 6c30756f8d fix(deployment): extend arguments 2024-11-26 19:55:26 +01:00
CSRBot 688718008f chore(deps): update prometheus-postgres-exporter docker tag to v0.16.0
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-11-26 05:27:13 +00:00
CSRBot be0e152de8 chore(deps): update docker.io/library/node docker tag to v22.11.0
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-26 02:40:29 +00:00
CSRBot 4edf2660de chore(deps): update git.cryptic.systems/volker.raschek/git docker tag to v1.4.0
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-25 23:41:05 +00:00
volker.raschek c1a2a098c8 doc(README): adapt warning blockquote
continuous-integration/drone/push Build is passing
2024-11-25 23:25:03 +01:00
volker.raschek 085a68c60c revert(README): adapt warning blockquote
This reverts commit 98fe8fe2a4.
2024-11-25 23:24:04 +01:00
volker.raschek 98fe8fe2a4 doc(README): adapt warning blockquote
continuous-integration/drone/push Build is failing
2024-11-25 23:17:33 +01:00
volker.raschek 7d02c5f7b3 doc(README): adapt warning blockquote
continuous-integration/drone/push Build is passing
2024-11-25 23:14:39 +01:00
CSRBot cbdf696a4e chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.42.0
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-25 20:26:07 +00:00
volker.raschek 42af0f9739 fix(serviceAccount): remove top level dict .spec
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-11-25 19:35:46 +01:00
volker.raschek 5c0f2fb310 core(chart): add further chart labels for search engine
continuous-integration/drone/push Build is passing
2024-11-25 19:08:36 +01:00
volker.raschek c211bd7a61 fix: rename chart repository
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing
2024-11-25 19:01:37 +01:00
volker.raschek 6d2a3675b1 fix(ci): rename chart repository
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-11-25 18:48:31 +01:00
23 changed files with 632 additions and 239 deletions
+9 -9
View File
@@ -12,7 +12,7 @@ platform:
steps: steps:
- name: clone repository - name: clone repository
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: helm lint - name: helm lint
commands: commands:
@@ -26,7 +26,7 @@ steps:
- name: markdown lint - name: markdown lint
commands: commands:
- markdownlint *.md - markdownlint *.md
image: git.cryptic.systems/volker.raschek/markdownlint:0.41.0 image: git.cryptic.systems/volker.raschek/markdownlint:0.42.0
resources: resources:
limits: limits:
cpu: 150 cpu: 150
@@ -73,7 +73,7 @@ platform:
steps: steps:
- name: clone repository - name: clone repository
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: helm unittest - name: helm unittest
commands: commands:
@@ -125,14 +125,14 @@ platform:
steps: steps:
- name: clone repository - name: clone repository
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: generate README - name: generate README
commands: commands:
- npm install - npm install
- npm run readme:parameters - npm run readme:parameters
- npm run readme:lint - npm run readme:lint
image: docker.io/library/node:22.9.0-alpine image: docker.io/library/node:23.3.0-alpine
resources: resources:
limits: limits:
cpu: 150 cpu: 150
@@ -141,7 +141,7 @@ steps:
- name: detect diff - name: detect diff
commands: commands:
- git diff --exit-code --name-only README.md - git diff --exit-code --name-only README.md
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: email-notification - name: email-notification
environment: environment:
@@ -183,13 +183,13 @@ platform:
steps: steps:
- name: clone repository - name: clone repository
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: release-helm-chart - name: release-helm-chart
commands: commands:
- helm repo add prometheus-exporter https://charts.cryptic.systems/prometheus-exporter - helm repo add prometheus-exporters https://charts.cryptic.systems/prometheus-exporters
- helm package --version ${DRONE_TAG} . - helm package --version ${DRONE_TAG} .
- helm cm-push ${DRONE_REPO_NAME}-${DRONE_TAG}.tgz prometheus-exporter - helm cm-push ${DRONE_REPO_NAME}-${DRONE_TAG}.tgz prometheus-exporters
environment: environment:
HELM_REPO_PASSWORD: HELM_REPO_PASSWORD:
from_secret: helm_repo_password from_secret: helm_repo_password
+16 -5
View File
@@ -26,7 +26,7 @@
.vscode/ .vscode/
# drone # drone
.drone.ya?ml .drone.yml
# editorconfig # editorconfig
.editorconfig .editorconfig
@@ -37,13 +37,24 @@ values2.yaml
# helm packages # helm packages
*.tgz *.tgz
.helmignore
unittests
# markdownlint # markdownlint
.markdownlint.yml .markdownlint.yml
.markdownlint.yaml .markdownlint.yaml
.markdownlintignore
# maven # npm
target .prettierignore
.npmrc
package*
# serviceDescriptor (uctl-cluster) # yamllint
serviceDescriptor.yaml .yamllint.yaml
# Others
CONTRIBUTING.md
CODEOWNERS
Makefile
renovate.json
+82 -1
View File
@@ -1 +1,82 @@
# Contribution Guidelines # Contributing
I am very happy if you would like to provide a pull request 👍
The content of this file describes which requirements contributors should fulfill before submitting a pull request (PR).
1. [Valid Git commits](#valid-git-commits)
## Valid Git commits
### Commit message
The repository is subject to a strict commit message template. This states that there are several types of commits. For
example, `fix`, `chore`, `refac`, `test` or `doc`. All types are described in more detail below.
| type | description |
| ------------------- | ----------------------------------------------------------------- |
| `feat` | New feature. |
| `fix` | Fixes a bug. |
| `refac` | Refactoring production code. |
| `style` | Fixes formatting issues. No production code change. |
| `docs` | Adapt documentation. No production code change. |
| `test` | Adds new or modifies existing tests. No production code change. |
| `chore` | Updating grunt tasks. Is everything which the user does not see. |
Based on these types, commit messaged can then be created. Here are a few examples:
```text
style(README): Wrong indentation
feat(deployment): support restartPolicy
fix(my-app): Add missing volume
docs(CONTRIBUTING): Describe how to commit correctly
```
This type of commit message makes it easier for me as maintainer to keep an overview and does not cause the commits of a
pull request PR to be combined into one commit (squashing).
### Smart commits
Smart commits are excellent when it comes to tracking bugs or issues. In this repository, however, the rebasing of
commits is prohibited, which means that only merge commits are possible. This means that a smart commit message only
needs to be added to the merge commit.
This has the advantage that the maintainer can use the smart commit to find the merge commit and undo the entire history
of a merge without having to select individual commits. The following history illustrates the correct use of smart commits.
```text
* 823edbc7 Volker Raschek (G) | [Close #2] feat(deployment): support additional containers
|\
| * 321aebc3 Volker Raschek (G) | doc(README): generate README with new deployment attributes
| * 8d101dd3 Volker Raschek (G) | test(deployment): Extend unittest of additional containers
| * 6f2abd93 Volker Raschek (G) | fix(deployment): Extend deployment of additional containers
|/
* aa5ebda bob (N) | [Close #1] feat(deployment): support initContainers
```
### Commit signing
Another problem with Git is the chain of trust. Git allows the configuration of any name and e-mail address. An attacker
can impersonate any person and submit pull requests under a false identity. For as Linux Torvalds, the maintainer of the
Linux kernel.
```bash
git config --global user.name 'Linux Torvalds'
git config --global user.email 'torvalds@linux-foundation.org'
```
To avoid this, some Git repositories expect signed commits. In particular, repositories that are subject to direct
delivery to customers. For this reason, the repository is subject to a branch protection rule that only allows signed
commits. *Until* there is *no verified* and *no signed* commit, the pull request is blocked.
The following articles describes how Git can be configured to sign commits. Please keep in mind, that the e-mail
address, which is used as UID of the GPG keyring must also be defined in the profile settings of your GitHub account.
Otherwise will be marked the Git commit as *Unverified*.
1. [Signing Commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
2. [Tell Git about your signing key](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key)
Inspect your Git commit via `git log`. There should be mentioned, that your commit is signed.
Furthermore, the GPG key is unique. **Don't loose your private GPG key**. Backup your private key on a safe device. For
example an external USB drive.
+4 -3
View File
@@ -4,14 +4,15 @@ description: Prometheus metric exporter for PostgreSQL
type: application type: application
kubeVersion: ">=1.20.0" kubeVersion: ">=1.20.0"
version: "0.1.0" version: "0.1.0"
appVersion: "0.15.0" appVersion: "0.16.0"
# icon: https://annotations.example.com/icon.png # icon: https://annotations.example.com/icon.png
keywords: keywords:
- prometheus - prometheus
- prometheus exporter - prometheus-exporter
- postgres - postgres-postgres-exporter
- postgres-exporter
sources: sources:
- https://github.com/prometheus-community/postgres_exporter - https://github.com/prometheus-community/postgres_exporter
-19
View File
@@ -19,12 +19,6 @@ NODE_IMAGE_REPOSITORY=library/node
NODE_IMAGE_VERSION?=22.9.0-alpine # renovate: datasource=docker registryUrl=https://docker.io depName=library/node NODE_IMAGE_VERSION?=22.9.0-alpine # renovate: datasource=docker registryUrl=https://docker.io depName=library/node
NODE_IMAGE_FULLY_QUALIFIED=${NODE_IMAGE_REGISTRY_HOST}/${NODE_IMAGE_REPOSITORY}:${NODE_IMAGE_VERSION} NODE_IMAGE_FULLY_QUALIFIED=${NODE_IMAGE_REGISTRY_HOST}/${NODE_IMAGE_REPOSITORY}:${NODE_IMAGE_VERSION}
# CHART_SERVER
CHART_SERVER_HOST?=charts.u.orbis-healthcare.com
CHART_SERVER_NAMESPACE?=orbis-u
CHART_SERVER_REPOSITORY?=qu-seed
CHART_VERSION?=0.1.0
# MISSING DOT # MISSING DOT
# ============================================================================== # ==============================================================================
missing-dot: missing-dot:
@@ -67,19 +61,6 @@ container-run/helm-update-dependencies:
${HELM_IMAGE_FULLY_QUALIFIED} \ ${HELM_IMAGE_FULLY_QUALIFIED} \
dependency update dependency update
# CONTAINER RUN - DEPLOY2CHART-REPO
# ==============================================================================
container-run/deploy2chart-repo:
${CONTAINER_RUNTIME} run \
--env HELM_REPO_PASSWORD=${CHART_SERVER_PASSWORD} \
--env HELM_REPO_USERNAME=${CHART_SERVER_USERNAME} \
--entrypoint /bin/bash \
--rm \
--volume $(shell pwd):$(shell pwd) \
--workdir $(shell pwd) \
${HELM_IMAGE_FULLY_QUALIFIED} \
-c "helm repo add ${CHART_SERVER_NAMESPACE} http://${CHART_SERVER_HOST}/${CHART_SERVER_NAMESPACE} && helm package --version ${CHART_VERSION} . && helm cm-push ./${CHART_SERVER_REPOSITORY}-${CHART_VERSION}.tgz ${CHART_SERVER_NAMESPACE}"
# CONTAINER RUN - MARKDOWN-LINT # CONTAINER RUN - MARKDOWN-LINT
# ============================================================================== # ==============================================================================
PHONY+=container-run/helm-lint PHONY+=container-run/helm-lint
+39 -38
View File
@@ -1,20 +1,21 @@
# Prometheus PostgreSQL exporter # Prometheus PostgreSQL exporter
[![Build Status](https://drone.cryptic.systems/api/badges/volker.raschek/prometheus-postgres-exporter/status.svg)](https://drone.cryptic.systems/volker.raschek/prometheus-postgres-exporter) [![Build Status](https://drone.cryptic.systems/api/badges/volker.raschek/prometheus-postgres-exporter/status.svg)](https://drone.cryptic.systems/volker.raschek/prometheus-postgres-exporter)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/prometheus-exporters)](https://artifacthub.io/packages/search?repo=prometheus-exporters)
> [!NOTE]
> This is not the official *community* helm chart of the Prometheus metric exporter for PostgreSQL databases. You can
> find the official community chart [here](https://github.com/prometheus-community/helm-charts).
This helm chart enables the deployment of a Prometheus metrics exporter for PostgreSQL databases and allows the This helm chart enables the deployment of a Prometheus metrics exporter for PostgreSQL databases and allows the
individual configuration of additional containers/initContainers, mounting of volumes, defining additional environment individual configuration of additional containers/initContainers, mounting of volumes, defining additional environment
variables, apply a user-defined web-config.yaml and much more. variables, apply a user-defined `webConfig.yaml` and much more.
Chapter [configuration and installation](#helm-configuration-and-installation) describes the basics how to configure helm Chapter [configuration and installation](#helm-configuration-and-installation) describes the basics how to configure helm
and use it to deploy the exporter. It also contains further configuration examples. and use it to deploy the exporter. It also contains further configuration examples.
Furthermore, this helm chart unit tests to detect regressions and stabilize the deployment. Additionally, this helm Furthermore, this helm chart contains unit tests to detect regressions and stabilize the deployment. Additionally, this
chart is tested for deployment scenarios with ArgoCD. helm chart is tested for deployment scenarios with **ArgoCD**.
> ![NOTE]
> This is not the official *community* helm chart of the Prometheus metric exporter for PostgreSQL databases. You can
> find the official community chart [here](https://github.com/prometheus-community/helm-charts).
## Helm: configuration and installation ## Helm: configuration and installation
@@ -29,9 +30,9 @@ chart is tested for deployment scenarios with ArgoCD.
> time is not possible. > time is not possible.
```bash ```bash
helm repo add prometheus-exporter https://charts.cryptic.systems/prometheus-exporter helm repo add prometheus-exporters https://charts.cryptic.systems/prometheus-exporters
helm repo update helm repo update
helm install prometheus-exporter/prometheus-postgres-exporter prometheus-postgres-exporter \ helm install prometheus-postgres-exporter prometheus-exporters/prometheus-postgres-exporter \
--set 'config.database.secret.databaseUsername=postgres' \ --set 'config.database.secret.databaseUsername=postgres' \
--set 'config.database.secret.databasePassword=postgres' \ --set 'config.database.secret.databasePassword=postgres' \
--set 'config.database.secret.databaseConnectionUrl="postgres.example.local:5432/postgres?ssl=disable"' \ --set 'config.database.secret.databaseConnectionUrl="postgres.example.local:5432/postgres?ssl=disable"' \
@@ -45,7 +46,7 @@ version of the chart must be in sync with the `values.yaml`. Newer *minor* versi
versions can break something! versions can break something!
```bash ```bash
helm show values prometheus-exporter/prometheus-postgres-exporter --version 0.1.0 > values.yaml helm show values prometheus-exporters/prometheus-postgres-exporter --version 0.1.0 > values.yaml
``` ```
A complete list of available helm chart versions can be displayed via the following command: A complete list of available helm chart versions can be displayed via the following command:
@@ -66,12 +67,12 @@ The following examples serve as individual configurations and as inspiration for
The first example shows how to deploy the metric exporter with TLS encryption. The verification of the custom TLS The first example shows how to deploy the metric exporter with TLS encryption. The verification of the custom TLS
certification will be skipped by Prometheus. certification will be skipped by Prometheus.
> [!WARN] > [!WARNING]
> A TLS secret with the name `prometheus-postgresql-exporter-http` containing a `ca.crt`, `tls.key` and `tls.crt` is > The secret `prometheus-postgresql-exporter-http` containing the TLS certificate is already present. The keys `ca.crt`,
> already present. > `tls.key` and `tls.crt` of the secret can be mounted into the container filesystem for TLS authentication / encryption.
```bash ```bash
helm install prometheus-exporter/prometheus-postgres-exporter prometheus-postgres-exporter \ helm install prometheus-postgres-exporter prometheus-exporters/prometheus-postgres-exporter \
--set 'config.database.secret.databaseUsername=postgres' \ --set 'config.database.secret.databaseUsername=postgres' \
--set 'config.database.secret.databasePassword=postgres' \ --set 'config.database.secret.databasePassword=postgres' \
--set 'config.database.secret.databaseConnectionUrl="postgres.example.local:5432/postgres?ssl=disable"' \ --set 'config.database.secret.databaseConnectionUrl="postgres.example.local:5432/postgres?ssl=disable"' \
@@ -94,7 +95,7 @@ certificate for the metrics exporter - TLS certificate verification can be enabl
replaced: replaced:
```diff ```diff
helm install prometheus-exporter/prometheus-postgres-exporter prometheus-postgres-exporter \ helm install prometheus-postgres-exporter prometheus-exporters/prometheus-postgres-exporter \
--set 'config.database.secret.databaseUsername=postgres' \ --set 'config.database.secret.databaseUsername=postgres' \
--set 'config.database.secret.databasePassword=postgres' \ --set 'config.database.secret.databasePassword=postgres' \
--set 'config.database.secret.databaseConnectionUrl="postgres.example.local:5432/postgres?ssl=disable"' \ --set 'config.database.secret.databaseConnectionUrl="postgres.example.local:5432/postgres?ssl=disable"' \
@@ -126,25 +127,25 @@ replaced:
### Configuration ### Configuration
| Name | Description | Value | | Name | Description | Value |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `config.database.existingSecret.enabled` | Mount an existing secret containing the application specific `DATA_SOURCE_` prefixed environment variables. | `false` | | `config.database.existingSecret.enabled` | Mount an existing secret containing the application specific `DATA_SOURCE_` prefixed environment variables. | `false` |
| `config.database.existingSecret.secretName` | Name of the existing secret containing the application specific `DATA_SOURCE_` prefixed environment variables. | `""` | | `config.database.existingSecret.secretName` | Name of the existing secret containing the application specific `DATA_SOURCE_` prefixed environment variables. | `""` |
| `config.database.secret.annotations` | Additional annotations of the secret containing the database credentials. | `{}` | | `config.database.secret.annotations` | Additional annotations of the secret containing the database credentials. | `{}` |
| `config.database.secret.labels` | Additional labels of the secret containing the database credentials. | `{}` | | `config.database.secret.labels` | Additional labels of the secret containing the database credentials. | `{}` |
| `config.database.secret.databaseUsername` | Database username. Will be defined as env `DATA_SOURCE_USER` as part of a secret. | `""` | | `config.database.secret.databaseUsername` | Database username. Will be defined as env `DATA_SOURCE_USER` as part of a secret. | `""` |
| `config.database.secret.databasePassword` | Database password. Will be defined as env `DATA_SOURCE_PASS` as part of a secret. | `""` | | `config.database.secret.databasePassword` | Database password. Will be defined as env `DATA_SOURCE_PASS` as part of a secret. | `""` |
| `config.database.secret.databaseConnectionUrl` | Complex database connection URL. Will be defined as env `DATA_SOURCE_URI` as part of a secret. | `""` | | `config.database.secret.databaseConnectionUrl` | Complex database connection URL. Will be defined as env `DATA_SOURCE_URI` as part of a secret. | `""` |
| `config.exporterConfig.existingSecret.enabled` | Mount an existing secret containing the key `exporter_config.yaml`. | `false` | | `config.exporterConfig.existingSecret.enabled` | Mount an existing secret containing the key `exporterConfig.yaml`. | `false` |
| `config.exporterConfig.existingSecret.secretName` | Name of the existing secret containing the key `exporter_config.yaml`. | `""` | | `config.exporterConfig.existingSecret.secretName` | Name of the existing secret containing the key `exporterConfig.yaml`. | `""` |
| `config.exporterConfig.secret.annotations` | Additional annotations of the secret containing the `exporterConfig.yaml`. | `{}` | | `config.exporterConfig.secret.annotations` | Additional annotations of the secret containing the `exporterConfig.yaml`. | `{}` |
| `config.exporterConfig.secret.labels` | Additional labels of the secret containing the `exporterConfig.yaml`. | `{}` | | `config.exporterConfig.secret.labels` | Additional labels of the secret containing the `exporterConfig.yaml`. | `{}` |
| `config.exporterConfig.secret.exporterConfig` | Content of the `exporterConfig.yaml`. Further information can be found [here](https://prometheus.io/docs/prometheus/latest/configuration/https/). | `{}` | | `config.exporterConfig.secret.exporterConfig` | Content of the `exporterConfig.yaml`. Further information can be found [here](https://github.com/prometheus-community/postgres_exporter?tab=readme-ov-file#multi-target-support-beta). | `{}` |
| `config.webConfig.existingSecret.enabled` | Mount an existing secret containing the key `webConfig.yaml`. | `false` | | `config.webConfig.existingSecret.enabled` | Mount an existing secret containing the key `webConfig.yaml`. | `false` |
| `config.webConfig.existingSecret.secretName` | Name of the existing secret containing the key `webConfig.yaml`. | `""` | | `config.webConfig.existingSecret.secretName` | Name of the existing secret containing the key `webConfig.yaml`. | `""` |
| `config.webConfig.secret.annotations` | Additional annotations of the secret containing the `webConfig.yaml`. | `{}` | | `config.webConfig.secret.annotations` | Additional annotations of the secret containing the `webConfig.yaml`. | `{}` |
| `config.webConfig.secret.labels` | Additional labels of the secret containing the `webConfig.yaml`. | `{}` | | `config.webConfig.secret.labels` | Additional labels of the secret containing the `webConfig.yaml`. | `{}` |
| `config.webConfig.secret.webConfig` | Content of the `webConfig.yaml`. Further information can be found [here](https://prometheus.io/docs/prometheus/latest/configuration/https/). | `{}` | | `config.webConfig.secret.webConfig` | Content of the `webConfig.yaml`. Further information can be found [here](https://prometheus.io/docs/prometheus/latest/configuration/https/). | `{}` |
### Deployment ### Deployment
@@ -170,10 +171,11 @@ replaced:
| `deployment.postgresExporter.image.pullPolicy` | Image pull policy. | `IfNotPresent` | | `deployment.postgresExporter.image.pullPolicy` | Image pull policy. | `IfNotPresent` |
| `deployment.postgresExporter.resources` | CPU and memory resources of the pod. | `{}` | | `deployment.postgresExporter.resources` | CPU and memory resources of the pod. | `{}` |
| `deployment.postgresExporter.securityContext` | Security context of the container of the deployment. | `{}` | | `deployment.postgresExporter.securityContext` | Security context of the container of the deployment. | `{}` |
| `deployment.postgresExporter.volumeMounts` | Additional volume mounts. | `{}` | | `deployment.postgresExporter.volumeMounts` | Additional volume mounts. | `[]` |
| `deployment.nodeSelector` | NodeSelector of the postgres-exporter deployment. | `{}` | | `deployment.nodeSelector` | NodeSelector of the postgres-exporter deployment. | `{}` |
| `deployment.priorityClassName` | PriorityClassName of the postgres-exporter deployment. | `""` | | `deployment.priorityClassName` | PriorityClassName of the postgres-exporter deployment. | `""` |
| `deployment.replicaCount` | Number of replicas for the postgres-exporter deployment. | `1` | | `deployment.replicaCount` | Number of replicas for the postgres-exporter deployment. | `1` |
| `deployment.restartPolicy` | Restart policy of the postgres-exporter deployment. | `""` |
| `deployment.securityContext` | Security context of the postgres-exporter deployment. | `{}` | | `deployment.securityContext` | Security context of the postgres-exporter deployment. | `{}` |
| `deployment.strategy.type` | Strategy type - `Recreate` or `Rollingupdate`. | `Recreate` | | `deployment.strategy.type` | Strategy type - `Recreate` or `Rollingupdate`. | `Recreate` |
| `deployment.strategy.rollingUpdate.maxSurge` | The maximum number of pods that can be scheduled above the desired number of pods during a rolling update. | `1` | | `deployment.strategy.rollingUpdate.maxSurge` | The maximum number of pods that can be scheduled above the desired number of pods during a rolling update. | `1` |
@@ -220,7 +222,7 @@ replaced:
| `prometheus.metrics.enabled` | Enable of scraping metrics by Prometheus. | `true` | | `prometheus.metrics.enabled` | Enable of scraping metrics by Prometheus. | `true` |
| `prometheus.metrics.podMonitor.enabled` | Enable creation of a podMonitor. Excludes the existence of a serviceMonitor resource. | `false` | | `prometheus.metrics.podMonitor.enabled` | Enable creation of a podMonitor. Excludes the existence of a serviceMonitor resource. | `false` |
| `prometheus.metrics.podMonitor.annotations` | Additional podMonitor annotations. | `{}` | | `prometheus.metrics.podMonitor.annotations` | Additional podMonitor annotations. | `{}` |
| `prometheus.metrics.podMonitor.enableHttp2` | Enable HTTP2. | `false` | | `prometheus.metrics.podMonitor.enableHttp2` | Enable HTTP2. | `true` |
| `prometheus.metrics.podMonitor.followRedirects` | FollowRedirects configures whether scrape requests follow HTTP 3xx redirects. | `false` | | `prometheus.metrics.podMonitor.followRedirects` | FollowRedirects configures whether scrape requests follow HTTP 3xx redirects. | `false` |
| `prometheus.metrics.podMonitor.honorLabels` | Honor labels. | `false` | | `prometheus.metrics.podMonitor.honorLabels` | Honor labels. | `false` |
| `prometheus.metrics.podMonitor.labels` | Additional podMonitor labels. | `{}` | | `prometheus.metrics.podMonitor.labels` | Additional podMonitor labels. | `{}` |
@@ -233,12 +235,11 @@ replaced:
| `prometheus.metrics.serviceMonitor.enabled` | Enable creation of a serviceMonitor. Excludes the existence of a podMonitor resource. | `false` | | `prometheus.metrics.serviceMonitor.enabled` | Enable creation of a serviceMonitor. Excludes the existence of a podMonitor resource. | `false` |
| `prometheus.metrics.serviceMonitor.annotations` | Additional serviceMonitor annotations. | `{}` | | `prometheus.metrics.serviceMonitor.annotations` | Additional serviceMonitor annotations. | `{}` |
| `prometheus.metrics.serviceMonitor.labels` | Additional serviceMonitor labels. | `{}` | | `prometheus.metrics.serviceMonitor.labels` | Additional serviceMonitor labels. | `{}` |
| `prometheus.metrics.serviceMonitor.enableHttp2` | Enable HTTP2. | `false` | | `prometheus.metrics.serviceMonitor.enableHttp2` | Enable HTTP2. | `true` |
| `prometheus.metrics.serviceMonitor.followRedirects` | FollowRedirects configures whether scrape requests follow HTTP 3xx redirects. | `false` | | `prometheus.metrics.serviceMonitor.followRedirects` | FollowRedirects configures whether scrape requests follow HTTP 3xx redirects. | `false` |
| `prometheus.metrics.serviceMonitor.honorLabels` | Honor labels. | `false` | | `prometheus.metrics.serviceMonitor.honorLabels` | Honor labels. | `false` |
| `prometheus.metrics.serviceMonitor.interval` | Interval at which metrics should be scraped. If not specified Prometheus' global scrape interval is used. | `60s` | | `prometheus.metrics.serviceMonitor.interval` | Interval at which metrics should be scraped. If not specified Prometheus' global scrape interval is used. | `60s` |
| `prometheus.metrics.serviceMonitor.path` | HTTP path for scraping Prometheus metrics. | `/metrics` | | `prometheus.metrics.serviceMonitor.path` | HTTP path for scraping Prometheus metrics. | `/metrics` |
| `prometheus.metrics.serviceMonitor.port` | HTTP port for scraping Prometheus metrics. | `9187` |
| `prometheus.metrics.serviceMonitor.relabelings` | RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. | `[]` | | `prometheus.metrics.serviceMonitor.relabelings` | RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. | `[]` |
| `prometheus.metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended. If not specified, global Prometheus scrape timeout is used. | `30s` | | `prometheus.metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended. If not specified, global Prometheus scrape timeout is used. | `30s` |
| `prometheus.metrics.serviceMonitor.scheme` | HTTP scheme to use for scraping. For example `http` or `https`. | `http` | | `prometheus.metrics.serviceMonitor.scheme` | HTTP scheme to use for scraping. For example `http` or `https`. | `http` |
+69 -80
View File
@@ -8,7 +8,7 @@
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@bitnami/readme-generator-for-helm": "^2.5.0", "@bitnami/readme-generator-for-helm": "^2.5.0",
"markdownlint-cli": "^0.41.0" "markdownlint-cli": "^0.43.0"
}, },
"engines": { "engines": {
"node": ">=16.0.0", "node": ">=16.0.0",
@@ -48,16 +48,6 @@
"node": ">=12" "node": ">=12"
} }
}, },
"node_modules/@pkgjs/parseargs": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
"dev": true,
"optional": true,
"engines": {
"node": ">=14"
}
},
"node_modules/ansi-regex": { "node_modules/ansi-regex": {
"version": "6.0.1", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
@@ -228,18 +218,6 @@
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"dev": true "dev": true
}, },
"node_modules/get-stdin": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz",
"integrity": "sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/glob": { "node_modules/glob": {
"version": "7.2.3", "version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
@@ -261,10 +239,11 @@
} }
}, },
"node_modules/ignore": { "node_modules/ignore": {
"version": "5.3.1", "version": "6.0.2",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", "resolved": "https://registry.npmjs.org/ignore/-/ignore-6.0.2.tgz",
"integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "integrity": "sha512-InwqeHHN2XpumIkMvpl/DCJVrAHgCsG5+cn1XlnLWGwtZBm8QJfSusItfrwx81CTp5agNZqpKU2J/ccC5nGT4A==",
"dev": true, "dev": true,
"license": "MIT",
"engines": { "engines": {
"node": ">= 4" "node": ">= 4"
} }
@@ -310,22 +289,19 @@
"dev": true "dev": true
}, },
"node_modules/jackspeak": { "node_modules/jackspeak": {
"version": "3.1.2", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz",
"integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", "integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==",
"dev": true, "dev": true,
"license": "BlueOak-1.0.0", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"@isaacs/cliui": "^8.0.2" "@isaacs/cliui": "^8.0.2"
}, },
"engines": { "engines": {
"node": ">=14" "node": "20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
},
"optionalDependencies": {
"@pkgjs/parseargs": "^0.11.0"
} }
}, },
"node_modules/js-yaml": { "node_modules/js-yaml": {
@@ -341,10 +317,11 @@
} }
}, },
"node_modules/jsonc-parser": { "node_modules/jsonc-parser": {
"version": "3.2.1", "version": "3.3.1",
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz",
"integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==",
"dev": true "dev": true,
"license": "MIT"
}, },
"node_modules/jsonpointer": { "node_modules/jsonpointer": {
"version": "5.0.1", "version": "5.0.1",
@@ -371,12 +348,13 @@
"dev": true "dev": true
}, },
"node_modules/lru-cache": { "node_modules/lru-cache": {
"version": "10.2.2", "version": "11.0.2",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz",
"integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==",
"dev": true, "dev": true,
"license": "ISC",
"engines": { "engines": {
"node": "14 || >=16.14" "node": "20 || >=22"
} }
}, },
"node_modules/markdown-it": { "node_modules/markdown-it": {
@@ -410,13 +388,14 @@
} }
}, },
"node_modules/markdownlint": { "node_modules/markdownlint": {
"version": "0.34.0", "version": "0.36.1",
"resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.34.0.tgz", "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.36.1.tgz",
"integrity": "sha512-qwGyuyKwjkEMOJ10XN6OTKNOVYvOIi35RNvDLNxTof5s8UmyGHlCdpngRHoRGNvQVGuxO3BJ7uNSgdeX166WXw==", "integrity": "sha512-s73fU2CQN7WCgjhaQUQ8wYESQNzGRNOKDd+3xgVqu8kuTEhmwepd/mxOv1LR2oV046ONrTLBFsM7IoKWNvmy5g==",
"dev": true, "dev": true,
"license": "MIT",
"dependencies": { "dependencies": {
"markdown-it": "14.1.0", "markdown-it": "14.1.0",
"markdownlint-micromark": "0.1.9" "markdownlint-micromark": "0.1.12"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
@@ -426,23 +405,22 @@
} }
}, },
"node_modules/markdownlint-cli": { "node_modules/markdownlint-cli": {
"version": "0.41.0", "version": "0.43.0",
"resolved": "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.41.0.tgz", "resolved": "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.43.0.tgz",
"integrity": "sha512-kp29tKrMKdn+xonfefjp3a/MsNzAd9c5ke0ydMEI9PR98bOjzglYN4nfMSaIs69msUf1DNkgevAIAPtK2SeX0Q==", "integrity": "sha512-6vwurKK4B21eyYzwgX6ph13cZS7hE6LZfcS8QyD722CyxVD2RtAvbZK2p7k+FZbbKORulEuwl+hJaEq1l6/hoQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"commander": "~12.1.0", "commander": "~12.1.0",
"get-stdin": "~9.0.0", "glob": "~11.0.0",
"glob": "~10.4.1", "ignore": "~6.0.2",
"ignore": "~5.3.1",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"jsonc-parser": "~3.2.1", "jsonc-parser": "~3.3.1",
"jsonpointer": "5.0.1", "jsonpointer": "5.0.1",
"markdownlint": "~0.34.0", "markdownlint": "~0.36.1",
"minimatch": "~9.0.4", "minimatch": "~10.0.1",
"run-con": "~1.3.2", "run-con": "~1.3.2",
"smol-toml": "~1.2.0" "smol-toml": "~1.3.1"
}, },
"bin": { "bin": {
"markdownlint": "markdownlint.js" "markdownlint": "markdownlint.js"
@@ -472,49 +450,51 @@
} }
}, },
"node_modules/markdownlint-cli/node_modules/glob": { "node_modules/markdownlint-cli/node_modules/glob": {
"version": "10.4.1", "version": "11.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz",
"integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==",
"dev": true, "dev": true,
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"foreground-child": "^3.1.0", "foreground-child": "^3.1.0",
"jackspeak": "^3.1.2", "jackspeak": "^4.0.1",
"minimatch": "^9.0.4", "minimatch": "^10.0.0",
"minipass": "^7.1.2", "minipass": "^7.1.2",
"path-scurry": "^1.11.1" "package-json-from-dist": "^1.0.0",
"path-scurry": "^2.0.0"
}, },
"bin": { "bin": {
"glob": "dist/esm/bin.mjs" "glob": "dist/esm/bin.mjs"
}, },
"engines": { "engines": {
"node": ">=16 || 14 >=14.18" "node": "20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
} }
}, },
"node_modules/markdownlint-cli/node_modules/minimatch": { "node_modules/markdownlint-cli/node_modules/minimatch": {
"version": "9.0.4", "version": "10.0.1",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz",
"integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==",
"dev": true, "dev": true,
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"brace-expansion": "^2.0.1" "brace-expansion": "^2.0.1"
}, },
"engines": { "engines": {
"node": ">=16 || 14 >=14.17" "node": "20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
} }
}, },
"node_modules/markdownlint-micromark": { "node_modules/markdownlint-micromark": {
"version": "0.1.9", "version": "0.1.12",
"resolved": "https://registry.npmjs.org/markdownlint-micromark/-/markdownlint-micromark-0.1.9.tgz", "resolved": "https://registry.npmjs.org/markdownlint-micromark/-/markdownlint-micromark-0.1.12.tgz",
"integrity": "sha512-5hVs/DzAFa8XqYosbEAEg6ok6MF2smDj89ztn9pKkCtdKHVdPQuGMH7frFfYL9mLkvfFe4pTyAMffLbjf3/EyA==", "integrity": "sha512-RlB6EwMGgc0sxcIhOQ2+aq7Zw1V2fBnzbXKGgYK/mVWdT7cz34fteKSwfYeo4rL6+L/q2tyC9QtD/PgZbkdyJQ==",
"dev": true, "dev": true,
"license": "MIT",
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
@@ -568,6 +548,13 @@
"wrappy": "1" "wrappy": "1"
} }
}, },
"node_modules/package-json-from-dist": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
"integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
"dev": true,
"license": "BlueOak-1.0.0"
},
"node_modules/path-is-absolute": { "node_modules/path-is-absolute": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
@@ -587,17 +574,17 @@
} }
}, },
"node_modules/path-scurry": { "node_modules/path-scurry": {
"version": "1.11.1", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
"integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==",
"dev": true, "dev": true,
"license": "BlueOak-1.0.0", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"lru-cache": "^10.2.0", "lru-cache": "^11.0.0",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" "minipass": "^7.1.2"
}, },
"engines": { "engines": {
"node": ">=16 || 14 >=14.18" "node": "20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
@@ -670,14 +657,16 @@
} }
}, },
"node_modules/smol-toml": { "node_modules/smol-toml": {
"version": "1.2.0", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.2.0.tgz", "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.3.1.tgz",
"integrity": "sha512-KObxdQANC/xje3OoatMbSwQf2XAvJ0RbK+4nmQRszFNZptbNRnMWqbLF/zb4sMi9xJ6HNyhWXeuZ9zC/I/XY7w==", "integrity": "sha512-tEYNll18pPKHroYSmLLrksq233j021G0giwW7P3D24jC54pQ5W5BXMsQ/Mvw1OJCmEYDgY+lrzT+3nNUtoNfXQ==",
"dev": true, "dev": true,
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"engines": { "engines": {
"node": ">= 18", "node": ">= 18"
"pnpm": ">= 9" },
"funding": {
"url": "https://github.com/sponsors/cyyynthia"
} }
}, },
"node_modules/string-width": { "node_modules/string-width": {
+1 -1
View File
@@ -14,6 +14,6 @@
}, },
"devDependencies": { "devDependencies": {
"@bitnami/readme-generator-for-helm": "^2.5.0", "@bitnami/readme-generator-for-helm": "^2.5.0",
"markdownlint-cli": "^0.41.0" "markdownlint-cli": "^0.43.0"
} }
} }
+3 -3
View File
@@ -24,10 +24,10 @@
"matchUpdateTypes": [ "minor", "patch"] "matchUpdateTypes": [ "minor", "patch"]
}, },
{ {
"addLabels": [ "renovate/prometheus-postgres-exporter", "renovate/automerge" ], "addLabels": [ "renovate/markdownlint", "renovate/automerge" ],
"automerge": true, "automerge": true,
"matchPackageNames": [ "prometheus-postgres-exporter" ], "matchPackageNames": [ "markdownlint-cli", "@bitnami/readme-generator-for-helm" ],
"matchManagers": [ "regex" ], "matchManagers": [ "npm" ],
"matchUpdateTypes": [ "minor", "patch"] "matchUpdateTypes": [ "minor", "patch"]
} }
], ],
@@ -52,19 +52,28 @@
{{/* volumeMounts */}} {{/* volumeMounts */}}
{{- define "prometheus-postgres-exporter.deployment.volumeMounts" -}} {{- define "prometheus-postgres-exporter.deployment.volumeMounts" -}}
{{- $volumeMounts := dict "volumeMounts" (.Values.deployment.postgresExporter.volumeMounts | default (list) ) }} {{- $volumeMounts := .Values.deployment.postgresExporter.volumeMounts | default list }}
{{- $volumeMounts = merge $volumeMounts (dict "volumeMounts" (list (dict "name" "exporter-config" "mountPath" "/etc/prometheus-postgres-exporter/config.d" ))) }} {{- $volumeMounts = concat $volumeMounts (list (dict "name" "config-d" "mountPath" "/etc/prometheus-postgres-exporter/config.d" )) }}
{{ toYaml $volumeMounts }} {{ toYaml (dict "volumeMounts" $volumeMounts) }}
{{- end -}} {{- end -}}
{{/* volumes */}} {{/* volumes */}}
{{- define "prometheus-postgres-exporter.deployment.volumes" -}} {{- define "prometheus-postgres-exporter.deployment.volumes" -}}
{{- $volumes := dict "volumes" (.Values.deployment.volumes | default (list) ) }} {{- $volumes := .Values.deployment.volumes | default list }}
{{- $secretName := .Values.config.exporterConfig.existingSecret.secretName -}}
{{- $exporterSecretName := .Values.config.exporterConfig.existingSecret.secretName -}}
{{- if not .Values.config.exporterConfig.existingSecret.enabled }} {{- if not .Values.config.exporterConfig.existingSecret.enabled }}
{{- $secretName = printf "%s-exporter-config" (include "prometheus-postgres-exporter.fullname" . ) }} {{- $exporterSecretName = printf "%s-exporter-config" (include "prometheus-postgres-exporter.fullname" . ) }}
{{- end }} {{- end }}
{{- $volumes = merge $volumes (dict "volumes" (list (dict "name" "exporter-config" "secret" (dict "secretName" $secretName)))) }}
{{ toYaml $volumes }} {{- $webConfigSecretName := .Values.config.webConfig.existingSecret.secretName -}}
{{- if not .Values.config.webConfig.existingSecret.enabled }}
{{- $webConfigSecretName = printf "%s-web-config" (include "prometheus-postgres-exporter.fullname" . ) }}
{{- end }}
{{- $volumes = concat $volumes (list (dict "name" "config-d" "projected" (dict "defaultMode" 444 "sources" (list (dict "secret" (dict "name" $exporterSecretName)) (dict "secret" (dict "name" $webConfigSecretName)))))) }}
{{ toYaml (dict "volumes" $volumes) }}
{{- end -}} {{- end -}}
@@ -13,5 +13,5 @@
{{- end }} {{- end }}
{{- define "prometheus-postgres-exporter.pod.selectorLabels" -}} {{- define "prometheus-postgres-exporter.pod.selectorLabels" -}}
{{ include "prometheus-postgres-exporter.pod.labels" . }} {{ include "prometheus-postgres-exporter.selectorLabels" . }}
{{- end }} {{- end }}
@@ -24,6 +24,7 @@ spec:
- name: postgres-exporter - name: postgres-exporter
args: args:
- "--config.file=/etc/prometheus-postgres-exporter/config.d/exporterConfig.yaml" - "--config.file=/etc/prometheus-postgres-exporter/config.d/exporterConfig.yaml"
- "--web.config.file=/etc/prometheus-postgres-exporter/config.d/webConfig.yaml"
- "--web.listen-address=:9187" - "--web.listen-address=:9187"
{{- range .Values.deployment.postgresExporter.args }} {{- range .Values.deployment.postgresExporter.args }}
- {{ . | quote }} - {{ . | quote }}
@@ -59,7 +60,7 @@ spec:
- name: http - name: http
containerPort: 9187 containerPort: 9187
protocol: TCP protocol: TCP
{{- with .Values.deployment.containerResources }} {{- with .Values.deployment.postgresExporter.resources }}
resources: resources:
{{- toYaml . | nindent 10 }} {{- toYaml . | nindent 10 }}
{{- end }} {{- end }}
@@ -80,7 +81,7 @@ spec:
dnsPolicy: {{ .Values.deployment.dnsPolicy }} dnsPolicy: {{ .Values.deployment.dnsPolicy }}
{{- end }} {{- end }}
{{- if .Values.deployment.hostname }} {{- if .Values.deployment.hostname }}
hostname: {{ .Values.batch.dbUpdate.hostname }} hostname: {{ .Values.deployment.hostname }}
{{- end }} {{- end }}
hostNetwork: {{ .Values.deployment.hostNetwork }} hostNetwork: {{ .Values.deployment.hostNetwork }}
{{- with .Values.deployment.imagePullSecrets }} {{- with .Values.deployment.imagePullSecrets }}
@@ -94,7 +95,9 @@ spec:
{{- if .Values.deployment.priorityClassName }} {{- if .Values.deployment.priorityClassName }}
priorityClassName: {{ .Values.deployment.priorityClassName }} priorityClassName: {{ .Values.deployment.priorityClassName }}
{{- end }} {{- end }}
{{- if .Values.deployment.restartPolicy }}
restartPolicy: {{ .Values.deployment.restartPolicy }} restartPolicy: {{ .Values.deployment.restartPolicy }}
{{- end }}
{{- with .Values.deployment.securityContext }} {{- with .Values.deployment.securityContext }}
securityContext: securityContext:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
@@ -16,7 +16,7 @@ metadata:
spec: spec:
{{- with .Values.prometheus.rules }} {{- with .Values.prometheus.rules }}
groups: groups:
- name: {{ template "prometheus-postgres-exporter.name" $ }} - name: {{ template "prometheus-postgres-exporter.fullname" $ }}
rules: rules:
{{ toYaml . | nindent 4 }} {{ toYaml . | nindent 4 }}
{{- end }} {{- end }}
@@ -1,4 +1,4 @@
{{- if and (not (.Values.config.webConfig.existingSecret.enabled)) .Values.config.webConfig.secret.webConfig }} {{- if not .Values.config.webConfig.existingSecret.enabled }}
--- ---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
@@ -11,7 +11,7 @@ metadata:
labels: labels:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
name: {{ include "prometheus-postgres-exporter.fullname" . }}-webconfig name: {{ include "prometheus-postgres-exporter.fullname" . }}-web-config
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
stringData: stringData:
webConfig.yaml: | webConfig.yaml: |
@@ -13,14 +13,13 @@ metadata:
{{- end }} {{- end }}
name: {{ include "prometheus-postgres-exporter.fullname" . }} name: {{ include "prometheus-postgres-exporter.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
spec: automountServiceAccountToken: {{ .Values.serviceAccount.new.automountServiceAccountToken }}
automountServiceAccountToken: {{ .Values.serviceAccount.new.automountServiceAccountToken }} {{- with .Values.serviceAccount.new.imagePullSecrets }}
{{- with .Values.serviceAccount.new.imagePullSecrets }} imagePullSecrets:
imagePullSecrets: {{- toYaml . | nindent 4 }}
{{- toYaml . | nindent 4 }} {{- end }}
{{- end }} {{- with .Values.serviceAccount.new.secrets }}
{{- with .Values.serviceAccount.new.secrets }} secrets:
secrets: {{- toYaml . | nindent 4 }}
{{- toYaml . | nindent 4 }} {{- end }}
{{- end }}
{{- end }} {{- end }}
@@ -25,8 +25,8 @@ spec:
{{- toYaml . | nindent 6 }} {{- toYaml . | nindent 6 }}
{{- end }} {{- end }}
scrapeTimeout: {{ required "The scrape timeout of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ required "The scrape timeout of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scrapeTimeout }}
scheme: {{ required "The scheme of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scheme}} scheme: {{ required "The scheme of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scheme }}
targetPort: {{ required "The port of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.port }} targetPort: {{ required "The port of the service is not defined!" .Values.services.http.port }}
{{- with .Values.prometheus.metrics.serviceMonitor.tlsConfig }} {{- with .Values.prometheus.metrics.serviceMonitor.tlsConfig }}
tlsConfig: tlsConfig:
{{- toYaml . | nindent 6 }} {{- toYaml . | nindent 6 }}
+331 -1
View File
@@ -32,8 +32,98 @@ tests:
content: content:
secretRef: secretRef:
name: prometheus-postgres-exporter-unittest-database-env name: prometheus-postgres-exporter-unittest-database-env
- equal:
path: spec.template.spec.containers[0].args
value:
- --config.file=/etc/prometheus-postgres-exporter/config.d/exporterConfig.yaml
- --web.config.file=/etc/prometheus-postgres-exporter/config.d/webConfig.yaml
- --web.listen-address=:9187
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- mountPath: /etc/prometheus-postgres-exporter/config.d
name: config-d
- equal:
path: spec.template.spec.volumes
value:
- name: config-d
projected:
defaultMode: 444
sources:
- secret:
name: prometheus-postgres-exporter-unittest-exporter-config
- secret:
name: prometheus-postgres-exporter-unittest-web-config
- equal:
path: spec.template.spec.containers[0].image
value: quay.io/prometheuscommunity/postgres-exporter:v0.1.0
- equal:
path: spec.template.spec.containers[0].imagePullPolicy
value: IfNotPresent
- notExists:
path: spec.template.spec.containers[0].resources
- notExists:
path: spec.template.spec.containers[0].securityContext
- notExists:
path: spec.template.spec.dnsConfig
- notExists:
path: spec.template.spec.dnsPolicy
- notExists:
path: spec.template.spec.hostname
- equal:
path: spec.template.spec.hostNetwork
value: false
- notExists:
path: spec.template.spec.imagePullSecrets
- notExists:
path: spec.template.spec.nodeSelector
- notExists:
path: spec.template.spec.priorityClassName
- notExists:
path: spec.template.spec.restartPolicy
- notExists:
path: spec.template.spec.subdomain
- equal:
path: spec.template.spec.terminationGracePeriodSeconds
value: 60
- notExists:
path: spec.template.spec.tolerations
- notExists:
path: spec.template.spec.topologySpreadConstraints
- it: Test custom database secret - it: Test additional arguments
set:
deployment.postgresExporter.args:
- "--foo=bar"
- "--bar=foo"
asserts:
- equal:
path: spec.template.spec.containers[0].args
value:
- --config.file=/etc/prometheus-postgres-exporter/config.d/exporterConfig.yaml
- --web.config.file=/etc/prometheus-postgres-exporter/config.d/webConfig.yaml
- --web.listen-address=:9187
- --foo=bar
- --bar=foo
- it: Test custom imageRegistry and imageRepository
set:
deployment.postgresExporter.image.registry: registry.example.local
deployment.postgresExporter.image.repository: path/special/prometheus-postgres-exporter
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: registry.example.local/path/special/prometheus-postgres-exporter:v0.1.0
- it: Test custom imagePullPolicy
set:
deployment.postgresExporter.image.pullPolicy: Always
asserts:
- equal:
path: spec.template.spec.containers[0].imagePullPolicy
value: Always
- it: Test config.database.existingSecret
set: set:
config.database.existingSecret.enabled: true config.database.existingSecret.enabled: true
config.database.existingSecret.secretName: custom-database-secret config.database.existingSecret.secretName: custom-database-secret
@@ -43,3 +133,243 @@ tests:
content: content:
secretRef: secretRef:
name: custom-database-secret name: custom-database-secret
- it: Test config.exporterConfig.existingSecret
set:
config.exporterConfig.existingSecret.enabled: true
config.exporterConfig.existingSecret.secretName: exporter-config-secret
asserts:
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- mountPath: /etc/prometheus-postgres-exporter/config.d
name: config-d
- equal:
path: spec.template.spec.volumes
value:
- name: config-d
projected:
defaultMode: 444
sources:
- secret:
name: exporter-config-secret
- secret:
name: prometheus-postgres-exporter-unittest-web-config
- it: Test config.webConfig.existingSecret
set:
config.webConfig.existingSecret.enabled: true
config.webConfig.existingSecret.secretName: web-config-secret
asserts:
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- mountPath: /etc/prometheus-postgres-exporter/config.d
name: config-d
- equal:
path: spec.template.spec.volumes
value:
- name: config-d
projected:
defaultMode: 444
sources:
- secret:
name: prometheus-postgres-exporter-unittest-exporter-config
- secret:
name: web-config-secret
- it: Test custom resource limits and requests
set:
deployment.postgresExporter.resources:
limits:
cpu: 100m
memory: 250MB
requests:
cpu: 25m
memory: 100MB
asserts:
- equal:
path: spec.template.spec.containers[0].resources
value:
limits:
cpu: 100m
memory: 250MB
requests:
cpu: 25m
memory: 100MB
- it: Test custom securityContext
set:
deployment.postgresExporter.securityContext:
capabilities:
add:
- NET_RAW
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
asserts:
- equal:
path: spec.template.spec.containers[0].securityContext
value:
capabilities:
add:
- NET_RAW
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
- it: Test dnsConfig
set:
deployment.dnsConfig:
nameservers:
- "8.8.8.8"
- "8.8.4.4"
asserts:
- equal:
path: spec.template.spec.dnsConfig
value:
nameservers:
- "8.8.8.8"
- "8.8.4.4"
- it: Test dnsPolicy
set:
deployment.dnsPolicy: ClusterFirst
asserts:
- equal:
path: spec.template.spec.dnsPolicy
value: ClusterFirst
- it: Test hostNetwork, hostname, subdomain
set:
deployment.hostNetwork: true
deployment.hostname: pg-exporter
deployment.subdomain: exporters.internal
asserts:
- equal:
path: spec.template.spec.hostNetwork
value: true
- equal:
path: spec.template.spec.hostname
value: pg-exporter
- equal:
path: spec.template.spec.subdomain
value: exporters.internal
- it: Test imagePullSecrets
set:
deployment.imagePullSecrets:
- name: my-pull-secret
- name: my-special-secret
asserts:
- equal:
path: spec.template.spec.imagePullSecrets
value:
- name: my-pull-secret
- name: my-special-secret
- it: Test nodeSelector
set:
deployment.nodeSelector:
foo: bar
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
foo: bar
- it: Test priorityClassName
set:
deployment.priorityClassName: my-priority
asserts:
- equal:
path: spec.template.spec.priorityClassName
value: my-priority
- it: Test restartPolicy
set:
deployment.restartPolicy: Always
asserts:
- equal:
path: spec.template.spec.restartPolicy
value: Always
- it: Test terminationGracePeriodSeconds
set:
deployment.terminationGracePeriodSeconds: 120
asserts:
- equal:
path: spec.template.spec.terminationGracePeriodSeconds
value: 120
- it: Test tolerations
set:
deployment.tolerations:
- key: database/type
operator: Equal
value: postgres
effect: NoSchedule
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: database/type
operator: Equal
value: postgres
effect: NoSchedule
- it: Test topologySpreadConstraints
set:
deployment.topologySpreadConstraints:
- topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/instance: prometheus-postgres-exporter
asserts:
- equal:
path: spec.template.spec.topologySpreadConstraints
value:
- topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/instance: prometheus-postgres-exporter
- it: Test additional volumeMounts and volumes
set:
deployment.postgresExporter.volumeMounts:
- name: data
mountPath: /usr/lib/prometheus-postgres-exporter/data
deployment.volumes:
- name: data
hostPath:
path: /usr/lib/prometheus-postgres-exporter/data
asserts:
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: data
mountPath: /usr/lib/prometheus-postgres-exporter/data
- name: config-d
mountPath: /etc/prometheus-postgres-exporter/config.d
- equal:
path: spec.template.spec.volumes
value:
- name: data
hostPath:
path: /usr/lib/prometheus-postgres-exporter/data
- name: config-d
projected:
defaultMode: 444
sources:
- secret:
name: prometheus-postgres-exporter-unittest-exporter-config
- secret:
name: prometheus-postgres-exporter-unittest-web-config
+3 -6
View File
@@ -58,7 +58,7 @@ tests:
helm.sh/chart: prometheus-postgres-exporter-0.1.0 helm.sh/chart: prometheus-postgres-exporter-0.1.0
- equal: - equal:
path: spec.podMetricsEndpoints[0].enableHttp2 path: spec.podMetricsEndpoints[0].enableHttp2
value: false value: true
- equal: - equal:
path: spec.podMetricsEndpoints[0].followRedirects path: spec.podMetricsEndpoints[0].followRedirects
value: false value: false
@@ -90,10 +90,7 @@ tests:
path: spec.selector.matchLabels path: spec.selector.matchLabels
value: value:
app.kubernetes.io/instance: prometheus-postgres-exporter-unittest app.kubernetes.io/instance: prometheus-postgres-exporter-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: prometheus-postgres-exporter app.kubernetes.io/name: prometheus-postgres-exporter
app.kubernetes.io/version: 0.1.0
helm.sh/chart: prometheus-postgres-exporter-0.1.0
- it: Render podMonitor with custom annotations and labels. - it: Render podMonitor with custom annotations and labels.
set: set:
@@ -122,7 +119,7 @@ tests:
set: set:
prometheus.metrics.enabled: true prometheus.metrics.enabled: true
prometheus.metrics.podMonitor.enabled: true prometheus.metrics.podMonitor.enabled: true
prometheus.metrics.podMonitor.enableHttp2: true prometheus.metrics.podMonitor.enableHttp2: false
prometheus.metrics.podMonitor.followRedirects: true prometheus.metrics.podMonitor.followRedirects: true
prometheus.metrics.podMonitor.honorLabels: true prometheus.metrics.podMonitor.honorLabels: true
prometheus.metrics.podMonitor.interval: "180s" prometheus.metrics.podMonitor.interval: "180s"
@@ -140,7 +137,7 @@ tests:
count: 1 count: 1
- equal: - equal:
path: spec.podMetricsEndpoints[0].enableHttp2 path: spec.podMetricsEndpoints[0].enableHttp2
value: true value: false
- equal: - equal:
path: spec.podMetricsEndpoints[0].followRedirects path: spec.podMetricsEndpoints[0].followRedirects
value: true value: true
+15 -22
View File
@@ -8,34 +8,14 @@ release:
templates: templates:
- templates/prometheus-postgres-exporter/secretWebConfig.yaml - templates/prometheus-postgres-exporter/secretWebConfig.yaml
tests: tests:
- it: Skip rendering by using existing secret. - it: Rendering default secret.
set:
config.webConfig.existingSecret.enabled: true
asserts:
- hasDocuments:
count: 0
- it: Skip rendering when no webConfig.yaml is defined.
set:
config.webConfig.existingSecret.enabled: false
asserts:
- hasDocuments:
count: 0
- it: Rendering database secret.
set:
config.webConfig.secret.webConfig:
tls_server_config:
cert_file: /path/to/cert.pem
client_ca_file: /path/to/ca.pem
key_file: /path/to/key.pem
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
- containsDocument: - containsDocument:
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
name: prometheus-postgres-exporter-unittest-webconfig name: prometheus-postgres-exporter-unittest-web-config
namespace: testing namespace: testing
- notExists: - notExists:
path: metadata.annotations path: metadata.annotations
@@ -47,6 +27,19 @@ tests:
app.kubernetes.io/name: prometheus-postgres-exporter app.kubernetes.io/name: prometheus-postgres-exporter
app.kubernetes.io/version: 0.1.0 app.kubernetes.io/version: 0.1.0
helm.sh/chart: prometheus-postgres-exporter-0.1.0 helm.sh/chart: prometheus-postgres-exporter-0.1.0
- equal:
path: stringData["webConfig.yaml"]
value: |
{}
- it: Rendering custom webconfig.
set:
config.webConfig.secret.webConfig:
tls_server_config:
cert_file: /path/to/cert.pem
client_ca_file: /path/to/ca.pem
key_file: /path/to/key.pem
asserts:
- equal: - equal:
path: stringData["webConfig.yaml"] path: stringData["webConfig.yaml"]
value: | value: |
@@ -29,12 +29,12 @@ tests:
- notExists: - notExists:
path: metadata.labels path: metadata.labels
- equal: - equal:
path: spec.automountServiceAccountToken path: automountServiceAccountToken
value: true value: true
- notExists: - notExists:
path: spec.imagePullSecrets path: imagePullSecrets
- notExists: - notExists:
path: spec.secrets path: secrets
- it: Rendering serviceAccount with custom values. - it: Rendering serviceAccount with custom values.
@@ -65,14 +65,14 @@ tests:
path: metadata.name path: metadata.name
value: prometheus-postgres-exporter-unittest value: prometheus-postgres-exporter-unittest
- equal: - equal:
path: spec.automountServiceAccountToken path: automountServiceAccountToken
value: false value: false
- equal: - equal:
path: spec.imagePullSecrets path: imagePullSecrets
value: value:
- name: "my-pull-secret" - name: "my-pull-secret"
- equal: - equal:
path: spec.secrets path: secrets
value: value:
- name: "my-secret" - name: "my-secret"
namespace: "my-namespace" namespace: "my-namespace"
@@ -59,7 +59,7 @@ tests:
helm.sh/chart: prometheus-postgres-exporter-0.1.0 helm.sh/chart: prometheus-postgres-exporter-0.1.0
- equal: - equal:
path: spec.endpoints[0].enableHttp2 path: spec.endpoints[0].enableHttp2
value: false value: true
- equal: - equal:
path: spec.endpoints[0].followRedirects path: spec.endpoints[0].followRedirects
value: false value: false
@@ -121,7 +121,7 @@ tests:
set: set:
prometheus.metrics.enabled: true prometheus.metrics.enabled: true
prometheus.metrics.serviceMonitor.enabled: true prometheus.metrics.serviceMonitor.enabled: true
prometheus.metrics.serviceMonitor.enableHttp2: true prometheus.metrics.serviceMonitor.enableHttp2: false
prometheus.metrics.serviceMonitor.followRedirects: true prometheus.metrics.serviceMonitor.followRedirects: true
prometheus.metrics.serviceMonitor.honorLabels: true prometheus.metrics.serviceMonitor.honorLabels: true
prometheus.metrics.serviceMonitor.interval: "180s" prometheus.metrics.serviceMonitor.interval: "180s"
@@ -134,13 +134,12 @@ tests:
action: "drop" action: "drop"
prometheus.metrics.serviceMonitor.scrapeTimeout: "5s" prometheus.metrics.serviceMonitor.scrapeTimeout: "5s"
prometheus.metrics.serviceMonitor.scheme: "http" prometheus.metrics.serviceMonitor.scheme: "http"
prometheus.metrics.serviceMonitor.port: 10443
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
- equal: - equal:
path: spec.endpoints[0].enableHttp2 path: spec.endpoints[0].enableHttp2
value: true value: false
- equal: - equal:
path: spec.endpoints[0].followRedirects path: spec.endpoints[0].followRedirects
value: true value: true
@@ -166,7 +165,4 @@ tests:
value: 5s value: 5s
- equal: - equal:
path: spec.endpoints[0].scheme path: spec.endpoints[0].scheme
value: http value: http
- equal:
path: spec.endpoints[0].targetPort
value: 10443
-3
View File
@@ -63,10 +63,7 @@ tests:
path: spec.selector path: spec.selector
value: value:
app.kubernetes.io/instance: prometheus-postgres-exporter-unittest app.kubernetes.io/instance: prometheus-postgres-exporter-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: prometheus-postgres-exporter app.kubernetes.io/name: prometheus-postgres-exporter
app.kubernetes.io/version: 0.1.0
helm.sh/chart: prometheus-postgres-exporter-0.1.0
- equal: - equal:
path: spec.sessionAffinity path: spec.sessionAffinity
value: None value: None
+13 -8
View File
@@ -30,15 +30,15 @@ config:
databaseConnectionUrl: "" databaseConnectionUrl: ""
exporterConfig: exporterConfig:
## @param config.exporterConfig.existingSecret.enabled Mount an existing secret containing the key `exporter_config.yaml`. ## @param config.exporterConfig.existingSecret.enabled Mount an existing secret containing the key `exporterConfig.yaml`.
## @param config.exporterConfig.existingSecret.secretName Name of the existing secret containing the key `exporter_config.yaml`. ## @param config.exporterConfig.existingSecret.secretName Name of the existing secret containing the key `exporterConfig.yaml`.
existingSecret: existingSecret:
enabled: false enabled: false
secretName: "" secretName: ""
## @param config.exporterConfig.secret.annotations Additional annotations of the secret containing the `exporterConfig.yaml`. ## @param config.exporterConfig.secret.annotations Additional annotations of the secret containing the `exporterConfig.yaml`.
## @param config.exporterConfig.secret.labels Additional labels of the secret containing the `exporterConfig.yaml`. ## @param config.exporterConfig.secret.labels Additional labels of the secret containing the `exporterConfig.yaml`.
## @param config.exporterConfig.secret.exporterConfig Content of the `exporterConfig.yaml`. Further information can be found [here](https://prometheus.io/docs/prometheus/latest/configuration/https/). ## @param config.exporterConfig.secret.exporterConfig Content of the `exporterConfig.yaml`. Further information can be found [here](https://github.com/prometheus-community/postgres_exporter?tab=readme-ov-file#multi-target-support-beta).
## @skip config.exporterConfig.secret.exporterConfig Skip individual postgres exporter configuration. ## @skip config.exporterConfig.secret.exporterConfig Skip individual postgres exporter configuration.
secret: secret:
annotations: {} annotations: {}
@@ -190,7 +190,7 @@ deployment:
# runAsUser: 1000 # runAsUser: 1000
## @param deployment.postgresExporter.volumeMounts Additional volume mounts. ## @param deployment.postgresExporter.volumeMounts Additional volume mounts.
volumeMounts: {} volumeMounts: []
# - name: my-configmap-volume # - name: my-configmap-volume
# mountPath: /configmap # mountPath: /configmap
# readOnly: true # readOnly: true
@@ -204,6 +204,9 @@ deployment:
## @param deployment.replicaCount Number of replicas for the postgres-exporter deployment. ## @param deployment.replicaCount Number of replicas for the postgres-exporter deployment.
replicaCount: 1 replicaCount: 1
## @param deployment.restartPolicy Restart policy of the postgres-exporter deployment.
restartPolicy: ""
## @param deployment.securityContext Security context of the postgres-exporter deployment. ## @param deployment.securityContext Security context of the postgres-exporter deployment.
securityContext: {} securityContext: {}
# fsGroup: 2000 # fsGroup: 2000
@@ -222,6 +225,10 @@ deployment:
## @param deployment.tolerations Tolerations of the postgres-exporter deployment. ## @param deployment.tolerations Tolerations of the postgres-exporter deployment.
tolerations: [] tolerations: []
# - key: database/type
# operator: Equal
# value: postgres
# effect: NoSchedule
## @param deployment.topologySpreadConstraints TopologySpreadConstraints of the postgres-exporter deployment. ## @param deployment.topologySpreadConstraints TopologySpreadConstraints of the postgres-exporter deployment.
topologySpreadConstraints: [] topologySpreadConstraints: []
@@ -306,7 +313,7 @@ prometheus:
podMonitor: podMonitor:
enabled: false enabled: false
annotations: {} annotations: {}
enableHttp2: false enableHttp2: true
followRedirects: false followRedirects: false
honorLabels: false honorLabels: false
labels: {} labels: {}
@@ -325,7 +332,6 @@ prometheus:
## @param prometheus.metrics.serviceMonitor.honorLabels Honor labels. ## @param prometheus.metrics.serviceMonitor.honorLabels Honor labels.
## @param prometheus.metrics.serviceMonitor.interval Interval at which metrics should be scraped. If not specified Prometheus' global scrape interval is used. ## @param prometheus.metrics.serviceMonitor.interval Interval at which metrics should be scraped. If not specified Prometheus' global scrape interval is used.
## @param prometheus.metrics.serviceMonitor.path HTTP path for scraping prometheus metrics. ## @param prometheus.metrics.serviceMonitor.path HTTP path for scraping prometheus metrics.
## @param prometheus.metrics.serviceMonitor.port HTTP port for scraping prometheus metrics.
## @param prometheus.metrics.serviceMonitor.relabelings RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. ## @param prometheus.metrics.serviceMonitor.relabelings RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields.
## @param prometheus.metrics.serviceMonitor.scrapeTimeout Timeout after which the scrape is ended. If not specified, global Prometheus scrape timeout is used. ## @param prometheus.metrics.serviceMonitor.scrapeTimeout Timeout after which the scrape is ended. If not specified, global Prometheus scrape timeout is used.
## @param prometheus.metrics.serviceMonitor.scheme HTTP scheme to use for scraping. For example `http` or `https`. ## @param prometheus.metrics.serviceMonitor.scheme HTTP scheme to use for scraping. For example `http` or `https`.
@@ -335,12 +341,11 @@ prometheus:
enabled: false enabled: false
annotations: {} annotations: {}
labels: {} labels: {}
enableHttp2: false enableHttp2: true
followRedirects: false followRedirects: false
honorLabels: false honorLabels: false
interval: "60s" interval: "60s"
path: "/metrics" path: "/metrics"
port: 9187
relabelings: [] relabelings: []
scrapeTimeout: "30s" scrapeTimeout: "30s"
scheme: "http" scheme: "http"