apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: private-fip-controller
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: private-fip-controller
  template:
    metadata:
      labels:
        app.kubernetes.io/name: private-fip-controller
    spec:
      automountServiceAccountToken: false
      securityContext:
        seccompProfile:
          type: RuntimeDefault
        runAsNonRoot: true
        runAsUser: 999
        runAsGroup: 999
      hostNetwork: true
      containers:
        - name: private-fip-controller
          image: rwunderer/hcloud-private-fip-controller:v0.2.0
          imagePullPolicy: Always
          env:
            - name: HOST_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
            - name: HCLOUD_TOKEN
              valueFrom:
                secretKeyRef:
                  name: hcloud
                  key: token
            - name: HCLOUD_NETWORK
              valueFrom:
                secretKeyRef:
                  name: hcloud
                  key: network
            - name: IP_ADDRESS
              value: 10.255.255.1
          resources:
            limits:
              memory: 10Mi
              cpu: 10m
            requests:
              memory: 10Mi
              cpu: 10m
          securityContext:
            capabilities:
              drop:
              - ALL
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
      nodeSelector:
        node-role.kubernetes.io/control-plane: ""                                                                          
      tolerations:
      - effect: NoSchedule
        operator: Exists
      - key: CriticalAddonsOnly
        operator: Exists
      - effect: NoExecute
        operator: Exists
