---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nut-server-study
  namespace: home-network
  labels:
    app: nut-server-study
  annotations:
    configmap.reloader.stakater.com/reload: "nut-server-study"
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: nut-server-study
  template:
    metadata:
      labels:
        app: nut-server-study
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: feature.node.kubernetes.io/custom-ups-apc
                    operator: In
                    values:
                      - "true"

      containers:
        - name: nut-server
          image: "kmlucy/docker-nut"
          imagePullPolicy: Always
          securityContext:
            privileged: true
          ports:
            - name: nut
              containerPort: 3493
              protocol: TCP
          volumeMounts:
            - name: configmap
              mountPath: /etc/nut/nut.conf
              readOnly: true
              subPath: nut.conf
            - name: configmap
              mountPath: /etc/nut/ups.conf
              readOnly: true
              subPath: ups.conf
            - name: configmap
              mountPath: /etc/nut/upsd.conf
              readOnly: true
              subPath: upsd.conf
          resources: {}

      volumes:
        - name: configmap
          configMap:
            name: nut-server-study
