Skip to content

Commit

Permalink
Prometheus: add overlays to replace self-signed CA
Browse files Browse the repository at this point in the history
  • Loading branch information
giovannibaratta committed Jan 22, 2024
1 parent 7f9d7ad commit bbd112f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#@ load("@ytt:overlay", "overlay")

# Remove the self-signed issuer
#@overlay/match by=overlay.subset({"kind": "Issuer"}), expects="1+"
#@overlay/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#@ load("@ytt:overlay", "overlay")

# Remove self-signed CA certificate request
#@overlay/match by=lambda indexOrKey, left, right: left["metadata"]["name"].startswith("prometheus-ca"), expects=1
#@overlay/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#@ load("@ytt:overlay", "overlay")

# Override issuer of Prometheus certificate
#@overlay/match by=lambda indexOrKey, left, right: left["metadata"]["name"].startswith("prometheus-tls-cert"), expects=1
---
spec:
issuerRef:
group: cert-manager.io
kind: ClusterIssuer
# Replace with the name of a pre-existing Cluster Issuer
name: tmc-issuer
11 changes: 11 additions & 0 deletions manifests/prometheus-replace-self-signed-ca-overlays/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Replace self-signed CA

The folder contains a set of overlays to be applied during the installation of Prometheus package. The overlays remove the self-signed issuer and inject the provided issuer reference in the certificate request.

## Usage

Use the `ytt-overlay-file` flag and specify this directory as the value to apply the overlays contained in this folder.

```sh
tanzu package install prometheus -n tkg-packages -p prometheus.tanzu.vmware.com -v 2.37.0+vmware.3-tkg.1 --values-file prometheus-values.yaml --ytt-overlay-file prometheus-replace-self-signed-ca-overlays
```

0 comments on commit bbd112f

Please sign in to comment.