release.yaml (3101B)
1 apiVersion: apps/v1 2 kind: Deployment 3 metadata: 4 name: ntfy 5 spec: 6 selector: 7 matchLabels: 8 app: ntfy 9 template: 10 metadata: 11 labels: 12 app: ntfy 13 spec: 14 automountServiceAccountToken: false 15 securityContext: 16 runAsUser: 1000 17 runAsGroup: 1000 18 fsGroup: 1000 19 initContainers: 20 - name: fix-permissions 21 image: busybox 22 securityContext: 23 runAsUser: 0 24 runAsGroup: 0 25 allowPrivilegeEscalation: false 26 capabilities: 27 drop: 28 - ALL 29 add: 30 - CHOWN 31 - FOWNER 32 - DAC_OVERRIDE 33 command: ["sh", "-c", "chown -R 1000:1000 /opt/docker/ntfy/cache /etc/ntfy"] 34 volumeMounts: 35 - name: ntfy-cache 36 mountPath: /opt/docker/ntfy/cache 37 - name: ntfy-data 38 mountPath: /etc/ntfy 39 - name: ntfy-cache-2 40 mountPath: /var/cache/ntfy 41 containers: 42 - name: ntfy 43 securityContext: 44 allowPrivilegeEscalation: false 45 runAsNonRoot: true 46 runAsUser: 1000 47 runAsGroup: 1000 48 readOnlyRootFilesystem: true 49 capabilities: 50 drop: 51 - ALL 52 seccompProfile: 53 type: RuntimeDefault 54 image: binwiederhier/ntfy:v2.17.0 55 args: ["serve", "--config", "/opt/docker/ntfy/config/ntfy.yml"] 56 env: 57 - name: TZ 58 value: "Europe/Berlin" 59 resources: 60 limits: 61 memory: "256Mi" 62 cpu: "700m" 63 requests: 64 memory: "128Mi" 65 cpu: "500m" 66 ports: 67 - containerPort: 8080 68 name: http 69 livenessProbe: 70 httpGet: 71 path: /v1/health 72 port: 8080 73 readinessProbe: 74 httpGet: 75 path: /v1/health 76 port: 8080 77 volumeMounts: 78 - name: ntfy-config 79 mountPath: /opt/docker/ntfy/config 80 - name: ntfy-cache 81 mountPath: /opt/docker/ntfy/cache 82 - name: ntfy-data 83 mountPath: /etc/ntfy 84 - name: ntfy-cache-2 85 mountPath: /var/cache/ntfy 86 volumes: 87 - name: ntfy-config 88 configMap: 89 name: ntfy-config 90 - name: ntfy-cache 91 emptyDir: {} 92 - name: ntfy-cache-2 93 emptyDir: {} 94 - name: ntfy-data 95 persistentVolumeClaim: 96 claimName: ntfy-data 97 --- 98 apiVersion: v1 99 kind: Service 100 metadata: 101 name: ntfy-service 102 namespace: ntfy 103 spec: 104 selector: 105 app: ntfy 106 ports: 107 - port: 8080 108 targetPort: 8080 109 --- 110 apiVersion: gateway.networking.k8s.io/v1 111 kind: HTTPRoute 112 metadata: 113 name: ntfy 114 namespace: ntfy 115 spec: 116 parentRefs: 117 - name: envoy-gateway 118 namespace: envoy-gateway 119 hostnames: 120 - notify.mtrnord.blog 121 rules: 122 - backendRefs: 123 - name: ntfy-service 124 port: 8080