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