apiVersion: apps/v1
kind: Deployment
metadata:
  name: ntfy
  labels:
    app.kubernetes.io/controller: main
    app.kubernetes.io/instance: ntfy
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: ntfy
    helm.sh/chart: ntfy-5.0.1
  namespace: ntfy
spec:
  revisionHistoryLimit: 3
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/controller: main
      app.kubernetes.io/name: ntfy
      app.kubernetes.io/instance: ntfy
  template:
    metadata:
      labels:
        app.kubernetes.io/controller: main
        app.kubernetes.io/instance: ntfy
        app.kubernetes.io/name: ntfy
    spec:
      enableServiceLinks: false
      serviceAccountName: ntfy
      automountServiceAccountToken: false
      hostIPC: false
      hostNetwork: false
      hostPID: false
      dnsPolicy: ClusterFirst
      containers:
        - args:
            - serve
          env:
            - name: TZ
              value: America/Chicago
            - name: NTFY_BASE_URL
              value: https://ntfy.alexlebens.net
            - name: NTFY_LISTEN_HTTP
              value: :80
            - name: NTFY_CACHE_DURATION
              value: 36h
            - name: NTFY_BEHIND_PROXY
              value: "true"
            - name: NTFY_DATABASE_URL
              valueFrom:
                secretKeyRef:
                  key: uri
                  name: ntfy-postgresql-18-cluster-app
            - name: NTFY_ATTACHMENT_CACHE_DIR
              valueFrom:
                secretKeyRef:
                  key: attachment-cache-dir
                  name: ntfy-config
            - name: NTFY_ATTACHMENT_TOTAL_SIZE_LIMIT
              value: 10G
            - name: NTFY_ATTACHMENT_FILE_SIZE_LIMIT
              value: 150M
            - name: NTFY_ATTACHMENT_EXPIRY_DURATION
              value: 72h
            - name: NTFY_ENABLE_SIGNUP
              value: "false"
            - name: NTFY_ENABLE_LOGIN
              value: "true"
            - name: NTFY_ENABLE_RESERVATIONS
              value: "false"
            - name: NTFY_AUTH_DEFAULT_ACCESS
              value: deny-all
            - name: NTFY_METRICS_LISTEN_HTTP
              value: :9090
            - name: NTFY_LOG_LEVEL
              value: info
          image: binwiederhier/ntfy:v2.23.0@sha256:b32b4221a64ec2e7c000f0782b2feef24022e1a09a24e531640f4cbba6cfa1e6
          livenessProbe:
            httpGet:
              path: /v1/health
              port: 80
            initialDelaySeconds: 60
            periodSeconds: 60
            successThreshold: 1
            timeoutSeconds: 30
          name: main
          resources:
            requests:
              cpu: 10m
              memory: 40Mi
