blob: 12a0d981c063c2465da4b0807874f87e3b0b94f8 [file] [log] [blame]
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -07001..
2 SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
3 SPDX-License-Identifier: Apache-2.0
4
Carmelo Cascone43989982021-10-12 00:01:19 -07005.. _deployment_guide:
6
Charles Chancaebcf32021-09-20 22:17:52 -07007Deployment Guide
8================
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -07009
Charles Chan2caff7b2021-10-11 20:25:16 -070010Deployment Overview
11-------------------
12SD-Fabric is released with Helm chart and container images.
13We recommend using **Kubernetes** and **Helm** to deploy SD-Fabric.
14Here's a list of high level steps required to deploy SD-Fabric:
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070015
Charles Chan2caff7b2021-10-11 20:25:16 -0700161. **Provision switch**
17
18 We first need to install operating system with Docker and Kubernetes on the bare-metal switches.
19
202. **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
253. **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
304. **Prepare ONOS network configuration**
31
32 Network configuration defines properties such as switch pipeconf, subnet and VLAN.
33
345. **Prepare Stratum chassis configuration for each switch**
35
36 Chassis config defines switch properties such as port speed and breakout.
37
386. **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
42Step 1: Provision Switches
43--------------------------
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070044
45We follow Open Network Install Environment(ONIE) way to install Open Network Linux (ONL) image to switch.
46To work with the SD-Fabric environment, we have customized the ONL image to support related packages and dependencies.
47
48Image source file can be found on ONF repository `opennetworkinglab/OpenNetworkLinux <https://github.com/opennetworkinglab/OpenNetworkLinux>`_.
49You 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
56Below is an example about how to install the ONL image.
57
581. Prepare a server which is accessible by the switch and then download the
59pre-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
662. 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
763. 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
824. Setup switch IP and hostname after the installation.
83
84
Charles Chan2caff7b2021-10-11 20:25:16 -070085Step 2: Configure switches as special Kubernetes nodes
86------------------------------------------------------
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070087
88Our `ONL <https://github.com/opennetworkinglab/OpenNetworkLinux>`_ version
89includes all packages required by running the Kubernetes on top of it.
90Once the Kubernetes is ready, the `Stratum <https://opennetworking.org/stratum/>`_ application will be deployed to the switch to manage it.
91
92Unlike server, switch has less CPU and memory resources and we should avoid
93deploying unnecessary workloads into switch.
94Besides, the Stratum application should only be deployed to all switches.
95
96To achieve the above goals, please apply the resources to your Kubernetes cluster.
97
981. Set up Label to all switch node, e.g ``node-role.kubernetes.io=switch``
992. Set up Taint with ``NoSchedule`` to all switch node, e.g ``node-role.kubernetes.io=switch:NoSchedule``
1003. Properly configure the ``NodeSelector`` and ``Toleration`` when deploying Stratum via DaemonSet
101
102Example 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 Chiub0232a12021-10-11 11:17:54 -0700113 ╰─$ kubectl get nodes -lnode-role.kubernetes.io=switch
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700114 NAME STATUS ROLES AGE VERSION
115 leaf1 Ready worker 27d v1.18.8
116 leaf2 Ready worker 27d v1.18.8
117
118
Charles Chan2caff7b2021-10-11 20:25:16 -0700119Step 3: Prepare access credential for SD-Fabric images
120------------------------------------------------------
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700121
122Container images can be download from ONF self-hosted container registry but you have to gain the access token first.
123
1241. Login to `Aether Harbor Registry <https://registry.aetherproject.org/harbor/sign-in?redirect_url=%2Fharbor%2Fprojects>`_ using your ONF Crowd credential,
1252. Select ``User Profile`` drop-down menu in the upper-right corner
1263. Generate the CLI secret and it's the secret token you have to access the container registry via CLI tool.
1274. 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 Chiub0232a12021-10-11 11:17:54 -0700132 ╰─$ docker login registry.aetherproject.org --username hwchiu
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700133 Password:
134 Login Succeeded
135
Charles Chan2caff7b2021-10-11 20:25:16 -0700136Step 4: Prepare ONOS network configuration
137------------------------------------------
138 See :ref:`onos_network_config` for instructions
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700139
Charles Chan2caff7b2021-10-11 20:25:16 -0700140Step 5: Prepare Stratum chassis configuration
141---------------------------------------------
142 See See :ref:`stratum_chassis_config` for instructions
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700143
Hung-Wei Chiub0232a12021-10-11 11:17:54 -0700144.. _install_sd_fabric:
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700145
Charles Chan2caff7b2021-10-11 20:25:16 -0700146Step 6: Install SD-Fabric with Helm
147-----------------------------------
Hung-Wei Chiub0232a12021-10-11 11:17:54 -0700148
149To install SD-Fabric into your Kubernetes cluster, follow instructions
Charles Chan2caff7b2021-10-11 20:25:16 -0700150described on the `SD-Fabric Helm Chart README <https://gerrit.opencord.org/plugins/gitiles/sdfabric-helm-charts/+/HEAD/sdfabric/README.md>`_