From 1c6286a9778ce3e884cf47dd1dc299f80e6d2d27 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 22 Sep 2024 11:59:33 -0500 Subject: [PATCH] ntfy: Migrate to Kustomize Using Kustomize, we can define the configuration file separately from the Kubernetes resources, and use `configMapGenerators` to generate the ConfigMap for it. Additionally, this will make it possible to update _ntfy_ using `updatebot`. --- ntfy/kustomization.yaml | 23 +++++++++++++++++++++++ ntfy/ntfy.yaml | 19 ------------------- ntfy/server.yml | 6 ++++++ 3 files changed, 29 insertions(+), 19 deletions(-) create mode 100644 ntfy/kustomization.yaml create mode 100644 ntfy/server.yml diff --git a/ntfy/kustomization.yaml b/ntfy/kustomization.yaml new file mode 100644 index 0000000..91522c2 --- /dev/null +++ b/ntfy/kustomization.yaml @@ -0,0 +1,23 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: ntfy + +resources: +- ntfy.yaml + +configMapGenerator: +- name: ntfy + namespace: ntfy + files: + - server.yml + options: + labels: + app.kubernetes.io/name: ntfy + app.kubernetes.io/component: ntfy + app.kubernetes.io/instance: ntfy + app.kubernetes.io/part-of: ntfy + +images: +- name: docker.io/binwiederhier/ntfy + newTag: v2.11.0 diff --git a/ntfy/ntfy.yaml b/ntfy/ntfy.yaml index aabeb9f..669d20c 100644 --- a/ntfy/ntfy.yaml +++ b/ntfy/ntfy.yaml @@ -5,25 +5,6 @@ metadata: labels: app.kubernetes.io/instance: ntfy ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: ntfy - namespace: ntfy - labels: - app.kubernetes.io/name: ntfy - app.kubernetes.io/component: ntfy - app.kubernetes.io/instance: ntfy - app.kubernetes.io/part-of: ntfy -data: - server.yml: |+ - base-url: https://ntfy.pyrocufflink.net - behind-proxy: true - listen-http: '[::]:2586' - attachment-cache-dir: /var/cache/ntfy/attachments - attachment-file-size-limit: 100M - --- apiVersion: v1 kind: Service diff --git a/ntfy/server.yml b/ntfy/server.yml new file mode 100644 index 0000000..1e9ae67 --- /dev/null +++ b/ntfy/server.yml @@ -0,0 +1,6 @@ +base-url: https://ntfy.pyrocufflink.net +behind-proxy: true +listen-http: '[::]:2586' +attachment-cache-dir: /var/cache/ntfy/attachments +attachment-file-size-limit: 100M +enable-metrics: true