blob: 9dc50f979ca55dba2983f28dc944c61c6a891f00 [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
8
9Provision Switches
10------------------
11
12We follow Open Network Install Environment(ONIE) way to install Open Network Linux (ONL) image to switch.
13To work with the SD-Fabric environment, we have customized the ONL image to support related packages and dependencies.
14
15Image source file can be found on ONF repository `opennetworkinglab/OpenNetworkLinux <https://github.com/opennetworkinglab/OpenNetworkLinux>`_.
16You can also download pre-compiled artifacts from `Github Release page <https://github.com/opennetworkinglab/OpenNetworkLinux/releases>`_
17
18
19.. note::
20 If you're not familiar with ONIE/ONL environment, please check `Getting Started <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/GettingStarted.md>`_ to
21 see how to install the ONL image to an ONIE supported switch.
22
23Below is an example about how to install the ONL image.
24
251. Prepare a server which is accessible by the switch and then download the
26pre-compiled installer from the release page.
27
28.. code-block::
29
30 wget https://github.com/opennetworkinglab/OpenNetworkLinux/releases/download/v1.4.3/ONL-onf-ONLPv2_ONL-OS_2021-07-16.2159-5195444_AMD64_INSTALLED_INSTALLER
31 python -m http.server 8080
32
332. Reboot the switch to enter ONIE installation mode
34
35.. note::
36 Please access the switch via BMC or serial console to keep connection during the installation.
37
38
39.. code-block::
40
41 onl-onie-boot-mode rescue; reboot
42
433. Install ONL installer
44
45.. code-block::
46
47 onie-nos-install http://$SERVER_IP:8080/ONL-onf-ONLPv2_ONL-OS_2021-07-16.2159-5195444_AMD64_INSTALLED_INSTALLER
48
494. Setup switch IP and hostname after the installation.
50
51
52Kubernetes Environment
53----------------------
54
55Our `ONL <https://github.com/opennetworkinglab/OpenNetworkLinux>`_ version
56includes all packages required by running the Kubernetes on top of it.
57Once the Kubernetes is ready, the `Stratum <https://opennetworking.org/stratum/>`_ application will be deployed to the switch to manage it.
58
59Unlike server, switch has less CPU and memory resources and we should avoid
60deploying unnecessary workloads into switch.
61Besides, the Stratum application should only be deployed to all switches.
62
63To achieve the above goals, please apply the resources to your Kubernetes cluster.
64
651. Set up Label to all switch node, e.g ``node-role.kubernetes.io=switch``
662. Set up Taint with ``NoSchedule`` to all switch node, e.g ``node-role.kubernetes.io=switch:NoSchedule``
673. Properly configure the ``NodeSelector`` and ``Toleration`` when deploying Stratum via DaemonSet
68
69Example of a five nodes Kubernetes cluster, two switches and three servers
70
71.. code-block::
72
73 ╰─$ kubectl get node -o custom-columns=NAME:.metadata.name,TAINT:.spec.taints
74 NAME TAINT
75 compute1 <none>
76 compute2 <none>
77 compute3 <none>
78 leaf1 [map[effect:NoSchedule key:node-role.kubernetes.io value:switch]]
79 leaf2 [map[effect:NoSchedule key:node-role.kubernetes.io value:switch]]
80 ╰─$ kubectl get nodes -lnode-role.kubernetes.io=switch 130 ↵
81 NAME STATUS ROLES AGE VERSION
82 leaf1 Ready worker 27d v1.18.8
83 leaf2 Ready worker 27d v1.18.8
84
85
86# TODO
87Build Image
88-----------
89
90Fetch Images From Private Registry
91----------------------------------
92
93Container images can be download from ONF self-hosted container registry but you have to gain the access token first.
94
951. Login to `Aether Harbor Registry <https://registry.aetherproject.org/harbor/sign-in?redirect_url=%2Fharbor%2Fprojects>`_ using your ONF Crowd credential,
962. Select ``User Profile`` drop-down menu in the upper-right corner
973. Generate the CLI secret and it's the secret token you have to access the container registry via CLI tool.
984. Login to the container registry with your username and access token
99 by ``docker login command`` to ensure you can access it.
100
101.. code-block::
102
103 ╰─$ docker login registry.aetherproject.org --username hwchiu 255 ↵
104 Password:
105 Login Succeeded
106
107
108Please follow the `Kubernetes official document <https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/>`_ to see how to
109download the image from the private registry with a valid credential
110
111
112# TODO, wait for the umbrella chart
113Install SD-Fabric
114-----------------