blob: 6d4b6a080d8f407adc82972f20920c014a5b3f80 [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
243. **Prepare access credential for SD-Fabric images**
25
26 SD-Fabric images are hosted on an ONF member-only Docker registry.
27 You need to obtain access token and supply that as part of the Helm value in Step 6.
28
294. **Prepare ONOS network configuration**
30
31 Network configuration defines properties such as switch pipeconf, subnet and VLAN.
32
335. **Prepare Stratum chassis configuration for each switch**
34
35 Chassis config defines switch properties such as port speed and breakout.
36
376. **Install SD-Fabric** using Helm
38
39 Finally, we are going to install SD-Fabric with the information we prepared in Step 1 to 5.
40
41Step 1: Provision Switches
42--------------------------
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070043
44We follow Open Network Install Environment(ONIE) way to install Open Network Linux (ONL) image to switch.
45To work with the SD-Fabric environment, we have customized the ONL image to support related packages and dependencies.
46
47Image source file can be found on ONF repository `opennetworkinglab/OpenNetworkLinux <https://github.com/opennetworkinglab/OpenNetworkLinux>`_.
48You can also download pre-compiled artifacts from `Github Release page <https://github.com/opennetworkinglab/OpenNetworkLinux/releases>`_
49
50
51.. note::
52 If you're not familiar with ONIE/ONL environment, please check `Getting Started <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/GettingStarted.md>`_ to
53 see how to install the ONL image to an ONIE supported switch.
54
55Below is an example about how to install the ONL image.
56
571. Prepare a server which is accessible by the switch and then download the
58pre-compiled installer from the release page.
59
60.. code-block::
61
62 wget https://github.com/opennetworkinglab/OpenNetworkLinux/releases/download/v1.4.3/ONL-onf-ONLPv2_ONL-OS_2021-07-16.2159-5195444_AMD64_INSTALLED_INSTALLER
63 python -m http.server 8080
64
652. Reboot the switch to enter ONIE installation mode
66
67.. note::
68 Please access the switch via BMC or serial console to keep connection during the installation.
69
70
71.. code-block::
72
73 onl-onie-boot-mode rescue; reboot
74
753. Install ONL installer
76
77.. code-block::
78
79 onie-nos-install http://$SERVER_IP:8080/ONL-onf-ONLPv2_ONL-OS_2021-07-16.2159-5195444_AMD64_INSTALLED_INSTALLER
80
814. Setup switch IP and hostname after the installation.
82
83
Charles Chan2caff7b2021-10-11 20:25:16 -070084Step 2: Configure switches as special Kubernetes nodes
85------------------------------------------------------
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -070086
87Our `ONL <https://github.com/opennetworkinglab/OpenNetworkLinux>`_ version
88includes all packages required by running the Kubernetes on top of it.
89Once the Kubernetes is ready, the `Stratum <https://opennetworking.org/stratum/>`_ application will be deployed to the switch to manage it.
90
91Unlike server, switch has less CPU and memory resources and we should avoid
92deploying unnecessary workloads into switch.
93Besides, the Stratum application should only be deployed to all switches.
94
95To achieve the above goals, please apply the resources to your Kubernetes cluster.
96
971. Set up Label to all switch node, e.g ``node-role.kubernetes.io=switch``
982. Set up Taint with ``NoSchedule`` to all switch node, e.g ``node-role.kubernetes.io=switch:NoSchedule``
993. Properly configure the ``NodeSelector`` and ``Toleration`` when deploying Stratum via DaemonSet
100
101Example of a five nodes Kubernetes cluster, two switches and three servers
102
103.. code-block::
104
105 ╰─$ kubectl get node -o custom-columns=NAME:.metadata.name,TAINT:.spec.taints
106 NAME TAINT
107 compute1 <none>
108 compute2 <none>
109 compute3 <none>
110 leaf1 [map[effect:NoSchedule key:node-role.kubernetes.io value:switch]]
111 leaf2 [map[effect:NoSchedule key:node-role.kubernetes.io value:switch]]
Hung-Wei Chiub0232a12021-10-11 11:17:54 -0700112 ╰─$ kubectl get nodes -lnode-role.kubernetes.io=switch
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700113 NAME STATUS ROLES AGE VERSION
114 leaf1 Ready worker 27d v1.18.8
115 leaf2 Ready worker 27d v1.18.8
116
117
Charles Chan2caff7b2021-10-11 20:25:16 -0700118Step 3: Prepare access credential for SD-Fabric images
119------------------------------------------------------
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700120
121Container images can be download from ONF self-hosted container registry but you have to gain the access token first.
122
1231. Login to `Aether Harbor Registry <https://registry.aetherproject.org/harbor/sign-in?redirect_url=%2Fharbor%2Fprojects>`_ using your ONF Crowd credential,
1242. Select ``User Profile`` drop-down menu in the upper-right corner
1253. Generate the CLI secret and it's the secret token you have to access the container registry via CLI tool.
1264. Login to the container registry with your username and access token
127 by ``docker login command`` to ensure you can access it.
128
129.. code-block::
130
Hung-Wei Chiub0232a12021-10-11 11:17:54 -0700131 ╰─$ docker login registry.aetherproject.org --username hwchiu
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700132 Password:
133 Login Succeeded
134
Charles Chan2caff7b2021-10-11 20:25:16 -0700135Step 4: Prepare ONOS network configuration
136------------------------------------------
137 See :ref:`onos_network_config` for instructions
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700138
Charles Chan2caff7b2021-10-11 20:25:16 -0700139Step 5: Prepare Stratum chassis configuration
140---------------------------------------------
141 See See :ref:`stratum_chassis_config` for instructions
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700142
Hung-Wei Chiub0232a12021-10-11 11:17:54 -0700143.. _install_sd_fabric:
Hung-Wei Chiue49ef3e2021-10-04 14:13:36 -0700144
Charles Chan2caff7b2021-10-11 20:25:16 -0700145Step 6: Install SD-Fabric with Helm
146-----------------------------------
Hung-Wei Chiub0232a12021-10-11 11:17:54 -0700147
148To install SD-Fabric into your Kubernetes cluster, follow instructions
Charles Chan2caff7b2021-10-11 20:25:16 -0700149described on the `SD-Fabric Helm Chart README <https://gerrit.opencord.org/plugins/gitiles/sdfabric-helm-charts/+/HEAD/sdfabric/README.md>`_