This commit is contained in:
2025-06-09 09:46:19 -04:00
parent 99f6236262
commit 249096bc1c
9 changed files with 145 additions and 0 deletions

47
apps/ntfy/deployment.yaml Normal file
View File

@@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ntfy
namespace: ntfy
labels:
app: ntfy
spec:
revisionHistoryLimit: 1
replicas: 1
selector:
matchLabels:
app: ntfy
template:
metadata:
labels:
app: ntfy
spec:
containers:
- name: ntfy
image: binwiederhier/ntfy:v1.28.0
args: ["serve"]
env:
- name: TZ
value: America/Toronto
- name: NTFY_DEBUG
value: "false"
- name: NTFY_LOG_LEVEL
value: INFO
- name: NTFY_BASE_URL
value: https://ntfy.michaelthomson.dev
ports:
- containerPort: 80
name: http
volumeMounts:
- mountPath: /etc/ntfy
subPath: server.yml
name: config-volume
- mountPath: /var/cache/ntfy
name: cache-volume
volumes:
- name: config-volume
configMap:
name: server-config
- name: cache-volume
persistentVolumeClaim:
claimName: pvc

View File

@@ -0,0 +1,15 @@
apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
name: ntfy.michaelthomson.dev
namespace: ntfy
spec:
endpoints:
- dnsName: ntfy.michaelthomson.dev
recordTTL: 180
recordType: CNAME
targets:
- michaelthomson.ddns.net
providerSpecific:
- name: external-dns.alpha.kubernetes.io/cloudflare-proxied
value: "true"

24
apps/ntfy/ingress.yaml Normal file
View File

@@ -0,0 +1,24 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ntfy
namespace: ntfy
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true"
spec:
rules:
- host: ntfy.michaelthomson.dev
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: service
port:
name: http
tls:
- hosts:
- ntfy.michaelthomson.dev
secretName: letsencrypt-wildcard-cert-michaelthomson.dev

View File

@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- pvc.yaml
- ingress.yaml
- dns-endpoint.yaml
configMapGenerator:
- name: server-config
files:
- server-config.yaml

4
apps/ntfy/namespace.yaml Normal file
View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: ntfy

12
apps/ntfy/pvc.yaml Normal file
View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc
namespace: ntfy
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 1Gi

View File

@@ -0,0 +1,2 @@
cache-file: "/var/cache/ntfy/cache.db"
attachment-cache-dir: "/var/cache/ntfy/attachments"

14
apps/ntfy/service.yaml Normal file
View File

@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: service
namespace: ntfy
spec:
type: ClusterIP
selector:
app: ntfy
ports:
- name: http
protocol: TCP
port: 80
targetPort: http

View File

@@ -0,0 +1,15 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: ntfy
namespace: flux-system
spec:
interval: 15m
path: ./apps/ntfy
prune: false # remove any elements later removed from the above path
wait: true
sourceRef:
kind: GitRepository
name: flux-system
dependsOn:
- name: infra-configs