---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: kube-vip
  namespace: kube-system
spec:
  selector:
    matchLabels:
      name: kube-vip
  template:
    metadata:
      labels:
        name: kube-vip
    spec:
      containers:
      - name: kube-vip
        image: ghcr.io/kube-vip/kube-vip:v0.4.1
        imagePullPolicy: IfNotPresent
        args:
        - manager
        env:
        - name: vip_arp
          value: "false"
        - name: vip_interface
          value: lo
        - name: port
          value: "6443"
        - name: vip_cidr
          value: "32"
        - name: cp_enable
          value: "true"
        - name: cp_namespace
          value: kube-system
        - name: vip_startleader
          value: "false"
        - name: vip_loglevel
          value: "5"
        - name: bgp_enable
          value: "true"
        - name: bgp_routerinterface
          value: "eno1"
        - name: bgp_as
          value: "64512"
        - name: bgp_peeraddress
          value: "10.10.200.1"
        - name: bgp_peeras
          value: "64512"
        - name: vip_address
          value: "10.10.200.10"
        securityContext:
          capabilities:
            add:
            - NET_ADMIN
            - NET_RAW
            - SYS_TIME
        volumeMounts:
        - mountPath: /etc/kubernetes/admin.conf
          name: kubeconfig
      hostNetwork: true
      volumes:
      - hostPath:
          path: /etc/rancher/k3s/k3s.yaml
        name: kubeconfig
      nodeSelector:
        node-role.kubernetes.io/master: "true"
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule