blob: 9463bdf4750fe1d590239dc4a9e9d069fae643c9 [file] [log] [blame]
Charles Chanfcfe8902022-02-02 17:06:27 -08001.. SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org>
2.. SPDX-License-Identifier: Apache-2.0
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -07003
Carmelo Cascone43989982021-10-12 00:01:19 -07004.. _deployment_guide:
5
Charles Chancaebcf32021-09-20 22:17:52 -07006Deployment Guide
7================
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -07008
Charles Chanb7323682022-03-02 12:33:15 -08009Switch Hardware Selection
10-------------------------
11We have verified and therefore recommend using the switch model listed in :ref:`verified_switch`.
12Other Stratum-enabled switches listed in :ref:`all_switch` should also work in theory
13but more integration work may be required.
14
15To 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>`_.
17There are two variants of this switching chipset, with different resources and capabilities.
18The **Dual Pipe** Tofino ASIC is less expensive,
19while the **Quad Pipe** Tofino ASIC has more chip resources and a faster embedded system with more memory and storage.
20
21The P4 UPF and SD-Fabric features run within the constraints of the Dual Pipe
22system for production deployments, but for development of features in P4, the
23larger capacity of the Quad Pipe is desirable.
24
25These switches feature 32 QSFP+ ports capable of running in 100GbE, 40GbE, or
264x 10GbE mode (using a split DAC or fiber cable) and have a 1GbE management
27network interface.
28
29See also the :ref:`Rackmount of Equipment
30<aether:edge_deployment/site_planning:rackmount of equipment>` for how the Fabric
31switches should be rack-mounted to ensure proper airflow within a rack.
32
Charles Chan2caff7b2021-10-11 20:25:16 -070033Deployment Overview
34-------------------
35SD-Fabric is released with Helm chart and container images.
36We recommend using **Kubernetes** and **Helm** to deploy SD-Fabric.
37Here's a list of high level steps required to deploy SD-Fabric:
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070038
Charles Chan2caff7b2021-10-11 20:25:16 -0700391. **Provision switch**
40
41 We first need to install operating system with Docker and Kubernetes on the bare-metal switches.
42
432. **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 Chana937f772022-02-23 16:24:35 -0800483. **Prepare ONOS network configuration**
Charles Chan2caff7b2021-10-11 20:25:16 -070049
50 Network configuration defines properties such as switch pipeconf, subnet and VLAN.
51
Charles Chana937f772022-02-23 16:24:35 -0800524. **Prepare Stratum chassis configuration for each switch**
Charles Chan2caff7b2021-10-11 20:25:16 -070053
54 Chassis config defines switch properties such as port speed and breakout.
55
Charles Chana937f772022-02-23 16:24:35 -0800565. **Install SD-Fabric** using Helm
Charles Chan2caff7b2021-10-11 20:25:16 -070057
58 Finally, we are going to install SD-Fabric with the information we prepared in Step 1 to 5.
59
Tseng, Yi83f293e2022-08-15 17:55:47 -070060Step 1: Access to the switch console
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070061
Tseng, Yi83f293e2022-08-15 17:55:47 -070062There are two ways to access the switch console:
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070063
Tseng, Yi83f293e2022-08-15 17:55:47 -070064 * Access via Baseboard Management Controller(BMC)
65 * Access via console interface
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070066
Tseng, Yi83f293e2022-08-15 17:55:47 -070067Access via the BMC
68^^^^^^^^^^^^^^^^^^
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070069
Tseng, Yi83f293e2022-08-15 17:55:47 -070070For some platforms, you can connect to an embedded system loaded with BMC system.
71For example, Wedge100BF series is loaded with OpenBMC system that allows you to connect it via SSH
72When the switch started, OpenBMC uses DHCP to initiate it's IP address. You may setting up static DHCP record on
73your DHCP server or checkout the DHCP lease file from the DHCP server to get the IP address.
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070074
75.. code-block::
76
Tseng, Yi83f293e2022-08-15 17:55:47 -070077 $ ssh root@[Open BMC IP]
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070078
Tseng, Yi83f293e2022-08-15 17:55:47 -070079The default user and password is `root`` and `0penBmc`.
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070080
Tseng, Yi83f293e2022-08-15 17:55:47 -070081In the OpenBMC system you can use Serial-over-LAN(sol) to access the main board.
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070082
Tseng, Yi83f293e2022-08-15 17:55:47 -070083Access via console interface
84^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070085
Tseng, Yi83f293e2022-08-15 17:55:47 -070086If the platform doesn't support BMC, you can attach your laptop/PC to the switch with a
87console cable and use the following command to access it:
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070088
Tseng, Yi83f293e2022-08-15 17:55:47 -070089.. code-block::
Charles Chanb7323682022-03-02 12:33:15 -080090
Tseng, Yi83f293e2022-08-15 17:55:47 -070091 $ screen /dev/[console device] [baud rate]
Charles Chanb7323682022-03-02 12:33:15 -080092
Tseng, Yi83f293e2022-08-15 17:55:47 -070093The `console device` may be vary, it will usually be something like `ttyUSB...`, `tty.usb.....`.
94Please checkout the console cable vendor for more information.
Charles Chanb7323682022-03-02 12:33:15 -080095
Tseng, Yi83f293e2022-08-15 17:55:47 -070096The `baud rate` can also be vary, depends on the switch vendor.
97Please checkout the switch user manual or contact vendor to get the information.
Charles Chanb7323682022-03-02 12:33:15 -080098
Tseng, Yi83f293e2022-08-15 17:55:47 -070099Step 2: Provision Switches
100--------------------------
Charles Chanb7323682022-03-02 12:33:15 -0800101
Tseng, Yi83f293e2022-08-15 17:55:47 -0700102We follow Open Network Install Environment (ONIE) way to install SONiC image to switch.
103To work with the SD-Fabric environment, we have customized the SONiC image to support related features.
Charles Chanb7323682022-03-02 12:33:15 -0800104
Tseng, Yi83f293e2022-08-15 17:55:47 -0700105You can download pre-compiled images from `Github Release page <https://github.com/stratum/sonic-base-image/releases>`_
Charles Chanb7323682022-03-02 12:33:15 -0800106
Tseng, Yi83f293e2022-08-15 17:55:47 -0700107.. 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 Chiue49ef3e2021-10-04 14:13:36 -0700110
111
Tseng, Yi83f293e2022-08-15 17:55:47 -0700112Once SONiC is started on the switch, you need to disable SONiC services before deploy Stratum on it.
113Otherwise 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
120Step 3: Configure switches as special Kubernetes nodes
Charles Chan2caff7b2021-10-11 20:25:16 -0700121------------------------------------------------------
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700122
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700123Once the Kubernetes is ready, the `Stratum <https://opennetworking.org/stratum/>`_ application will be deployed to the switch to manage it.
124
125Unlike server, switch has less CPU and memory resources and we should avoid
126deploying unnecessary workloads into switch.
127Besides, the Stratum application should only be deployed to all switches.
128
129To achieve the above goals, please apply the resources to your Kubernetes cluster.
130
1311. Set up Label to all switch node, e.g ``node-role.kubernetes.io=switch``
1322. Set up Taint with ``NoSchedule`` to all switch node, e.g ``node-role.kubernetes.io=switch:NoSchedule``
1333. Properly configure the ``NodeSelector`` and ``Toleration`` when deploying Stratum via DaemonSet
134
135Example 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 Chiub0232a12021-10-11 11:17:54 -0700146 ╰─$ kubectl get nodes -lnode-role.kubernetes.io=switch
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700147 NAME STATUS ROLES AGE VERSION
148 leaf1 Ready worker 27d v1.18.8
149 leaf2 Ready worker 27d v1.18.8
150
Tseng, Yi83f293e2022-08-15 17:55:47 -0700151Step 4: Prepare ONOS network configuration
Charles Chan2caff7b2021-10-11 20:25:16 -0700152------------------------------------------
153 See :ref:`onos_network_config` for instructions
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700154
Tseng, Yi83f293e2022-08-15 17:55:47 -0700155Step 5: Prepare Stratum chassis configuration
Charles Chan2caff7b2021-10-11 20:25:16 -0700156---------------------------------------------
157 See See :ref:`stratum_chassis_config` for instructions
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700158
Hung-Wei Chiub0232a12021-10-11 11:17:54 -0700159.. _install_sd_fabric:
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700160
Tseng, Yi83f293e2022-08-15 17:55:47 -0700161Step 6: Install SD-Fabric with Helm
Charles Chan2caff7b2021-10-11 20:25:16 -0700162-----------------------------------
Hung-Wei Chiub0232a12021-10-11 11:17:54 -0700163
164To install SD-Fabric into your Kubernetes cluster, follow instructions
Charles Chan2caff7b2021-10-11 20:25:16 -0700165described on the `SD-Fabric Helm Chart README <https://gerrit.opencord.org/plugins/gitiles/sdfabric-helm-charts/+/HEAD/sdfabric/README.md>`_