Charles Chan | fcfe890 | 2022-02-02 17:06:27 -0800 | [diff] [blame] | 1 | .. SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org> |
| 2 | .. SPDX-License-Identifier: Apache-2.0 |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 3 | |
Carmelo Cascone | 4398998 | 2021-10-12 00:01:19 -0700 | [diff] [blame] | 4 | .. _deployment_guide: |
| 5 | |
Charles Chan | caebcf3 | 2021-09-20 22:17:52 -0700 | [diff] [blame] | 6 | Deployment Guide |
| 7 | ================ |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 8 | |
Charles Chan | b732368 | 2022-03-02 12:33:15 -0800 | [diff] [blame] | 9 | Switch Hardware Selection |
| 10 | ------------------------- |
| 11 | We have verified and therefore recommend using the switch model listed in :ref:`verified_switch`. |
| 12 | Other Stratum-enabled switches listed in :ref:`all_switch` should also work in theory |
| 13 | but more integration work may be required. |
| 14 | |
| 15 | To use the P4 UPF, you must use fabric switches based on the `Intel (formerly Barefoot) Tofino chipset |
| 16 | <https://www.intel.com/content/www/us/en/products/network-io/programmable-ethernet-switch/tofino-series.html>`_. |
| 17 | There are two variants of this switching chipset, with different resources and capabilities. |
| 18 | The **Dual Pipe** Tofino ASIC is less expensive, |
| 19 | while the **Quad Pipe** Tofino ASIC has more chip resources and a faster embedded system with more memory and storage. |
| 20 | |
| 21 | The P4 UPF and SD-Fabric features run within the constraints of the Dual Pipe |
| 22 | system for production deployments, but for development of features in P4, the |
| 23 | larger capacity of the Quad Pipe is desirable. |
| 24 | |
| 25 | These switches feature 32 QSFP+ ports capable of running in 100GbE, 40GbE, or |
| 26 | 4x 10GbE mode (using a split DAC or fiber cable) and have a 1GbE management |
| 27 | network interface. |
| 28 | |
| 29 | See also the :ref:`Rackmount of Equipment |
| 30 | <aether:edge_deployment/site_planning:rackmount of equipment>` for how the Fabric |
| 31 | switches should be rack-mounted to ensure proper airflow within a rack. |
| 32 | |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 33 | Deployment Overview |
| 34 | ------------------- |
| 35 | SD-Fabric is released with Helm chart and container images. |
| 36 | We recommend using **Kubernetes** and **Helm** to deploy SD-Fabric. |
| 37 | Here's a list of high level steps required to deploy SD-Fabric: |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 38 | |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 39 | 1. **Provision switch** |
| 40 | |
| 41 | We first need to install operating system with Docker and Kubernetes on the bare-metal switches. |
| 42 | |
| 43 | 2. **Prepare switches as special Kubernetes nodes** |
| 44 | |
| 45 | Kubernetes ``label`` and ``taint`` are used to configure switches as special Kubernetes worker nodes. |
| 46 | This is to make sure we deploy Stratum (and only Stratum) on switches. |
| 47 | |
Charles Chan | a937f77 | 2022-02-23 16:24:35 -0800 | [diff] [blame] | 48 | 3. **Prepare ONOS network configuration** |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 49 | |
| 50 | Network configuration defines properties such as switch pipeconf, subnet and VLAN. |
| 51 | |
Charles Chan | a937f77 | 2022-02-23 16:24:35 -0800 | [diff] [blame] | 52 | 4. **Prepare Stratum chassis configuration for each switch** |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 53 | |
| 54 | Chassis config defines switch properties such as port speed and breakout. |
| 55 | |
Charles Chan | a937f77 | 2022-02-23 16:24:35 -0800 | [diff] [blame] | 56 | 5. **Install SD-Fabric** using Helm |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 57 | |
| 58 | Finally, we are going to install SD-Fabric with the information we prepared in Step 1 to 5. |
| 59 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 60 | Step 1: Access to the switch console |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 61 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 62 | There are two ways to access the switch console: |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 63 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 64 | * Access via Baseboard Management Controller(BMC) |
| 65 | * Access via console interface |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 66 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 67 | Access via the BMC |
| 68 | ^^^^^^^^^^^^^^^^^^ |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 69 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 70 | For some platforms, you can connect to an embedded system loaded with BMC system. |
| 71 | For example, Wedge100BF series is loaded with OpenBMC system that allows you to connect it via SSH |
| 72 | When the switch started, OpenBMC uses DHCP to initiate it's IP address. You may setting up static DHCP record on |
| 73 | your DHCP server or checkout the DHCP lease file from the DHCP server to get the IP address. |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 74 | |
| 75 | .. code-block:: |
| 76 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 77 | $ ssh root@[Open BMC IP] |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 78 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 79 | The default user and password is `root`` and `0penBmc`. |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 80 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 81 | In the OpenBMC system you can use Serial-over-LAN(sol) to access the main board. |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 82 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 83 | Access via console interface |
| 84 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 85 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 86 | If the platform doesn't support BMC, you can attach your laptop/PC to the switch with a |
| 87 | console cable and use the following command to access it: |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 88 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 89 | .. code-block:: |
Charles Chan | b732368 | 2022-03-02 12:33:15 -0800 | [diff] [blame] | 90 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 91 | $ screen /dev/[console device] [baud rate] |
Charles Chan | b732368 | 2022-03-02 12:33:15 -0800 | [diff] [blame] | 92 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 93 | The `console device` may be vary, it will usually be something like `ttyUSB...`, `tty.usb.....`. |
| 94 | Please checkout the console cable vendor for more information. |
Charles Chan | b732368 | 2022-03-02 12:33:15 -0800 | [diff] [blame] | 95 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 96 | The `baud rate` can also be vary, depends on the switch vendor. |
| 97 | Please checkout the switch user manual or contact vendor to get the information. |
Charles Chan | b732368 | 2022-03-02 12:33:15 -0800 | [diff] [blame] | 98 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 99 | Step 2: Provision Switches |
| 100 | -------------------------- |
Charles Chan | b732368 | 2022-03-02 12:33:15 -0800 | [diff] [blame] | 101 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 102 | We follow Open Network Install Environment (ONIE) way to install SONiC image to switch. |
| 103 | To work with the SD-Fabric environment, we have customized the SONiC image to support related features. |
Charles Chan | b732368 | 2022-03-02 12:33:15 -0800 | [diff] [blame] | 104 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 105 | You can download pre-compiled images from `Github Release page <https://github.com/stratum/sonic-base-image/releases>`_ |
Charles Chan | b732368 | 2022-03-02 12:33:15 -0800 | [diff] [blame] | 106 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 107 | .. note:: |
| 108 | If you're not familiar with ONIE/SONiC environment, please check `Getting Started <https://github.com/sonic-net/SONiC/wiki/Quick-Start>`_ to |
| 109 | see how to install the SONiC to an ONIE supported switch. |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 110 | |
| 111 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 112 | Once SONiC is started on the switch, you need to disable SONiC services before deploy Stratum on it. |
| 113 | Otherwise Stratum containers won't be started. |
| 114 | |
| 115 | .. code-block:: |
| 116 | |
| 117 | admin@sonic$ sudo systemctl stop sonic.target sonic-delayed.taget |
| 118 | admin@sonic$ sudo systemctl disable sonic.target sonic-delayed.taget |
| 119 | |
| 120 | Step 3: Configure switches as special Kubernetes nodes |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 121 | ------------------------------------------------------ |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 122 | |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 123 | Once the Kubernetes is ready, the `Stratum <https://opennetworking.org/stratum/>`_ application will be deployed to the switch to manage it. |
| 124 | |
| 125 | Unlike server, switch has less CPU and memory resources and we should avoid |
| 126 | deploying unnecessary workloads into switch. |
| 127 | Besides, the Stratum application should only be deployed to all switches. |
| 128 | |
| 129 | To achieve the above goals, please apply the resources to your Kubernetes cluster. |
| 130 | |
| 131 | 1. Set up Label to all switch node, e.g ``node-role.kubernetes.io=switch`` |
| 132 | 2. Set up Taint with ``NoSchedule`` to all switch node, e.g ``node-role.kubernetes.io=switch:NoSchedule`` |
| 133 | 3. Properly configure the ``NodeSelector`` and ``Toleration`` when deploying Stratum via DaemonSet |
| 134 | |
| 135 | Example of a five nodes Kubernetes cluster, two switches and three servers |
| 136 | |
| 137 | .. code-block:: |
| 138 | |
| 139 | ╰─$ kubectl get node -o custom-columns=NAME:.metadata.name,TAINT:.spec.taints |
| 140 | NAME TAINT |
| 141 | compute1 <none> |
| 142 | compute2 <none> |
| 143 | compute3 <none> |
| 144 | leaf1 [map[effect:NoSchedule key:node-role.kubernetes.io value:switch]] |
| 145 | leaf2 [map[effect:NoSchedule key:node-role.kubernetes.io value:switch]] |
Hung-Wei Chiu | b0232a1 | 2021-10-11 11:17:54 -0700 | [diff] [blame] | 146 | ╰─$ kubectl get nodes -lnode-role.kubernetes.io=switch |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 147 | NAME STATUS ROLES AGE VERSION |
| 148 | leaf1 Ready worker 27d v1.18.8 |
| 149 | leaf2 Ready worker 27d v1.18.8 |
| 150 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 151 | Step 4: Prepare ONOS network configuration |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 152 | ------------------------------------------ |
| 153 | See :ref:`onos_network_config` for instructions |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 154 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 155 | Step 5: Prepare Stratum chassis configuration |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 156 | --------------------------------------------- |
| 157 | See See :ref:`stratum_chassis_config` for instructions |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 158 | |
Hung-Wei Chiu | b0232a1 | 2021-10-11 11:17:54 -0700 | [diff] [blame] | 159 | .. _install_sd_fabric: |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 160 | |
Tseng, Yi | 83f293e | 2022-08-15 17:55:47 -0700 | [diff] [blame^] | 161 | Step 6: Install SD-Fabric with Helm |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 162 | ----------------------------------- |
Hung-Wei Chiu | b0232a1 | 2021-10-11 11:17:54 -0700 | [diff] [blame] | 163 | |
| 164 | To install SD-Fabric into your Kubernetes cluster, follow instructions |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 165 | described on the `SD-Fabric Helm Chart README <https://gerrit.opencord.org/plugins/gitiles/sdfabric-helm-charts/+/HEAD/sdfabric/README.md>`_ |