blob: c55d3aa3a3005e5bfc6bd99f32df9b9392dfe79e [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 Chan2caff7b2021-10-11 20:25:16 -07009Deployment Overview
10-------------------
11SD-Fabric is released with Helm chart and container images.
12We recommend using **Kubernetes** and **Helm** to deploy SD-Fabric.
13Here's a list of high level steps required to deploy SD-Fabric:
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070014
Charles Chan2caff7b2021-10-11 20:25:16 -0700151. **Provision switch**
16
17 We first need to install operating system with Docker and Kubernetes on the bare-metal switches.
18
192. **Prepare switches as special Kubernetes nodes**
20
21 Kubernetes ``label`` and ``taint`` are used to configure switches as special Kubernetes worker nodes.
22 This is to make sure we deploy Stratum (and only Stratum) on switches.
23
Charles Chana937f772022-02-23 16:24:35 -0800243. **Prepare ONOS network configuration**
Charles Chan2caff7b2021-10-11 20:25:16 -070025
26 Network configuration defines properties such as switch pipeconf, subnet and VLAN.
27
Charles Chana937f772022-02-23 16:24:35 -0800284. **Prepare Stratum chassis configuration for each switch**
Charles Chan2caff7b2021-10-11 20:25:16 -070029
30 Chassis config defines switch properties such as port speed and breakout.
31
Charles Chana937f772022-02-23 16:24:35 -0800325. **Install SD-Fabric** using Helm
Charles Chan2caff7b2021-10-11 20:25:16 -070033
34 Finally, we are going to install SD-Fabric with the information we prepared in Step 1 to 5.
35
36Step 1: Provision Switches
37--------------------------
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070038
39We follow Open Network Install Environment(ONIE) way to install Open Network Linux (ONL) image to switch.
40To work with the SD-Fabric environment, we have customized the ONL image to support related packages and dependencies.
41
42Image source file can be found on ONF repository `opennetworkinglab/OpenNetworkLinux <https://github.com/opennetworkinglab/OpenNetworkLinux>`_.
43You can also download pre-compiled artifacts from `Github Release page <https://github.com/opennetworkinglab/OpenNetworkLinux/releases>`_
44
45
46.. note::
47 If you're not familiar with ONIE/ONL environment, please check `Getting Started <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/GettingStarted.md>`_ to
48 see how to install the ONL image to an ONIE supported switch.
49
50Below is an example about how to install the ONL image.
51
521. Prepare a server which is accessible by the switch and then download the
53pre-compiled installer from the release page.
54
55.. code-block::
56
57 wget https://github.com/opennetworkinglab/OpenNetworkLinux/releases/download/v1.4.3/ONL-onf-ONLPv2_ONL-OS_2021-07-16.2159-5195444_AMD64_INSTALLED_INSTALLER
58 python -m http.server 8080
59
602. Reboot the switch to enter ONIE installation mode
61
62.. note::
63 Please access the switch via BMC or serial console to keep connection during the installation.
64
65
66.. code-block::
67
68 onl-onie-boot-mode rescue; reboot
69
703. Install ONL installer
71
72.. code-block::
73
74 onie-nos-install http://$SERVER_IP:8080/ONL-onf-ONLPv2_ONL-OS_2021-07-16.2159-5195444_AMD64_INSTALLED_INSTALLER
75
764. Setup switch IP and hostname after the installation.
77
78
Charles Chan2caff7b2021-10-11 20:25:16 -070079Step 2: Configure switches as special Kubernetes nodes
80------------------------------------------------------
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070081
82Our `ONL <https://github.com/opennetworkinglab/OpenNetworkLinux>`_ version
83includes all packages required by running the Kubernetes on top of it.
84Once the Kubernetes is ready, the `Stratum <https://opennetworking.org/stratum/>`_ application will be deployed to the switch to manage it.
85
86Unlike server, switch has less CPU and memory resources and we should avoid
87deploying unnecessary workloads into switch.
88Besides, the Stratum application should only be deployed to all switches.
89
90To achieve the above goals, please apply the resources to your Kubernetes cluster.
91
921. Set up Label to all switch node, e.g ``node-role.kubernetes.io=switch``
932. Set up Taint with ``NoSchedule`` to all switch node, e.g ``node-role.kubernetes.io=switch:NoSchedule``
943. Properly configure the ``NodeSelector`` and ``Toleration`` when deploying Stratum via DaemonSet
95
96Example of a five nodes Kubernetes cluster, two switches and three servers
97
98.. code-block::
99
100 ╰─$ kubectl get node -o custom-columns=NAME:.metadata.name,TAINT:.spec.taints
101 NAME TAINT
102 compute1 <none>
103 compute2 <none>
104 compute3 <none>
105 leaf1 [map[effect:NoSchedule key:node-role.kubernetes.io value:switch]]
106 leaf2 [map[effect:NoSchedule key:node-role.kubernetes.io value:switch]]
Hung-Wei Chiub0232a12021-10-11 11:17:54 -0700107 ╰─$ kubectl get nodes -lnode-role.kubernetes.io=switch
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700108 NAME STATUS ROLES AGE VERSION
109 leaf1 Ready worker 27d v1.18.8
110 leaf2 Ready worker 27d v1.18.8
111
Charles Chana937f772022-02-23 16:24:35 -0800112Step 3: Prepare ONOS network configuration
Charles Chan2caff7b2021-10-11 20:25:16 -0700113------------------------------------------
114 See :ref:`onos_network_config` for instructions
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700115
Charles Chana937f772022-02-23 16:24:35 -0800116Step 4: Prepare Stratum chassis configuration
Charles Chan2caff7b2021-10-11 20:25:16 -0700117---------------------------------------------
118 See See :ref:`stratum_chassis_config` for instructions
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700119
Hung-Wei Chiub0232a12021-10-11 11:17:54 -0700120.. _install_sd_fabric:
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700121
Charles Chana937f772022-02-23 16:24:35 -0800122Step 5: Install SD-Fabric with Helm
Charles Chan2caff7b2021-10-11 20:25:16 -0700123-----------------------------------
Hung-Wei Chiub0232a12021-10-11 11:17:54 -0700124
125To install SD-Fabric into your Kubernetes cluster, follow instructions
Charles Chan2caff7b2021-10-11 20:25:16 -0700126described on the `SD-Fabric Helm Chart README <https://gerrit.opencord.org/plugins/gitiles/sdfabric-helm-charts/+/HEAD/sdfabric/README.md>`_