apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: headscale-webui
  name: headscale-webui
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: headscale-webui
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: headscale-webui
    spec:
      containers:
        - image: ghcr.io/ifargle/headscale-webui:v0.6.1
          imagePullPolicy: IfNotPresent
          name: headscale-webui
          env:
            - name: TZ
              value: Europe/Zurich
            - name: HS_SERVER
              value: http://headscale.headscale:8080
            - name: DOMAIN_NAME
              value: https://hsadmin.tbrnt.ch
            - name: AUTH_TYPE
              value: Basic
          envFrom:
            - secretRef:
                name: webui-config
          ports:
            - containerPort: 5000
              name: http
              protocol: TCP
          volumeMounts:
            - mountPath: /etc/headscale
              name: etc
            - mountPath: /data
              name: data
          resources:
            requests:
              memory: 64Mi
              cpu: 150m
            limits:
              memory: 256Mi
              cpu: 300m
          securityContext:
            runAsUser: 1000
            runAsGroup: 1000
      volumes:
        - configMap:
            name: headscale-etc-copy
          name: etc
        - persistentVolumeClaim:
            claimName: data
          name: data
