---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: nativelb-agent
  namespace: nativelb
  labels:
    k8s.nativelb.io/cluster: cluster-internal
spec:
  selector:
    matchLabels:
      k8s.nativelb.io/daemonset: nativelb-agent
  template:
    metadata:
      labels:
        k8s.nativelb.io/daemonset: nativelb-agent
        daemonset.nativelb.io/port: "8000"
    spec:
      hostNetwork: true
      containers:
        - name: agent
          image: quay.io/k8s-nativelb/nativelb-agent-mock:latest
          imagePullPolicy: Always
          securityContext:
            capabilities:
              add: ["NET_ADMIN","SYS_MODULE"]
            privileged: true
          env:
            - name: CONTROL_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
            - name: CONTROL_PORT
              value: "8000"
            - name: CLUSTER_NAME
              value: "cluster-internal"
          volumeMounts:
            - name: bind
              mountPath: /var/proc/sys/net/ipv4/ip_nonlocal_bind
      volumes:
        - name: bind
          hostPath:
            path: /proc/sys/net/ipv4/ip_nonlocal_bind
      terminationGracePeriodSeconds: 15
