feat: add Helm Chart for nfty.sh

This commit is contained in:
Tommy Skaug 2024-04-06 11:28:44 +00:00
parent f6411a52cd
commit aab7dda59c
6 changed files with 126 additions and 0 deletions

View file

@ -50,6 +50,8 @@ Below you'll find an overview of the charts and an intro to get you started.
🚧 [[charts/attic][Attic]]: Nix Binary Cache server that reduces the time to compile and distribute builds ([[https://discourse.nixos.org/t/introducing-attic-a-self-hostable-nix-binary-cache-server/24343][intro post]])
🚧 [[charts/nfty-sh][nfty.sh]]: A push notification server for clients and phones.
🚧 [[charts/ollama-web][OLLAMA Web]]: User-friendly WebUI for LLMs (Formerly Ollama WebUI). A simplified chart of the original and wip, but it works.
🚧 [[charts/element-call][Element Call]]: WebRTC server for calls and video using Matrix for signalling. Not functional atm.

20
charts/nfty-sh/Chart.yaml Normal file
View file

@ -0,0 +1,20 @@
apiVersion: v2
name: ntfy-sh
description: |
ntfy lets you send push notifications to your phone or desktop via scripts from any computer
appVersion: v2.10.0
type: application
version: 0.1.0
maintainers:
- name: Tommy Skaug
email: tommy@skaug.me
icon: https://avatars.githubusercontent.com/u/664597?s=48&v=4
keywords:
- kubernetes
- ntfy
- push
- notifications
- server
sources:
- https://docs.ntfy.sh/
- https://github.com/binwiederhier/ntfy/

View file

@ -0,0 +1,30 @@
# Define a template for the chart's full name.
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "nfty-sh.fullname" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end }}
# Define a template for standard labels.
{{/*
Common labels
*/}}
{{- define "nfty-sh.labels" -}}
helm.sh/chart: {{ include "nfty-sh.chart" . }}
app.kubernetes.io/name: {{ include "nfty-sh.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.Version | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
# Define a template for the chart name and version.
{{/*
Generate basic labels
*/}}
{{- define "nfty-sh.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" -}}
{{- end }}
# Optionally, add more helper templates as needed.

View file

@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "nfty-sh.fullname" . }}
labels:
{{- include "ntfy-sh.labels" . | nindent 4 }}
app.kubernetes.io/component: {{ include "nfty-sh.fullname" . }}-server
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: {{ include "nfty-sh.fullname" . }}-server
template:
metadata:
labels:
app.kubernetes.io/component: {{ include "nfty-sh.fullname" . }}-server
spec:
serviceAccountName: {{ include "nfty-sh.fullname" . }}
containers:
- name: {{ include "nfty-sh.fullname" . }}-server
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
args: ["serve"]
env: &dispatchEnv
- name: NTFY_BASE_URL
value: {{ .Values.config.baseUrl }}
- name: NTFY_CACHE_FILE
value: /var/lib/ntfy/cache.db
- name: NTFY_AUTH_FILE
value: /var/lib/ntfy/auth.db
- name: NTFY_AUTH_DEFAULT_ACCESS
value: deny-all
- name: NTFY_BEHIND_PROXY
value: true
- name: NTFY_ATTACHMENT_CACHE_DIR
value: /var/lib/ntfy/attachments
- name: NTFY_ENABLE_LOGIN
value: true
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 80
name: http
volumeMounts:
- name: {{ include "nfty-sh.fullname" . }}-server
mountPath: "/var/lib/nfty"
readOnly: false
volumes:
- name: {{ include "nfty-sh.fullname" . }}-server
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim }}

View file

@ -0,0 +1,14 @@
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "nfty-sh.fullname" . }}-server
labels:
{{- include "ntfy-sh.labels" . | nindent 4 }}
app.kubernetes.io/component: {{ include "nfty-sh.fullname" . }}-server
spec:
selector:
app: {{ include "nfty-sh.fullname" . }}-server
ports:
- port: 80
targetPort: 80

View file

@ -0,0 +1,9 @@
config:
baseUrl: https://ntfy.sh
persistence:
existingClaim: nfty-sh-server
image:
repository: binwiederhier/ntfy
tag: v2.10.0