---
# this config maps tells the vpp-agent running as a CNF how to connect to ETCD
# from where the VPP agent gets its configuration
apiVersion: v1
kind: ConfigMap
metadata:
  name: etcd-cfg
  labels:
    name: etcd-cfg
  namespace: default
data:
  etcd.conf: |
    insecure-transport: true
    dial-timeout: 10000000000
    auto-compact: 600000000000
    allow-delayed-start: true
    reconnect-interval: 2000000000
    endpoints:
      - "contiv-etcd.kube-system.svc.cluster.local:12379"

---
# CNF 2 pod definition. Pod is connected with two additional memif interfaces
# in the "stub" network = meaning that they won't have any IP address assigned
apiVersion: v1
kind: Pod
metadata:
  name: vpp-cnf
  annotations:
    contivpp.io/custom-if: memif3/memif/stub, memif4/memif/stub
    contivpp.io/microservice-label: vpp-cnf
  labels:
    cnf: vpp-cnf
spec:
  containers:
    - name: vpp-agent
      image: ligato/vpp-agent:v2.3.0
      securityContext:
        privileged: true
      env:
        - name: ETCD_CONFIG
          value: "/etc/etcd/etcd.conf"
        - name: MICROSERVICE_LABEL
          value: vpp-cnf
      resources:
        limits:
          hugepages-2Mi: 512Mi
          memory: 512Mi
          contivpp.io/memif: 1
      volumeMounts:
        - name: etcd-cfg
          mountPath: /etc/etcd
  volumes:
    - name: etcd-cfg
      configMap:
        name: etcd-cfg
