Use patches in the Helm POC
This commit is contained in:
parent
29f9361073
commit
37c49982f5
7
helm-poc/README.md
Normal file
7
helm-poc/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Notes
|
||||
|
||||
Patch was generated with:
|
||||
|
||||
```sh
|
||||
diff -ruN kube-prometheus-stack.orig kube-prometheus-stack.new > ../patches/kube-prometheus-stack.patch
|
||||
```
|
@ -10,6 +10,9 @@ let
|
||||
version = "57.0.3";
|
||||
url = "https://github.com/prometheus-community/helm-charts/releases/download/${name}-${version}/${name}-${version}.tgz";
|
||||
hash = "sha256-oZNaFSfFR2dtf5IMUQ0CnXQeVLvoW22JdRqMmgmdtTs=";
|
||||
patches = [
|
||||
./patches/kube-prometheus-stack.patch
|
||||
];
|
||||
}
|
||||
rec {
|
||||
name = "cert-manager";
|
||||
|
@ -4,9 +4,16 @@
|
||||
, lib ? pkgs.lib
|
||||
}:
|
||||
let
|
||||
mkHelm = { name, version, url, hash ? lib.fakeSha256 }:
|
||||
mkHelm = {
|
||||
name,
|
||||
version,
|
||||
url,
|
||||
hash ? lib.fakeSha25,
|
||||
namespace ? "",
|
||||
patches ? []
|
||||
}:
|
||||
pkgs.stdenv.mkDerivation {
|
||||
inherit name;
|
||||
inherit name patches;
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
inherit url hash;
|
||||
@ -14,13 +21,18 @@ let
|
||||
|
||||
phases = [
|
||||
"unpackPhase"
|
||||
"patchPhase"
|
||||
"build"
|
||||
];
|
||||
|
||||
namespace = if namespace != "" then "--namespace ${namespace}" else "";
|
||||
|
||||
build = ''
|
||||
mkdir -p $out
|
||||
${helm} template ${name} ./ > $out/${name}-${version}.yaml
|
||||
#${helm} version > $out/README
|
||||
${helm} template \
|
||||
--namespace ${namespace} \
|
||||
${name} ./ > $out/${name}-${version}.yaml
|
||||
${helm} version > $out/VERSION
|
||||
'';
|
||||
};
|
||||
|
||||
|
11
helm-poc/patches/kube-prometheus-stack.patch
Normal file
11
helm-poc/patches/kube-prometheus-stack.patch
Normal file
@ -0,0 +1,11 @@
|
||||
diff '--color=auto' -ruN kube-prometheus-stack.orig/templates/alertmanager/alertmanager.yaml kube-prometheus-stack.new/templates/alertmanager/alertmanager.yaml
|
||||
--- kube-prometheus-stack.orig/templates/alertmanager/alertmanager.yaml 2024-03-14 23:04:27.000000000 +0100
|
||||
+++ kube-prometheus-stack.new/templates/alertmanager/alertmanager.yaml 2024-03-21 21:35:56.775410551 +0100
|
||||
@@ -1,6 +1,6 @@
|
||||
{{- if .Values.alertmanager.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
-kind: Alertmanager
|
||||
+kind: Alertmanager # Patch Testaroo
|
||||
metadata:
|
||||
name: {{ template "kube-prometheus-stack.alertmanager.crname" . }}
|
||||
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
Loading…
Reference in New Issue
Block a user