k8s/ntfy.yaml
2025-05-19 22:41:11 -04:00

175 lines
3.8 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ntfy
name: ntfy
spec:
replicas: 1
selector:
matchLabels:
app: ntfy
template:
metadata:
labels:
app: ntfy
spec:
containers:
- args:
- serve
env:
- name: TZ
value: America/New_York
image: binwiederhier/ntfy
volumeMounts:
- name: ntfy-cache-volume
mountPath: /var/cache/ntfy
- name: ntfy-config-volume
mountPath: /etc/ntfy
name: ntfy
ports:
- containerPort: 80
protocol: TCP
volumes:
- name: ntfy-cache-volume
persistentVolumeClaim:
claimName: ntfy-cache-pvc
- name: ntfy-config-volume
persistentVolumeClaim:
claimName: ntfy-config-pvc
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: ntfy-svc
spec:
ports:
- port: 80
targetPort: 80
selector:
app: ntfy
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ntfy-http
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web
spec:
rules:
- host: ntfy.reticulum.lan
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: ntfy-svc
port:
number: 80
- host: ntfy.argentumcation.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: ntfy-svc
port:
number: 80
- host: ntfy.xn--2dkua.xn--tckwe
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: ntfy-svc
port:
number: 80
---
apiVersion: v1
kind: PersistentVolume
metadata:
annotations:
pv.kubernetes.io/provisioned-by: smb.csi.k8s.io
name: ntfy-cache-pv
spec:
capacity:
storage: 100Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: smb
mountOptions:
- dir_mode=0777
- file_mode=0777
# - vers=3.0
csi:
driver: smb.csi.k8s.io
# volumeHandle format: {smb-server-address}#{sub-dir-name}#{share-name}
# make sure this value is unique for every share in the cluster
volumeHandle: lipotropin.lan#meta/services/ntfy#raid#
volumeAttributes:
source: //192.168.1.146/raid
subDir: 00_meta/02_services/ntfy
nodeStageSecretRef:
name: smbcreds
namespace: default
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ntfy-cache-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
volumeName: ntfy-cache-pv
storageClassName: smb
---
apiVersion: v1
kind: PersistentVolume
metadata:
annotations:
pv.kubernetes.io/provisioned-by: smb.csi.k8s.io
name: ntfy-config-pv
spec:
capacity:
storage: 100Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: smb
mountOptions:
- dir_mode=0777
- file_mode=0777
# - vers=3.0
csi:
driver: smb.csi.k8s.io
# volumeHandle format: {smb-server-address}#{sub-dir-name}#{share-name}
# make sure this value is unique for every share in the cluster
volumeHandle: lipotropin.lan#meta/services_config/ntfy#raid#
volumeAttributes:
source: //192.168.1.146/raid
subDir: 00_meta/05_service_config/ntfy
nodeStageSecretRef:
name: smbcreds
namespace: default
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ntfy-config-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
volumeName: ntfy-config-pv
storageClassName: smb