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";
|
version = "57.0.3";
|
||||||
url = "https://github.com/prometheus-community/helm-charts/releases/download/${name}-${version}/${name}-${version}.tgz";
|
url = "https://github.com/prometheus-community/helm-charts/releases/download/${name}-${version}/${name}-${version}.tgz";
|
||||||
hash = "sha256-oZNaFSfFR2dtf5IMUQ0CnXQeVLvoW22JdRqMmgmdtTs=";
|
hash = "sha256-oZNaFSfFR2dtf5IMUQ0CnXQeVLvoW22JdRqMmgmdtTs=";
|
||||||
|
patches = [
|
||||||
|
./patches/kube-prometheus-stack.patch
|
||||||
|
];
|
||||||
}
|
}
|
||||||
rec {
|
rec {
|
||||||
name = "cert-manager";
|
name = "cert-manager";
|
||||||
|
@ -4,9 +4,16 @@
|
|||||||
, lib ? pkgs.lib
|
, lib ? pkgs.lib
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
mkHelm = { name, version, url, hash ? lib.fakeSha256 }:
|
mkHelm = {
|
||||||
|
name,
|
||||||
|
version,
|
||||||
|
url,
|
||||||
|
hash ? lib.fakeSha25,
|
||||||
|
namespace ? "",
|
||||||
|
patches ? []
|
||||||
|
}:
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
inherit name;
|
inherit name patches;
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
src = pkgs.fetchurl {
|
||||||
inherit url hash;
|
inherit url hash;
|
||||||
@ -14,13 +21,18 @@ let
|
|||||||
|
|
||||||
phases = [
|
phases = [
|
||||||
"unpackPhase"
|
"unpackPhase"
|
||||||
|
"patchPhase"
|
||||||
"build"
|
"build"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
namespace = if namespace != "" then "--namespace ${namespace}" else "";
|
||||||
|
|
||||||
build = ''
|
build = ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
${helm} template ${name} ./ > $out/${name}-${version}.yaml
|
${helm} template \
|
||||||
#${helm} version > $out/README
|
--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