Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 1 | .. |
| 2 | SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 3 | SPDX-License-Identifier: Apache-2.0 |
| 4 | |
Carmelo Cascone | 4398998 | 2021-10-12 00:01:19 -0700 | [diff] [blame] | 5 | .. _deployment_guide: |
| 6 | |
Charles Chan | caebcf3 | 2021-09-20 22:17:52 -0700 | [diff] [blame] | 7 | Deployment Guide |
| 8 | ================ |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 9 | |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 10 | Deployment Overview |
| 11 | ------------------- |
| 12 | SD-Fabric is released with Helm chart and container images. |
| 13 | We recommend using **Kubernetes** and **Helm** to deploy SD-Fabric. |
| 14 | 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] | 15 | |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 16 | 1. **Provision switch** |
| 17 | |
| 18 | We first need to install operating system with Docker and Kubernetes on the bare-metal switches. |
| 19 | |
| 20 | 2. **Prepare switches as special Kubernetes nodes** |
| 21 | |
| 22 | Kubernetes ``label`` and ``taint`` are used to configure switches as special Kubernetes worker nodes. |
| 23 | This is to make sure we deploy Stratum (and only Stratum) on switches. |
| 24 | |
| 25 | 3. **Prepare access credential for SD-Fabric images** |
| 26 | |
| 27 | SD-Fabric images are hosted on an ONF member-only Docker registry. |
| 28 | You need to obtain access token and supply that as part of the Helm value in Step 6. |
| 29 | |
| 30 | 4. **Prepare ONOS network configuration** |
| 31 | |
| 32 | Network configuration defines properties such as switch pipeconf, subnet and VLAN. |
| 33 | |
| 34 | 5. **Prepare Stratum chassis configuration for each switch** |
| 35 | |
| 36 | Chassis config defines switch properties such as port speed and breakout. |
| 37 | |
| 38 | 6. **Install SD-Fabric** using Helm |
| 39 | |
| 40 | Finally, we are going to install SD-Fabric with the information we prepared in Step 1 to 5. |
| 41 | |
| 42 | Step 1: Provision Switches |
| 43 | -------------------------- |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 44 | |
| 45 | We follow Open Network Install Environment(ONIE) way to install Open Network Linux (ONL) image to switch. |
| 46 | To work with the SD-Fabric environment, we have customized the ONL image to support related packages and dependencies. |
| 47 | |
| 48 | Image source file can be found on ONF repository `opennetworkinglab/OpenNetworkLinux <https://github.com/opennetworkinglab/OpenNetworkLinux>`_. |
| 49 | You can also download pre-compiled artifacts from `Github Release page <https://github.com/opennetworkinglab/OpenNetworkLinux/releases>`_ |
| 50 | |
| 51 | |
| 52 | .. note:: |
| 53 | If you're not familiar with ONIE/ONL environment, please check `Getting Started <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/GettingStarted.md>`_ to |
| 54 | see how to install the ONL image to an ONIE supported switch. |
| 55 | |
| 56 | Below is an example about how to install the ONL image. |
| 57 | |
| 58 | 1. Prepare a server which is accessible by the switch and then download the |
| 59 | pre-compiled installer from the release page. |
| 60 | |
| 61 | .. code-block:: |
| 62 | |
| 63 | wget https://github.com/opennetworkinglab/OpenNetworkLinux/releases/download/v1.4.3/ONL-onf-ONLPv2_ONL-OS_2021-07-16.2159-5195444_AMD64_INSTALLED_INSTALLER |
| 64 | python -m http.server 8080 |
| 65 | |
| 66 | 2. Reboot the switch to enter ONIE installation mode |
| 67 | |
| 68 | .. note:: |
| 69 | Please access the switch via BMC or serial console to keep connection during the installation. |
| 70 | |
| 71 | |
| 72 | .. code-block:: |
| 73 | |
| 74 | onl-onie-boot-mode rescue; reboot |
| 75 | |
| 76 | 3. Install ONL installer |
| 77 | |
| 78 | .. code-block:: |
| 79 | |
| 80 | onie-nos-install http://$SERVER_IP:8080/ONL-onf-ONLPv2_ONL-OS_2021-07-16.2159-5195444_AMD64_INSTALLED_INSTALLER |
| 81 | |
| 82 | 4. Setup switch IP and hostname after the installation. |
| 83 | |
| 84 | |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 85 | Step 2: Configure switches as special Kubernetes nodes |
| 86 | ------------------------------------------------------ |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 87 | |
| 88 | Our `ONL <https://github.com/opennetworkinglab/OpenNetworkLinux>`_ version |
| 89 | includes all packages required by running the Kubernetes on top of it. |
| 90 | Once the Kubernetes is ready, the `Stratum <https://opennetworking.org/stratum/>`_ application will be deployed to the switch to manage it. |
| 91 | |
| 92 | Unlike server, switch has less CPU and memory resources and we should avoid |
| 93 | deploying unnecessary workloads into switch. |
| 94 | Besides, the Stratum application should only be deployed to all switches. |
| 95 | |
| 96 | To achieve the above goals, please apply the resources to your Kubernetes cluster. |
| 97 | |
| 98 | 1. Set up Label to all switch node, e.g ``node-role.kubernetes.io=switch`` |
| 99 | 2. Set up Taint with ``NoSchedule`` to all switch node, e.g ``node-role.kubernetes.io=switch:NoSchedule`` |
| 100 | 3. Properly configure the ``NodeSelector`` and ``Toleration`` when deploying Stratum via DaemonSet |
| 101 | |
| 102 | Example of a five nodes Kubernetes cluster, two switches and three servers |
| 103 | |
| 104 | .. code-block:: |
| 105 | |
| 106 | ╰─$ kubectl get node -o custom-columns=NAME:.metadata.name,TAINT:.spec.taints |
| 107 | NAME TAINT |
| 108 | compute1 <none> |
| 109 | compute2 <none> |
| 110 | compute3 <none> |
| 111 | leaf1 [map[effect:NoSchedule key:node-role.kubernetes.io value:switch]] |
| 112 | leaf2 [map[effect:NoSchedule key:node-role.kubernetes.io value:switch]] |
Hung-Wei Chiu | b0232a1 | 2021-10-11 11:17:54 -0700 | [diff] [blame] | 113 | ╰─$ kubectl get nodes -lnode-role.kubernetes.io=switch |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 114 | NAME STATUS ROLES AGE VERSION |
| 115 | leaf1 Ready worker 27d v1.18.8 |
| 116 | leaf2 Ready worker 27d v1.18.8 |
| 117 | |
| 118 | |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 119 | Step 3: Prepare access credential for SD-Fabric images |
| 120 | ------------------------------------------------------ |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 121 | |
| 122 | Container images can be download from ONF self-hosted container registry but you have to gain the access token first. |
| 123 | |
| 124 | 1. Login to `Aether Harbor Registry <https://registry.aetherproject.org/harbor/sign-in?redirect_url=%2Fharbor%2Fprojects>`_ using your ONF Crowd credential, |
| 125 | 2. Select ``User Profile`` drop-down menu in the upper-right corner |
| 126 | 3. Generate the CLI secret and it's the secret token you have to access the container registry via CLI tool. |
| 127 | 4. Login to the container registry with your username and access token |
| 128 | by ``docker login command`` to ensure you can access it. |
| 129 | |
| 130 | .. code-block:: |
| 131 | |
Hung-Wei Chiu | b0232a1 | 2021-10-11 11:17:54 -0700 | [diff] [blame] | 132 | ╰─$ docker login registry.aetherproject.org --username hwchiu |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 133 | Password: |
| 134 | Login Succeeded |
| 135 | |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 136 | Step 4: Prepare ONOS network configuration |
| 137 | ------------------------------------------ |
| 138 | See :ref:`onos_network_config` for instructions |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 139 | |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 140 | Step 5: Prepare Stratum chassis configuration |
| 141 | --------------------------------------------- |
| 142 | See See :ref:`stratum_chassis_config` for instructions |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 143 | |
Hung-Wei Chiu | b0232a1 | 2021-10-11 11:17:54 -0700 | [diff] [blame] | 144 | .. _install_sd_fabric: |
Hung-Wei Chiu | e49ef3e | 2021-10-04 14:13:36 -0700 | [diff] [blame] | 145 | |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 146 | Step 6: Install SD-Fabric with Helm |
| 147 | ----------------------------------- |
Hung-Wei Chiu | b0232a1 | 2021-10-11 11:17:54 -0700 | [diff] [blame] | 148 | |
| 149 | To install SD-Fabric into your Kubernetes cluster, follow instructions |
Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame] | 150 | described on the `SD-Fabric Helm Chart README <https://gerrit.opencord.org/plugins/gitiles/sdfabric-helm-charts/+/HEAD/sdfabric/README.md>`_ |