blob: b89db551ed116c2b6487c1b733bbd714ef545338 [file] [log] [blame]
Hung-Wei Chiu77c969e2020-10-23 18:13:07 +00001..
2 SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
3 SPDX-License-Identifier: Apache-2.0
4
5=============
6Bootstrapping
7=============
8
Hyunsun Moona79c7422020-11-18 04:52:56 -08009VPN
10===
11This section walks you through how to set up a VPN between ACE and Aether Central in GCP.
12We will be using GitOps based Aether CD pipeline for this,
13so we just need to create a patch to **aether-pod-configs** repository.
14Note that some of the steps described here are not directly related to setting up a VPN,
15but rather are a prerequisite for adding a new ACE.
16
17Before you begin
18----------------
19* Make sure firewall in front of ACE allows UDP port 500, UDP port 4500, and ESP packets
20 from **gcpvpn1.infra.aetherproject.net(35.242.47.15)** and **gcpvpn2.infra.aetherproject.net(34.104.68.78)**
21* Make sure that the external IP on ACE side is owned by or routed to the management node
22
23To help your understanding, the following sample ACE environment will be used in the rest of this section.
24Make sure to replace the sample values when you actually create a review request.
25
26+-----------------------------+----------------------------------+
27| Management node external IP | 128.105.144.189 |
28+-----------------------------+----------------------------------+
29| ASN | 65003 |
30+-----------------------------+----------------------------------+
31| GCP BGP IP address | Tunnel 1: 169.254.0.9/30 |
32| +----------------------------------+
33| | Tunnel 2: 169.254.1.9/30 |
34+-----------------------------+----------------------------------+
35| ACE BGP IP address | Tunnel 1: 169.254.0.10/30 |
36| +----------------------------------+
37| | Tunnel 2: 169.254.1.10/30 |
38+-----------------------------+----------------------------------+
39| PSK | UMAoZA7blv6gd3IaArDqgK2s0sDB8mlI |
40+-----------------------------+----------------------------------+
41| Management Subnet | 10.91.0.0/24 |
42+-----------------------------+----------------------------------+
43| K8S Subnet | Pod IP: 10.66.0.0/17 |
44| +----------------------------------+
45| | Cluster IP: 10.66.128.0/17 |
46+-----------------------------+----------------------------------+
47
48
49Download aether-pod-configs repository
50--------------------------------------
51.. code-block:: shell
52
53 $ cd $WORKDIR
54 $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-pod-configs"
55
56Update global resource maps
57---------------------------
58Add a new ACE information at the end of the following global resource maps.
59
60* user_map.tfvars
61* cluster_map.tfvars
62* vpn_map.tfvars
63
64As a note, you can find several other global resource maps under the `production` directory.
65Resource definitions that need to be shared among clusters or are better managed in a
66single file to avoid configuration conflicts are maintained in this way.
67
68.. code-block:: diff
69
70 $ cd $WORKDIR/aether-pod-configs/production
71 $ vi user_map.tfvars
72
73 # Add the new cluster admin user at the end of the map
74 $ git diff user_map.tfvars
75 --- a/production/user_map.tfvars
76 +++ b/production/user_map.tfvars
77 @@ user_map = {
78 username = "menlo"
79 password = "changeme"
80 global_roles = ["user-base", "catalogs-use"]
81 + },
82 + test_admin = {
83 + username = "test"
84 + password = "changeme"
85 + global_roles = ["user-base", "catalogs-use"]
86 }
87 }
88
89.. code-block:: diff
90
91 $ cd $WORKDIR/aether-pod-configs/production
92 $ vi cluster_map.tfvars
93
94 # Add the new K8S cluster information at the end of the map
95 $ git diff cluster_map.tfvars
96 --- a/production/cluster_map.tfvars
97 +++ b/production/cluster_map.tfvars
98 @@ cluster_map = {
99 kube_dns_cluster_ip = "10.53.128.10"
100 cluster_domain = "prd.menlo.aetherproject.net"
101 calico_ip_detect_method = "can-reach=www.google.com"
102 + },
103 + ace-test = {
104 + cluster_name = "ace-test"
105 + management_subnets = ["10.91.0.0/24"]
106 + k8s_version = "v1.18.8-rancher1-1"
107 + k8s_pod_range = "10.66.0.0/17"
108 + k8s_cluster_ip_range = "10.66.128.0/17"
109 + kube_dns_cluster_ip = "10.66.128.10"
110 + cluster_domain = "prd.test.aetherproject.net"
111 + calico_ip_detect_method = "can-reach=www.google.com"
112 }
113 }
114 }
115
116.. code-block:: diff
117
118 $ cd $WORKDIR/aether-pod-configs/production
119 $ vi vpn_map.tfvars
120
121 # Add VPN and tunnel information at the end of the map
122 $ git diff vpn_map.tfvars
123 --- a/production/vpn_map.tfvars
124 +++ b/production/vpn_map.tfvars
125 @@ vpn_map = {
126 bgp_peer_ip_address_1 = "169.254.0.6"
127 bgp_peer_ip_range_2 = "169.254.1.5/30"
128 bgp_peer_ip_address_2 = "169.254.1.6"
129 + },
130 + ace-test = {
131 + peer_name = "production-ace-test"
132 + peer_vpn_gateway_address = "128.105.144.189"
133 + tunnel_shared_secret = "UMAoZA7blv6gd3IaArDqgK2s0sDB8mlI"
134 + bgp_peer_asn = "65003"
135 + bgp_peer_ip_range_1 = "169.254.0.9/30"
136 + bgp_peer_ip_address_1 = "169.254.0.10"
137 + bgp_peer_ip_range_2 = "169.254.1.9/30"
138 + bgp_peer_ip_address_2 = "169.254.1.10"
139 }
140 }
141
142.. note::
143 Unless you have a specific requirement, set ASN and BGP addresses to the next available values in the map.
144
145
146Create ACE specific configurations
147----------------------------------
148In this step, we will create a directory under `production` with the same name as ACE,
149and add several Terraform configurations and Ansible inventory needed to configure a VPN connection.
150Throughout the deployment procedure, this directory will contain all ACE specific configurations.
151
152Run the following commands to auto-generate necessary files under the target ACE directory.
153
154.. code-block:: shell
155
156 $ cd $WORKDIR/aether-pod-configs/tools
157 $ vi ace_env
158 # Set environment variables
159
160 $ source ace_env
161 $ make vpn
162 Created ../production/ace-test
163 Created ../production/ace-test/main.tf
164 Created ../production/ace-test/variables.tf
165 Created ../production/ace-test/gcp_fw.tf
166 Created ../production/ace-test/gcp_ha_vpn.tf
167 Created ../production/ace-test/ansible
168 Created ../production/ace-test/backend.tf
169 Created ../production/ace-test/cluster_val.tfvars
170 Created ../production/ace-test/ansible/hosts.ini
171 Created ../production/ace-test/ansible/extra_vars.yml
172
173.. attention::
174 The predefined templates are tailored to Pronto BOM. You'll need to fix `cluster_val.tfvars` and `ansible/extra_vars.yml`
175 when using a different BOM.
176
177Create a review request
178-----------------------
179.. code-block:: shell
180
181 $ cd $WORKDIR/aether-pod-configs/production
182 $ git status
183 On branch tools
184 Changes not staged for commit:
185
186 modified: cluster_map.tfvars
187 modified: user_map.tfvars
188 modified: vpn_map.tfvars
189
190 Untracked files:
191 (use "git add <file>..." to include in what will be committed)
192
193 ace-test/
194
195 $ git add .
196 $ git commit -m "Add test ACE"
197 $ git review
198
199Once the review request is accepted and merged,
200CD pipeline will create VPN tunnels on both GCP and the management node.
201
202Verify VPN connection
203---------------------
204You can verify the VPN connections after successful post-merge job
205by checking the routing table on the management node and trying to ping to one of the central cluster VMs.
206Make sure two tunnel interfaces, `gcp_tunnel1` and `gcp_tunnel2`, exist
207and three additional routing entries via one of the tunnel interfaces.
208
209.. code-block:: shell
210
211 $ netstat -rn
212 Kernel IP routing table
213 Destination Gateway Genmask Flags MSS Window irtt Iface
214 0.0.0.0 128.105.144.1 0.0.0.0 UG 0 0 0 eno1
215 10.45.128.0 169.254.0.9 255.255.128.0 UG 0 0 0 gcp_tunnel1
216 10.52.128.0 169.254.0.9 255.255.128.0 UG 0 0 0 gcp_tunnel1
217 10.66.128.0 10.91.0.8 255.255.128.0 UG 0 0 0 eno1
218 10.91.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eno1
219 10.168.0.0 169.254.0.9 255.255.240.0 UG 0 0 0 gcp_tunnel1
220 128.105.144.0 0.0.0.0 255.255.252.0 U 0 0 0 eno1
221 169.254.0.8 0.0.0.0 255.255.255.252 U 0 0 0 gcp_tunnel1
222 169.254.1.8 0.0.0.0 255.255.255.252 U 0 0 0 gcp_tunnel2
223
224 $ ping 10.168.0.6 -c 3
225 PING 10.168.0.6 (10.168.0.6) 56(84) bytes of data.
226 64 bytes from 35.235.67.169: icmp_seq=1 ttl=56 time=67.9 ms
227 64 bytes from 35.235.67.169: icmp_seq=2 ttl=56 time=67.4 ms
228 64 bytes from 35.235.67.169: icmp_seq=3 ttl=56 time=67.1 ms
229
230 --- 10.168.0.6 ping statistics ---
231 3 packets transmitted, 3 received, 0% packet loss, time 2002ms
232 rtt min/avg/max/mdev = 67.107/67.502/67.989/0.422 ms
233
234Post VPN setup
235--------------
236Once you verify the VPN connections, please update `ansible` directory name to `_ansible` to prevent
237the ansible playbook from running again.
238Note that it is no harm to re-run the ansible playbook but not recommended.
239
240.. code-block:: shell
241
242 $ cd $WORKDIR/aether-pod-configs/production/$ACE_NAME
243 $ mv ansible _ansible
244 $ git add .
245 $ git commit -m "Mark ansible done for test ACE"
246 $ git review
247
248
Charles Chan4a107222020-10-30 17:23:48 -0700249OS Installation - Switches
250==========================
251
252.. note::
253
254 This part will be done automatically once we have a DHCP and HTTP server set up in the infrastructure.
255 For now, we need to download and install the ONL image manually.
256
257Install ONL with Docker
258-----------------------
259First, enter **ONIE rescue mode**.
260
261Set up IP and route
262^^^^^^^^^^^^^^^^^^^
263.. code-block:: console
264
265 # ip addr add 10.92.1.81/24 dev eth0
266 # ip route add default via 10.92.1.1
267
268- `10.92.1.81/24` should be replaced by the actual IP and subnet of the ONL.
269- `10.92.1.1` should be replaced by the actual default gateway.
270
271Download and install ONL
272^^^^^^^^^^^^^^^^^^^^^^^^
273
274.. code-block:: console
275
276 # wget https://github.com/opennetworkinglab/OpenNetworkLinux/releases/download/v1.3.2/ONL-onf-ONLPv2_ONL-OS_2020-10-09.1741-f7428f2_AMD64_INSTALLED_INSTALLER
277 # sh ONL-onf-ONLPv2_ONL-OS_2020-10-09.1741-f7428f2_AMD64_INSTALLED_INSTALLER
278
279The switch will reboot automatically once the installer is done.
280
281.. note::
282
283 Alternatively, we can `scp` the ONL installer into ONIE manually.
284
285Setup BMC for remote console access
286-----------------------------------
287Log in to the BMC from ONL by
288
289.. code-block:: console
290
291 # ssh root@192.168.0.1 # pass: 0penBmc
292
293on `usb0` interface.
294
295Once you are in the BMC, run the following commands to setup IP and route (or offer a fixed IP with DHCP)
296
297.. code-block:: console
298
299 # ip addr add 10.92.1.85/24 dev eth0
300 # ip route add default via 10.92.1.1
301
302- `10.92.1.85/24` should be replaced by the actual IP and subnet of the BMC.
303 Note that it should be different from the ONL IP.
304- `10.92.1.1` should be replaced by the actual default gateway.
305
306BMC uses the same ethernet port as ONL management so you should give it an IP address in the same subnet.
307BMC address will preserve during ONL reboot, but won’t be preserved during power outage.
308
309To log in to ONL console from BMC, run
310
311.. code-block:: console
312
313 # /usr/local/bin/sol.sh
314
315If `sol.sh` is unresponsive, please try to restart the mainboard with
316
317.. code-block:: console
318
319 # wedge_power.sh restart
320
321Setup network and host name for ONL
322-----------------------------------
323
324.. code-block:: console
325
326 # hostnamectl set-hostname <host-name>
327
328 # vim.tiny /etc/hosts # update accordingly
329 # cat /etc/hosts # example
330 127.0.0.1 localhost
331 10.92.1.81 menlo-staging-spine-1
332
333 # vim.tiny /etc/network/interfaces.d/ma1 # update accordingly
334 # cat /etc/network/interfaces.d/ma1 # example
335 auto ma1
336 iface ma1 inet static
337 address 10.92.1.81
338 netmask 255.255.255.0
339 gateway 10.92.1.1
340 dns-nameservers 8.8.8.8