docs: better docs, mv doxygen to sphinx
[vpp.git] / docs / usecases / contiv / SINGLE_NIC_SETUP.rst
1 Setting up a Node with a Single NIC
2 ===================================
3
4 Installing the STN Daemon
5 -------------------------
6
7 The STN (Steal the NIC) daemon must be installed on every node in the
8 cluster that has only one NIC. The STN daemon installation(*) should be
9 performed before deployment of the Contiv-VPP plugin.
10
11 \* Docker daemon must be present when installing STN. Also, Docker must
12 be configured to allow shared mount. On CentOS, this may not be the case
13 by default. You can enable it by following the instructions at
14 https://docs.portworx.com/knowledgebase/shared-mount-propagation.html.
15
16 Run as root (not using sudo):
17
18 ::
19
20    bash <(curl -s https://raw.githubusercontent.com/contiv/vpp/master/k8s/stn-install.sh)
21
22 The install script should output the following:
23
24 ::
25
26    Installing Contiv STN daemon.
27    Starting contiv-stn Docker container:
28    550334308f85f05b2690f5cfb5dd945bd9c501ab9d074231f15c14d7098ef212
29
30 Check that the STN daemon is running:
31
32 ::
33
34    docker ps -a
35    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
36    550334308f85        contivvpp/stn       "/stn"              33 seconds ago      Up 33 seconds                           contiv-stn
37
38 Check that the STN daemon is operational:
39
40 ::
41
42    docker logs contiv-stn
43
44 The expected logs would look like the following excerpt:
45
46 ::
47
48    2018/02/23 10:08:34 Starting the STN GRPC server at port 50051
49
50 For more details, please read the Go documentation for
51 `contiv-stn <https://github.com/contiv/vpp/blob/master/cmd/contiv-stn/doc.go>`__
52 and
53 `contiv-init <https://github.com/contiv/vpp/blob/master/cmd/contiv-init/doc.go>`__.
54
55 Creating a VPP Interface Configuration
56 --------------------------------------
57
58 Create the VPP configuration for the hardware interface as described
59 `here <https://github.com/contiv/vpp/blob/master/docs/VPP_CONFIG.md#single-nic-configuration>`__.
60
61 Configuring STN in Contiv-VPP K8s Deployment Files
62 --------------------------------------------------
63
64 The STN feature is disabled by default. It needs to be enabled either
65 globally, or individually for every node in the cluster.
66
67 Global Configuration:
68 ~~~~~~~~~~~~~~~~~~~~~
69
70 Global configuration is used in homogeneous environments where all nodes
71 in a given cluster have the same hardware configuration, for example
72 only a single Network Adapter. To enable the STN feature globally, put
73 the ``StealFirstNIC: True`` stanza into the [``contiv-vpp.yaml``][1]
74 deployment file, for example:
75
76 ::
77
78    data:
79      contiv.yaml: |-
80        TCPstackDisabled: true
81        ...
82        StealFirstNIC: True
83        ...
84        IPAMConfig:
85
86 Setting ``StealFirstNIC`` to ``True`` will tell the STN Daemon on every
87 node in the cluster to steal the first NIC from the kernel and assign it
88 to VPP. Note that the Network Adapters on different nodes do not need to
89 be of the same type. You still need to create the respective vswitch
90 configurations on every node in the cluster, as shown
91 [above](#creating-a-vpp-interface-configuration).
92
93 Individual Configuration:
94 ~~~~~~~~~~~~~~~~~~~~~~~~~
95
96 Individual configuration is used in heterogeneous environments where
97 each node in a given cluster may be configured differently. To enable
98 the STN feature for a specific node in the cluster, put the following
99 stanza into its Node Configuration in the [``contiv-vpp.yaml``][1]
100 deployment file, for example:
101
102 ::
103
104    ...
105        NodeConfig:
106        - NodeName: "ubuntu-1"
107          StealInterface: "enp0s8"
108        - NodeName: "ubuntu-2"
109          StealInterface: "enp0s8"
110    ...
111
112 Note that you still have to create the vswitch configuration on the node
113 as shown `here <#creating-a-vpp-interface-configuration>`__.
114
115 Uninstalling the STN Daemon
116 ---------------------------
117
118 Run as root (not using sudo):
119
120 ::
121
122    bash <(curl -s https://raw.githubusercontent.com/contiv/vpp/master/k8s/stn-install.sh) --uninstall
123
124 The install script should output the following:
125
126 ::
127
128    Uninstalling Contiv STN daemon.
129    Stopping contiv-stn Docker container:
130    contiv-stn
131    contiv-stn
132    contiv-stn
133
134 Make sure that the STN daemon has been uninstalled:
135
136 ::
137
138    docker ps -q -f name=contiv-stn
139
140 No containers should be listed.