mirror of
https://github.com/shadoll/helm-charts.git
synced 2026-08-28 11:33:17 +00:00
feat: Add ntfy Helm chart with deployment, service, ingress, configmap, and values configuration
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: ntfy
|
||||||
|
description: ntfy push notification server Helm chart
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
|
appVersion: "2.18.0"
|
||||||
|
annotations:
|
||||||
|
version-source: github-release:binwiederhier/ntfy
|
||||||
|
version-pattern: "s|^v||"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{{- define "ntfy.configMapName" -}}
|
||||||
|
{{- if .Values.existingConfigMap -}}
|
||||||
|
{{ .Values.existingConfigMap }}
|
||||||
|
{{- else -}}
|
||||||
|
{{ .Release.Name }}-config
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{{- if and .Values.config (not .Values.existingConfigMap) }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-config
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: {{ .Chart.Name }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
data:
|
||||||
|
server.yml: |
|
||||||
|
{{- .Values.config | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: {{ .Chart.Name }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
annotations:
|
||||||
|
version-source: {{ index .Chart.Annotations "version-source" }}
|
||||||
|
version-pattern: {{ index .Chart.Annotations "version-pattern" | quote }}
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Release.Name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}
|
||||||
|
spec:
|
||||||
|
{{- with .Values.nodeSelector }}
|
||||||
|
nodeSelector:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: {{ .Chart.Name }}
|
||||||
|
image: "{{ .Values.image.repository }}:v{{ .Chart.AppVersion }}"
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
{{- with .Values.args }}
|
||||||
|
args:
|
||||||
|
{{- toYaml . | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.port }}
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
{{- if or .Values.env .Values.secretEnvKeys }}
|
||||||
|
env:
|
||||||
|
{{- range $key, $value := .Values.env }}
|
||||||
|
- name: {{ $key }}
|
||||||
|
value: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range .Values.secretEnvKeys }}
|
||||||
|
- name: {{ .envName }}
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ $.Values.existingSecret }}
|
||||||
|
key: {{ .secretKey }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.existingSecret }}
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: {{ .Values.existingSecret }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
volumeMounts:
|
||||||
|
{{- if or .Values.config .Values.existingConfigMap }}
|
||||||
|
- name: config
|
||||||
|
mountPath: /etc/ntfy
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
|
- name: cache
|
||||||
|
mountPath: /var/cache/ntfy
|
||||||
|
volumes:
|
||||||
|
{{- if or .Values.config .Values.existingConfigMap }}
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: {{ include "ntfy.configMapName" . }}
|
||||||
|
{{- end }}
|
||||||
|
- name: cache
|
||||||
|
emptyDir: {}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{{- range $name, $config := .Values.ingresses }}
|
||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: {{ $.Release.Name }}-{{ $name }}
|
||||||
|
{{- with $config.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: {{ $config.host }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: {{ $.Release.Name }}
|
||||||
|
port:
|
||||||
|
number: {{ $.Values.servicePort }}
|
||||||
|
{{- with $config.tls }}
|
||||||
|
tls:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: {{ .Chart.Name }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: {{ .Release.Name }}
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: {{ .Values.servicePort }}
|
||||||
|
targetPort: http
|
||||||
|
protocol: TCP
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
image:
|
||||||
|
repository: binwiederhier/ntfy
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
args: ["serve"]
|
||||||
|
|
||||||
|
port: 80
|
||||||
|
servicePort: 80
|
||||||
|
|
||||||
|
env: {}
|
||||||
|
# TZ: "Europe/Kyiv"
|
||||||
|
# NTFY_BASE_URL: "https://ntfy.example.com"
|
||||||
|
# NTFY_UPSTREAM_BASE_URL: "https://ntfy.sh"
|
||||||
|
|
||||||
|
existingSecret: ""
|
||||||
|
secretEnvKeys: []
|
||||||
|
|
||||||
|
# Inline ntfy server config rendered into a ConfigMap at /etc/ntfy/server.yml.
|
||||||
|
# Leave empty and set `existingConfigMap` to supply config via an external (e.g. sealed) ConfigMap.
|
||||||
|
config: ""
|
||||||
|
# |
|
||||||
|
# base-url: "https://ntfy.example.com"
|
||||||
|
# upstream-base-url: "https://ntfy.sh"
|
||||||
|
# behind-proxy: true
|
||||||
|
# cache-file: "/var/cache/ntfy/cache.db"
|
||||||
|
# attachment-cache-dir: "/var/cache/ntfy/attachments"
|
||||||
|
# web-push-public-key: ...
|
||||||
|
# web-push-private-key: ...
|
||||||
|
# web-push-file: "/var/cache/ntfy/webpush.db"
|
||||||
|
# web-push-email-address: admin@example.com
|
||||||
|
# enable-metrics: true
|
||||||
|
|
||||||
|
existingConfigMap: ""
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "150m"
|
||||||
|
memory: "150Mi"
|
||||||
|
limits:
|
||||||
|
cpu: "200m"
|
||||||
|
memory: "300Mi"
|
||||||
|
|
||||||
|
nodeSelector: {}
|
||||||
|
tolerations: []
|
||||||
|
affinity: {}
|
||||||
|
|
||||||
|
ingresses: {}
|
||||||
|
# https:
|
||||||
|
# host: ntfy.example.com
|
||||||
|
# annotations:
|
||||||
|
# traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
|
||||||
|
# traefik.ingress.kubernetes.io/router.tls: "true"
|
||||||
|
# traefik.ingress.kubernetes.io/router.tls.certresolver: letsencrypt
|
||||||
|
# tls:
|
||||||
|
# - hosts:
|
||||||
|
# - ntfy.example.com
|
||||||
|
# secretName: ntfy-tls
|
||||||
|
# lan:
|
||||||
|
# host: ntfy.lan
|
||||||
|
# annotations:
|
||||||
|
# traefik.ingress.kubernetes.io/router.entrypoints: web
|
||||||
Reference in New Issue
Block a user