go.ligato.io/vpp-agent/v3@v3.5.0/k8s/dev-setup/README.md (about)

     1  ## Deploying VPP Agent Docker Images Using Kubernetes
     2  
     3  This document describes how the development Docker image can be deployed 
     4  on an one-node development Kubernetes cluster using kubeadm][1] with 
     5  [Calico] networking on Linux.
     6  
     7  The recipe described here has been tested with kubeadm version 1.6.3.
     8  
     9  Init kubeadm master:
    10  ```
    11  kubeadm init
    12  
    13  cp /etc/kubernetes/admin.conf $HOME/
    14  chown $(id -u):$(id -g) $HOME/admin.conf
    15  export KUBECONFIG=$HOME/admin.conf
    16  
    17  kubectl taint nodes --all node-role.kubernetes.io/master-
    18  ```
    19  
    20  Enable Calico networking:
    21  ```
    22  kubectl apply -f http://docs.projectcalico.org/v2.2/getting-started/kubernetes/installation/hosted/kubeadm/1.6/calico.yaml
    23  ```
    24  
    25  Start ETCD on the host 
    26  (a new ETCD instance on port 22379, since already running ETCD deployed 
    27  by kubeadm does not accept remote connections):
    28  ```
    29  sudo docker run -p 22379:2379 --name etcd --rm \
    30      quay.io/coreos/etcd:v3.0.16 /usr/local/bin/etcd \
    31      -advertise-client-urls http://0.0.0.0:2379 \
    32      -listen-client-urls http://0.0.0.0:2379
    33  ```
    34  
    35  Start Kafka on the host:
    36  ```
    37  sudo docker run -p 2181:2181 -p 9092:9092 --name kafka --rm \
    38   --env ADVERTISED_HOST=172.17.0.1 --env ADVERTISED_PORT=9092 spotify/kafka
    39  ```
    40  
    41  Deploy VNF & vSwitch PODs:
    42  ```
    43  kubectl apply -f vswitch-vpp.yaml
    44  kubectl apply -f vnf-vpp.yaml
    45  ```
    46  
    47  Verify the deployment:
    48  ```
    49  kubectl get pods
    50  kubectl describe pods
    51  ```
    52  
    53  Write some config into ETCD (using etcd.conf that refers to the port 22379):
    54  ```
    55  export ETCD_CONFIG=./etcd.conf
    56  ../../cmd/vpp-agent-ctl/topology.sh
    57  ```
    58  
    59  Verify that the VPPs have been configured with some config:
    60  ```
    61  kubectl describe pods | grep 'IP:'
    62  IP:		192.168.243.216
    63  IP:		192.168.243.217
    64  ```
    65  
    66  ```
    67  telnet 192.168.243.216 5002
    68  vpp# sh inter addr
    69  local0 (dn):
    70  memif0 (up):
    71    10.10.1.2/24
    72  memif1 (up):
    73    166.111.8.2/24
    74  ```
    75  
    76  ```
    77  vpp# sh inter addr
    78  local0 (dn):
    79  loop0 (up):
    80    6.0.0.100/24
    81  loop1 (up):
    82    l2 bridge bd_id 1 bvi shg 0
    83    10.10.1.1/24
    84  memif0 (up):
    85    l2 bridge bd_id 1 shg 0
    86  memif1 (up):
    87    l2 bridge bd_id 1 shg 0
    88  memif2 (up):
    89    l2 bridge bd_id 1 shg 0
    90  memif3 (up):
    91    l2 bridge bd_id 2 shg 0
    92  vxlan_tunnel0 (up):
    93    l2 bridge bd_id 2 shg 0
    94  ```
    95  
    96  Verify logs:
    97  ```
    98  kubectl describe pods | grep 'Container ID:'
    99      Container ID:	docker://8511cbbbecff744a06fae94b861f8030bd7be52d2c2db0533b63ac151d36b13c
   100      Container ID:	docker://81ed74b291611b4a9f6db2a9d37aba56d4fddc1125400d19fadfc96adb33cc6b
   101  ```
   102  
   103  ```
   104  docker logs 8511cbbbecff744a06fae94b861f8030bd7be52d2c2db0533b63ac151d36b13c
   105  docker logs 81ed74b291611b4a9f6db2a9d37aba56d4fddc1125400d19fadfc96adb33cc6b
   106  ```
   107  
   108  [1]: https://kubernetes.io/docs/getting-started-guides/kubeadm/
   109  [2]: http://docs.projectcalico.org/v2.2/getting-started/kubernetes/installation/hosted/kubeadm/