diff --git a/ntfy/README.md b/ntfy/README.md new file mode 100644 index 0000000..4e5216b --- /dev/null +++ b/ntfy/README.md @@ -0,0 +1,3 @@ +### ntfy + +![ntfy](ntfy-k8s.png) diff --git a/ntfy/deployment.yaml b/ntfy/deployment.yaml new file mode 100644 index 0000000..4a146c9 --- /dev/null +++ b/ntfy/deployment.yaml @@ -0,0 +1,164 @@ +--- +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert -o deployment.yaml -n ntfy + kompose.service.expose: ntfy.wayl.one + kompose.version: 1.31.2 (a92241f79) + creationTimestamp: null + labels: + io.kompose.service: ntfy + name: ntfy + namespace: ntfy +spec: + ports: + - name: "3008" + port: 3008 + targetPort: 80 + selector: + io.kompose.service: ntfy +status: + loadBalancer: {} + +--- +apiVersion: v1 +kind: Namespace +metadata: + creationTimestamp: null + name: ntfy + namespace: ntfy +spec: {} +status: {} + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -o deployment.yaml -n ntfy + kompose.service.expose: ntfy.wayl.one + kompose.version: 1.31.2 (a92241f79) + creationTimestamp: null + labels: + io.kompose.service: ntfy + name: ntfy + namespace: ntfy +spec: + replicas: 1 + selector: + matchLabels: + io.kompose.service: ntfy + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -o deployment.yaml -n ntfy + kompose.service.expose: ntfy.wayl.one + kompose.version: 1.31.2 (a92241f79) + creationTimestamp: null + labels: + io.kompose.network/ntfy-default: "true" + io.kompose.service: ntfy + spec: + containers: + - args: + - serve + env: + - name: TZ + value: UTC + image: binwiederhier/ntfy + livenessProbe: + exec: + command: + - wget -q --tries=1 http://localhost:80/v1/health -O - | grep -Eo '"healthy"\s*:\s*true' || exit 1 + failureThreshold: 3 + initialDelaySeconds: 40 + periodSeconds: 60 + timeoutSeconds: 10 + name: ntfy + ports: + - containerPort: 80 + hostPort: 3008 + protocol: TCP + resources: {} + securityContext: + runAsUser: 1000 + volumeMounts: + - mountPath: /var/cache/ntfy + name: ntfy-cache + - mountPath: /etc/ntfy + name: ntfy + restartPolicy: Always + volumes: + - name: ntfy-cache + persistentVolumeClaim: + claimName: ntfy-cache + - name: ntfy + persistentVolumeClaim: + claimName: ntfy +status: {} + +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kompose.cmd: kompose convert -o deployment.yaml -n ntfy + kompose.service.expose: ntfy.wayl.one + kompose.version: 1.31.2 (a92241f79) + creationTimestamp: null + labels: + io.kompose.service: ntfy + name: ntfy + namespace: ntfy +spec: + rules: + - host: ntfy.wayl.one + http: + paths: + - backend: + service: + name: ntfy + port: + number: 3008 + path: / + pathType: Prefix +status: + loadBalancer: {} + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: ntfy-cache + name: ntfy-cache + namespace: ntfy +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + creationTimestamp: null + labels: + io.kompose.service: ntfy + name: ntfy + namespace: ntfy +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} + diff --git a/ntfy/docker-compose.yml b/ntfy/docker-compose.yml new file mode 100644 index 0000000..0107e53 --- /dev/null +++ b/ntfy/docker-compose.yml @@ -0,0 +1,28 @@ +version: "2.3" + +services: + ntfy: + image: binwiederhier/ntfy + container_name: ntfy + command: + - serve + environment: + - TZ=UTC # optional: set desired timezone + user: "1000" # optional: replace with your own user/group or uid/gid + volumes: + - ntfy-cache:/var/cache/ntfy + - ntfy:/etc/ntfy + ports: + - 3008:80 + healthcheck: # optional: remember to adapt the host:port to your environment + test: ["CMD-SHELL", "wget -q --tries=1 http://localhost:80/v1/health -O - | grep -Eo '\"healthy\"\\s*:\\s*true' || exit 1"] + interval: 60s + timeout: 10s + retries: 3 + start_period: 40s + restart: always + labels: + kompose.service.expose: ntfy.wayl.one +volumes: + ntfy: + ntfy-cache: diff --git a/ntfy/justfile b/ntfy/justfile new file mode 100644 index 0000000..172d55d --- /dev/null +++ b/ntfy/justfile @@ -0,0 +1,9 @@ +default: convert deploy viz +convert: + kompose convert -o deployment.yaml -n ntfy +deploy: + kubectl apply -f deployment.yaml +viz: + k8sviz -n ntfy --kubeconfig ~/.config/kube/falcon-k3s.yaml -t png -o ntfy-k8s.png +restart: + kubectl rollout restart -n ntfy deployment/ntfy diff --git a/ntfy/ntfy-k8s.png b/ntfy/ntfy-k8s.png new file mode 100644 index 0000000..5f0b40b Binary files /dev/null and b/ntfy/ntfy-k8s.png differ