feat(ntfy): init
This commit is contained in:
commit
5fa7578238
17 changed files with 2688 additions and 0 deletions
23
ntfy/.helmignore
Normal file
23
ntfy/.helmignore
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
7
ntfy/Chart.yaml
Normal file
7
ntfy/Chart.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
apiVersion: v2
|
||||
name: ntfy
|
||||
description: A Helm chart for Kubernetes
|
||||
type: application
|
||||
|
||||
version: 0.1.0
|
||||
appVersion: "2.5.0"
|
1895
ntfy/grafana_dashboards/ntfy-1679170350783.json
Normal file
1895
ntfy/grafana_dashboards/ntfy-1679170350783.json
Normal file
File diff suppressed because it is too large
Load diff
22
ntfy/templates/NOTES.txt
Normal file
22
ntfy/templates/NOTES.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
1. Get the application URL by running these commands:
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
{{- range .paths }}
|
||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "ntfy.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "ntfy.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "ntfy.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "ntfy.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
|
||||
{{- end }}
|
62
ntfy/templates/_helpers.tpl
Normal file
62
ntfy/templates/_helpers.tpl
Normal file
|
@ -0,0 +1,62 @@
|
|||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "ntfy.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
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).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "ntfy.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "ntfy.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "ntfy.labels" -}}
|
||||
helm.sh/chart: {{ include "ntfy.chart" . }}
|
||||
{{ include "ntfy.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "ntfy.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "ntfy.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "ntfy.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "ntfy.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
134
ntfy/templates/configmap.yaml
Normal file
134
ntfy/templates/configmap.yaml
Normal file
|
@ -0,0 +1,134 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "ntfy.fullname" . }}-env
|
||||
annotations:
|
||||
confighash: {{ .Values.ntfy | toYaml | sha256sum | trunc 32 }}
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
data:
|
||||
NTFY_BASE_URL: {{ .Values.ntfy.baseURL | quote }}
|
||||
|
||||
NTFY_LISTEN_HTTP: ":{{ .Values.service.http.port }}"
|
||||
# listen httpS...
|
||||
|
||||
{{- with .Values.ntfy.firebaseKeyFile }}
|
||||
NTFY_FIREBASE_KEY_FILE: {{ . | quote }}
|
||||
{{- end }}
|
||||
|
||||
# cache
|
||||
{{- with .Values.ntfy.cache.file }}
|
||||
NTFY_CACHE_FILE: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.cache.duration }}
|
||||
NTFY_CACHE_DURATION: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.cache.startupQueries }}
|
||||
NTFY_CACHE_STARTUP_QUERIES: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.cache.batch.size }}
|
||||
NTFY_CACHE_BATCH_SIZE: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.cache.batch.timeout }}
|
||||
NTFY_CACHE_BATCH_TIMEOUT: {{ . | quote }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Values.ntfy.auth.file }}
|
||||
NTFY_AUTH_FILE: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.auth.startupQueries }}
|
||||
NTFY_AUTH_STARTUP_QUERIES: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.auth.defaultAccess }}
|
||||
NTFY_AUTH_DEFAULT_ACCESS: {{ . | quote }}
|
||||
{{- end }}
|
||||
NTFY_BEHIND_PROXY: {{ .Values.ntfy.behindProxy | quote }}
|
||||
|
||||
# attachment
|
||||
{{- with .Values.ntfy.attachment.cacheDir }}
|
||||
NTFY_ATTACHMENT_CACHE_DIR: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.attachment.sizeLimit.total }}
|
||||
NTFY_ATTACHMENT_TOTAL_SIZE_LIMIT: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.attachment.sizeLimit.file }}
|
||||
NTFY_ATTACHMENT_FILE_SIZE_LIMIT: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.attachment.expireDuration }}
|
||||
NTFY_ATTACHMENT_EXPIRY_DURATION: {{ . | quote }}
|
||||
{{- end }}
|
||||
|
||||
# smtp sender
|
||||
{{- with .Values.ntfy.smtp.sender.addr }}
|
||||
NTFY_SMTP_SENDER_ADDR: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.smtp.sender.user }}
|
||||
NTFY_SMTP_SENDER_USER: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.smtp.sender.pass }}
|
||||
NTFY_SMTP_SENDER_PASS: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.smtp.sender.from }}
|
||||
NTFY_SMTP_SENDER_FROM: {{ . | quote }}
|
||||
{{- end }}
|
||||
|
||||
# smtp server
|
||||
{{- if .Values.service.smtp.enabled }}
|
||||
NTFY_SMTP_SERVER_LISTEN: ":{{ .Values.service.smtp.port }}"
|
||||
{{- with .Values.ntfy.smtp.server.domain }}
|
||||
NTFY_SMTP_SERVER_DOMAIN: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.smtp.server.addrPrefix }}
|
||||
NTFY_SMTP_SERVER_ADDR_PREFIX: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Values.ntfy.keepaliveInterval }}
|
||||
NTFY_KEEPALIVE_INTERVAL: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.managerInterval }}
|
||||
NTFY_MANAGER_INTERVAL: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.globalTopicLimit }}
|
||||
NTFY_GLOBAL_TOPIC_LIMIT: {{ . | quote }}
|
||||
{{- end }}
|
||||
NTFY_UPSTREAM_BASE_URL: {{ .Values.ntfy.upstreamBaseURL | quote }}
|
||||
|
||||
# visitor - attachment
|
||||
{{- with .Values.ntfy.visitor.attachment.totalSizeLimit }}
|
||||
NTFY_VISITOR_ATTACHMENT_TOTAL_SIZE_LIMIT: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.visitor.attachment.dailyBandwidthLimit }}
|
||||
NTFY_VISITOR_ATTACHMENT_DAILY_BANDWIDTH_LIMIT: {{ . | quote }}
|
||||
{{- end }}
|
||||
|
||||
# visitor - email
|
||||
{{- with .Values.ntfy.visitor.email.limitBurst }}
|
||||
NTFY_VISITOR_EMAIL_LIMIT_BURST: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.visitor.email.limitReplenish }}
|
||||
NTFY_VISITOR_EMAIL_LIMIT_REPLENISH: {{ . | quote }}
|
||||
{{- end }}
|
||||
|
||||
# visitor - request
|
||||
{{- with .Values.ntfy.visitor.request.limitBurst }}
|
||||
NTFY_VISITOR_REQUEST_LIMIT_BURST: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.visitor.request.limitReplenish }}
|
||||
NTFY_VISITOR_REQUEST_LIMIT_REPLENISH: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.ntfy.visitor.request.limitExemptHosts }}
|
||||
NTFY_VISITOR_REQUEST_LIMIT_EXEMPT_HOSTS: {{ . | quote }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Values.ntfy.visitor.subscriptionLimit }}
|
||||
NTFY_VISITOR_SUBSCRIPTION_LIMIT: {{ . | quote }}
|
||||
{{- end }}
|
||||
NTFY_VISITOR_SUBSCRIBER_RATE_LIMITING: {{ .Values.ntfy.visitor.subscriberRateLimiting | quote }}
|
||||
|
||||
NTFY_WEB_ROOT: {{ .Values.ntfy.webRoot | quote }}
|
||||
NTFY_ENABLE_SIGNUP: {{ .Values.ntfy.enableSignup | quote }}
|
||||
NTFY_ENABLE_LOGIN: {{ .Values.ntfy.enableLogin | quote }}
|
||||
NTFY_ENABLE_RESERVATIONS: {{ .Values.ntfy.enableReservations | quote }}
|
||||
NTFY_ENABLE_METRICS: {{ .Values.ntfy.metrics.enable | quote }}
|
||||
NTFY_METRICS_LISTEN_HTTP: ":{{ .Values.ntfy.metrics.port }}"
|
16
ntfy/templates/configmap_grafana_dashboards.yaml
Normal file
16
ntfy/templates/configmap_grafana_dashboards.yaml
Normal file
|
@ -0,0 +1,16 @@
|
|||
{{- if .Values.grafana.dashboards.enabled }}
|
||||
{{- range $path, $bytes := .Files.Glob "grafana_dashboards/*.json" }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "ntfy.fullname" $ }}-grafana-dashboards-{{ base $path }}
|
||||
labels:
|
||||
{{- include "ntfy.labels" $ | nindent 4 }}
|
||||
{{- toYaml $.Values.grafana.dashboards.labels | nindent 4 }}
|
||||
annotations:
|
||||
{{- toYaml $.Values.grafana.dashboards.annotations | nindent 4 }}
|
||||
data:
|
||||
{{- ($.Files.Glob $path ).AsConfig | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
85
ntfy/templates/deployment.yaml
Normal file
85
ntfy/templates/deployment.yaml
Normal file
|
@ -0,0 +1,85 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "ntfy.fullname" . }}
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
spec:
|
||||
{{- if not .Values.autoscaling.enabled }}
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "ntfy.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
confighash: {{ .Values.ntfy | toYaml | sha256sum | trunc 32 }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "ntfy.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "ntfy.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
args: [ "serve" ]
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ include "ntfy.fullname" . }}-env
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.service.http.port }}
|
||||
protocol: TCP
|
||||
{{- if .Values.ntfy.metrics.enable }}
|
||||
- name: metrics
|
||||
containerPort: {{ .Values.ntfy.metrics.port }}
|
||||
protocol: TCP
|
||||
{{- end }}
|
||||
- name: smtp
|
||||
containerPort: {{ .Values.service.smtp.port }}
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /v1/health
|
||||
port: http
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /v1/health
|
||||
port: http
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: "data"
|
||||
mountPath: "/data"
|
||||
volumes:
|
||||
- name: "data"
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "ntfy.fullname" . }}{{- end }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
28
ntfy/templates/hpa.yaml
Normal file
28
ntfy/templates/hpa.yaml
Normal file
|
@ -0,0 +1,28 @@
|
|||
{{- if .Values.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "ntfy.fullname" . }}
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "ntfy.fullname" . }}
|
||||
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
61
ntfy/templates/ingress.yaml
Normal file
61
ntfy/templates/ingress.yaml
Normal file
|
@ -0,0 +1,61 @@
|
|||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "ntfy.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.http.port -}}
|
||||
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
||||
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
{{- else -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
|
||||
pathType: {{ .pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- else }}
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
15
ntfy/templates/prometheus-rules.yaml
Normal file
15
ntfy/templates/prometheus-rules.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{- if and ( .Values.prometheus.rules.enabled ) ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PrometheusRule
|
||||
metadata:
|
||||
name: {{ include "ntfy.fullname" . }}
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
{{- toYaml .Values.prometheus.rules.labels | nindent 4 }}
|
||||
spec:
|
||||
groups:
|
||||
{{- if .Values.prometheus.rules.additionalRules }}
|
||||
- name: {{ template "ntfy.fullname" . }}-Additional
|
||||
rules: {{- toYaml .Values.prometheus.rules.additionalRules | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
50
ntfy/templates/pvc.yaml
Normal file
50
ntfy/templates/pvc.yaml
Normal file
|
@ -0,0 +1,50 @@
|
|||
{{- if and .Values.persistence.enabled ( not .Values.persistence.existingClaim) -}}
|
||||
---
|
||||
{{- if .Values.persistence.hostPath }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: {{ template "ntfy.fullname" . }}
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
{{- if .Values.persistence.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.persistence.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
accessModes:
|
||||
- {{ .Values.persistence.accessMode | quote }}
|
||||
hostPath:
|
||||
path: "{{ .Values.persistence.hostPath }}"
|
||||
---
|
||||
{{- end }}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ template "ntfy.fullname" . }}
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
{{- if .Values.persistence.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.persistence.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{- if .Values.persistence.storageClass }}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: "{{ .Values.persistence.storageClass }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.persistence.hostPath }}
|
||||
volumeName: {{ template "ntfy.fullname" . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
42
ntfy/templates/service.yaml
Normal file
42
ntfy/templates/service.yaml
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "ntfy.fullname" . }}
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
type: http
|
||||
spec:
|
||||
type: {{ .Values.service.http.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.http.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
{{- if .Values.ntfy.metrics.enable }}
|
||||
- port: {{ .Values.ntfy.metrics.port }}
|
||||
targetPort: metrics
|
||||
protocol: TCP
|
||||
name: metrics
|
||||
{{- end }}
|
||||
selector:
|
||||
{{- include "ntfy.selectorLabels" . | nindent 4 }}
|
||||
{{- if .Values.service.smtp.enabled }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "ntfy.fullname" . }}-smtp
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
type: smtp
|
||||
spec:
|
||||
type: {{ .Values.service.smtp.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.smtp.port }}
|
||||
targetPort: smtp
|
||||
protocol: TCP
|
||||
name: smtp
|
||||
selector:
|
||||
{{- include "ntfy.selectorLabels" . | nindent 4 }}
|
||||
{{- end }}
|
12
ntfy/templates/serviceaccount.yaml
Normal file
12
ntfy/templates/serviceaccount.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "ntfy.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
17
ntfy/templates/servicemonitor.yaml
Normal file
17
ntfy/templates/servicemonitor.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
{{- if and (.Values.prometheus.servicemonitor.enabled) ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ include "ntfy.fullname" . }}
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
{{- toYaml .Values.prometheus.servicemonitor.labels | nindent 4 }}
|
||||
spec:
|
||||
endpoints:
|
||||
- port: metrics
|
||||
path: /metrics
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "ntfy.selectorLabels" . | nindent 6 }}
|
||||
type: http
|
||||
{{- end }}
|
15
ntfy/templates/tests/test-connection.yaml
Normal file
15
ntfy/templates/tests/test-connection.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "ntfy.fullname" . }}-test-connection"
|
||||
labels:
|
||||
{{- include "ntfy.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
containers:
|
||||
- name: wget
|
||||
image: busybox
|
||||
command: ['wget']
|
||||
args: ['{{ include "ntfy.fullname" . }}:{{ .Values.service.port }}']
|
||||
restartPolicy: Never
|
204
ntfy/values.yaml
Normal file
204
ntfy/values.yaml
Normal file
|
@ -0,0 +1,204 @@
|
|||
# Default values for ntfy.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: binwiederhier/ntfy
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: ""
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
ntfy:
|
||||
baseURL: "https://ntfy.example.org"
|
||||
listen:
|
||||
http: ":80"
|
||||
https: null
|
||||
unix: null
|
||||
unixMode: null
|
||||
keyFile: null
|
||||
certFile: null
|
||||
firebaseKeyFile: null
|
||||
cache:
|
||||
file: null
|
||||
duration: "12h"
|
||||
batch:
|
||||
size: 0
|
||||
timeout: 0s
|
||||
startupQueries: null
|
||||
# startupQueries: |
|
||||
# pragma journal_mode = WAL;
|
||||
# pragma synchronous = normal;
|
||||
# pragma temp_store = memory;
|
||||
# pragma busy_timeout = 15000;
|
||||
# vacuum;
|
||||
auth:
|
||||
file: null
|
||||
startupQueries: null
|
||||
defaultAccess: "read-write"
|
||||
attachment:
|
||||
cacheDir: null
|
||||
sizeLimit:
|
||||
total: "5G"
|
||||
file: "15M"
|
||||
expireDuration: "3h"
|
||||
keepaliveInterval: "45s"
|
||||
managerInterval: "1m"
|
||||
webRoot: "app"
|
||||
enableReservations: false
|
||||
enableSignup: false
|
||||
enableLogin: false
|
||||
upstreamBaseURL: "https://ntfy.sh"
|
||||
smtp:
|
||||
sender:
|
||||
addr: null
|
||||
user: null
|
||||
pass: null
|
||||
from: null
|
||||
server:
|
||||
domain: null
|
||||
addrPrefix: null
|
||||
globalTopicLimit: 15000
|
||||
visitor:
|
||||
subscriptionLimit: 30
|
||||
attachment:
|
||||
totalSizeLimit: "100M"
|
||||
dailyBandwidthLimit: "500M"
|
||||
request:
|
||||
limitBurst: 60
|
||||
limitReplenish: "5s"
|
||||
limitExemptHosts: ""
|
||||
# NTFY_VISITOR_MESSAGE_DAILY_LIMIT
|
||||
email:
|
||||
limitBurst: 16
|
||||
limitReplenish: "1h"
|
||||
subscriberRateLimiting: false
|
||||
behindProxy: true
|
||||
# NTFY_STRIPE_SECRET_KEY
|
||||
# NTFY_STRIPE_WEBHOOK_KEY
|
||||
# NTFY_BILLING_CONTACT
|
||||
metrics:
|
||||
enable: true
|
||||
port: 9000
|
||||
|
||||
## Enable persistence using Persistent Volume Claims
|
||||
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
|
||||
##
|
||||
persistence:
|
||||
# Upload (/var/www/html)
|
||||
enabled: false
|
||||
annotations: {}
|
||||
## mobilizon data Persistent Volume Storage Class
|
||||
## If defined, storageClassName: <storageClass>
|
||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||
## If undefined (the default) or set to null, no storageClassName spec is
|
||||
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||
## GKE, AWS & OpenStack)
|
||||
##
|
||||
# storageClass: "-"
|
||||
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## Requires persistence.enabled: true
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
# existingClaim:
|
||||
|
||||
## Create a PV on Node with given hostPath
|
||||
## storageClass has to be manual
|
||||
# hostPath:
|
||||
accessMode: ReadWriteOnce
|
||||
size: 1Gi
|
||||
|
||||
prometheus:
|
||||
servicemonitor:
|
||||
enabled: false
|
||||
labels: {}
|
||||
rules:
|
||||
enabled: false
|
||||
labels: {}
|
||||
# current no default alertrules are provided
|
||||
additionalRules: []
|
||||
|
||||
grafana:
|
||||
dashboards:
|
||||
enabled: false
|
||||
labels:
|
||||
grafana_dashboard: "1"
|
||||
annotations: {}
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: true
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
service:
|
||||
http:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
|
||||
smtp:
|
||||
enabled: false
|
||||
type: LoadBalancer
|
||||
port: 25
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
hosts:
|
||||
- host: chart-example.local
|
||||
paths:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
resources: {}
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
autoscaling:
|
||||
enabled: false
|
||||
minReplicas: 1
|
||||
maxReplicas: 100
|
||||
targetCPUUtilizationPercentage: 80
|
||||
# targetMemoryUtilizationPercentage: 80
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
Loading…
Add table
Reference in a new issue