apiVersion: apps/v1
kind: Deployment
metadata:
  name: gotify
  namespace: monitoring
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: gotify
  template:
    metadata:
      labels:
        app.kubernetes.io/name: gotify
    spec:
      containers:
      - name: gotify
        image: gotify/server
        env:
        - name: GOTIFY_SERVER_PORT
          value: "8080"
        - name: GOTIFY_SERVER_SSL_ENABLED
          value: "false"
        - name: GOTIFY_DATABASE_DIALECT
          value: "sqlite3"
        - name: GOTIFY_DATABASE_CONNECTION
          value: "data/gotify.db"
        - name: GOTIFY_REGISTRATION
          value: "false"
        - name: GOTIFY_DEFAULTUSER_PASS
          valueFrom:
            secretKeyRef:
              name: gotify-admin
              key: password
        ports:
        - containerPort: 8080
          name: http
        resources:
          limits:
            cpu: 50m
            memory: 40Mi
          requests:
            cpu: 10m
            memory: 20Mi
        volumeMounts:
        - name: gotify-data
          mountPath: /app/data/
        securityContext:
          runAsNonRoot: true
          runAsUser: 2000
          runAsGroup: 2000
      serviceAccountName: gotify
      volumes:
      - name: gotify-data
        persistentVolumeClaim:
          claimName: gotify-data
