Files
diun/app.yaml
T
2026-10-14 20:17:53 +02:00

133 lines
3.9 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: diun
namespace: diun
data:
LOG_LEVEL: info
LOG_JSON: "false"
TZ: Europe/Vienna
DIUN_WATCH_SCHEDULE: "0 */6 * * *"
DIUN_WATCH_JITTER: 30s
DIUN_PROVIDERS_KUBERNETES: "true"
DIUN_PROVIDERS_KUBERNETES_WATCHBYDEFAULT: "true"
DIUN_REGOPTS_0_NAME: registry.brunner.ninja
DIUN_REGOPTS_0_SELECTOR: image
DIUN_REGOPTS_0_USERNAMEFILE: /run/secrets/diun-registry-credentials/username
DIUN_REGOPTS_0_PASSWORDFILE: /run/secrets/diun-registry-credentials/password
DIUN_NOTIF_SCRIPT_CMD: /bin/sh
DIUN_NOTIF_SCRIPT_ARGS: /etc/diun/notifier/send-matrix.sh
---
apiVersion: v1
kind: ConfigMap
metadata:
name: diun-matrix-script
namespace: diun
data:
send-matrix.sh: |
set -eu
token=$(cat /run/secrets/diun-matrix-token/token)
url="matrix://:${token}@matrix.brunner.ninja:443/?rooms=!ckpLXMvXlZJtuvQBIJ:brunner.ninja"
message="Diun: ${DIUN_ENTRY_IMAGE} ${DIUN_ENTRY_STATUS} (${DIUN_ENTRY_PROVIDER})"
if [ -n "${DIUN_ENTRY_METADATA_POD_NAMESPACE:-}" ]; then
message="${message} in namespace ${DIUN_ENTRY_METADATA_POD_NAMESPACE}"
fi
SHOUTRRR_URL="${url}" /opt/shoutrrr/shoutrrr send --message "${message}"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: diun
namespace: diun
labels:
app.kubernetes.io/name: diun
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: diun
template:
metadata:
labels:
app.kubernetes.io/name: diun
annotations:
diun.enable: "false"
spec:
serviceAccountName: diun
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
initContainers:
- name: install-shoutrrr
image: docker.io/curlimages/curl:8.16.0
command: ["/bin/sh", "-ec"]
args:
- |
curl -fsSL -o /tmp/shoutrrr.tar.gz \
https://github.com/nicholas-fedor/shoutrrr/releases/download/v0.14.0/shoutrrr_linux_amd64_0.14.0.tar.gz
tar -xzf /tmp/shoutrrr.tar.gz -C /tools shoutrrr
chmod 0555 /tools/shoutrrr
volumeMounts:
- name: shoutrrr
mountPath: /tools
containers:
- name: diun
image: crazymax/diun:4.33.0
imagePullPolicy: IfNotPresent
args: ["serve"]
envFrom:
- configMapRef:
name: diun
startupProbe:
exec:
command: ["diun", "healthcheck"]
periodSeconds: 10
failureThreshold: 30
readinessProbe:
exec:
command: ["diun", "healthcheck"]
periodSeconds: 30
livenessProbe:
exec:
command: ["diun", "healthcheck"]
periodSeconds: 60
volumeMounts:
- name: data
mountPath: /data
- name: matrix-token
mountPath: /run/secrets/diun-matrix-token
readOnly: true
- name: registry-credentials
mountPath: /run/secrets/diun-registry-credentials
readOnly: true
- name: matrix-script
mountPath: /etc/diun/notifier
readOnly: true
- name: shoutrrr
mountPath: /opt/shoutrrr
readOnly: true
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: [ALL]
volumes:
- name: data
persistentVolumeClaim:
claimName: diun
- name: matrix-token
secret:
secretName: diun-matrix-token
- name: registry-credentials
secret:
secretName: diun-registry-credentials
- name: matrix-script
configMap:
name: diun-matrix-script
- name: shoutrrr
emptyDir: {}