apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: anchor-ip-annotator
  labels:
    app.kubernetes.io/name: do-floating-ip
    app.kubernetes.io/component: annotator
  namespace: default
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: do-floating-ip
      app.kubernetes.io/component: annotator
  template:
    metadata:
      name: anchor-ip-annotator
      labels:
        app.kubernetes.io/name: do-floating-ip
        app.kubernetes.io/component: annotator
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                - key: k8s.haim.dev/digital-ocean-anchor-ip
                  operator: DoesNotExist
      containers:
        - name: anchor-ip-annotator
          # TODO: Switch to using versions once stable
          image: ghcr.io/haimgel/do-floating-ip:main
          imagePullPolicy: Always
          command: ["/app/anchor-ip-annotator"]
          # command: ["/bin/sleep", "24h"]
          resources: {}
      serviceAccount: do-floating-ip
