Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 1 | .. |
| 2 | SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 3 | SPDX-License-Identifier: Apache-2.0 |
| 4 | |
Charles Chan | 770bb61 | 2022-03-02 12:34:04 -0800 | [diff] [blame] | 5 | SD-Fabric Deployment |
| 6 | ==================== |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 7 | |
Zack Williams | 1ae109e | 2021-07-27 11:17:04 -0700 | [diff] [blame] | 8 | Update aether-pod-configs |
| 9 | ------------------------- |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 10 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 11 | ``aether-app-configs`` is a git project hosted on **gerrit.opencord.org** and |
Zack Williams | 1ae109e | 2021-07-27 11:17:04 -0700 | [diff] [blame] | 12 | we placed the following materials in it. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 13 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 14 | - Rancher Fleet's configuration to install SD-Fabric applications on Rancher, |
| 15 | including ONOS, Stratum, Telegraf and PFCP-Agent. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 16 | - Customized configuration for each application (helm values). |
| 17 | - Application specific configuration files, including ONOS network configuration and Stratum chassis config. |
| 18 | |
| 19 | Here is an example folder structure: |
| 20 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 21 | .. code-block:: bash |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 22 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 23 | ╰─$ tree aether-dev/app/onos aether-dev/app/stratum aether-dev/app/pfcp-agent aether-dev/app/telegraf |
| 24 | ├── fleet.yaml |
| 25 | ├── kustomization.yaml |
| 26 | ├── overlays |
| 27 | │ ├── dev-pairedleaves-tucson |
| 28 | │ │ └── values.yaml |
| 29 | │ ├── dev-pdp-menlo |
| 30 | │ │ └── values.yaml |
| 31 | │ └── dev-sdfabric-menlo |
| 32 | │ └── values.yaml |
| 33 | └── registry-sealed-secret.yaml |
| 34 | aether-dev/app/stratum |
| 35 | ├── fleet.yaml |
| 36 | └── overlays |
| 37 | ├── dev-pairedleaves-tucson |
| 38 | │ ├── kustomization.yaml |
| 39 | │ ├── leaf1 |
| 40 | │ ├── leaf2 |
| 41 | │ ├── qos-config-leaf1.yaml |
| 42 | │ ├── qos-config-leaf2.yaml |
| 43 | │ └── values.yaml |
| 44 | └── dev-sdfabric-menlo |
| 45 | ├── kustomization.yaml |
| 46 | ├── menlo-sdfabric-leaf1 |
| 47 | ├── menlo-sdfabric-leaf2 |
| 48 | └── values.yaml |
| 49 | aether-dev/app/pfcp-agent |
| 50 | ├── fleet.yaml |
| 51 | └── overlays |
| 52 | ├── dev-pairedleaves-tucson |
| 53 | │ └── values.yaml |
| 54 | └── dev-sdfabric-menlo |
| 55 | └── values.yaml |
| 56 | aether-dev/app/telegraf |
| 57 | ├── fleet.yaml |
| 58 | └── overlays |
| 59 | ├── dev-pairedleaves-tucson |
| 60 | │ └── values.yaml |
| 61 | └── dev-sdfabric-menlo |
| 62 | └── values.yaml |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 63 | |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 64 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 65 | App folder |
| 66 | """""""""" |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 67 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 68 | Rancher Fleet reads ``fleet.yaml`` to know where to download the Helm Chart manifest and |
| 69 | how to customize the deployment for each target clusters. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 70 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 71 | Here is the example of ``fleet.yaml`` which downloads SD-Fabric(1.0.18) Helm Chart from |
| 72 | **https://charts.aetherproject.org** and then use the **overlays/$cluster_name/values.yaml** |
| 73 | to customize each cluster. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 74 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 75 | .. code-block:: YAML |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 76 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 77 | # SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org> |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 78 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 79 | defaultNamespace: tost |
| 80 | helm: |
| 81 | releaseName: sdfabric |
| 82 | repo: https://charts.aetherproject.org |
| 83 | chart: sdfabric |
| 84 | version: 1.0.18 |
| 85 | helm: |
| 86 | values: |
| 87 | import: |
| 88 | stratum: |
| 89 | enabled: false |
| 90 | targetCustomizations: |
| 91 | - name: dev-sdfabric-menlo |
| 92 | clusterSelector: |
| 93 | matchLabels: |
| 94 | management.cattle.io/cluster-display-name: dev-sdfabric-menlo |
| 95 | helm: |
| 96 | valuesFiles: |
| 97 | - overlays/dev-sdfabric-menlo/values.yaml |
| 98 | - name: dev-pairedleaves-tucson |
| 99 | clusterSelector: |
| 100 | matchLabels: |
| 101 | management.cattle.io/cluster-display-name: dev-pairedleaves-tucson |
| 102 | helm: |
| 103 | valuesFiles: |
| 104 | - overlays/dev-pairedleaves-tucson/values.yaml |
| 105 | - name: dev-pdp-menlo |
| 106 | clusterSelector: |
| 107 | matchLabels: |
| 108 | management.cattle.io/cluster-display-name: dev-pdp-menlo |
| 109 | helm: |
| 110 | valuesFiles: |
| 111 | - overlays/dev-pdp-menlo/values.yaml |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 112 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 113 | |
| 114 | |
| 115 | **values.yaml** used to custom your sdfabric Helm chart values and please check |
Hung-Wei Chiu | 3accfe9 | 2021-11-02 12:23:53 -0700 | [diff] [blame] | 116 | `SD-Fabric Helm chart <https://gerrit.opencord.org/plugins/gitiles/sdfabric-helm-charts/+/HEAD/sdfabric/README.md>`_ |
| 117 | to see how to configure it. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 118 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 119 | ONOS App |
| 120 | """""""" |
| 121 | |
| 122 | For the ONOS application, the most import configuration is network configuration (netcfg) |
| 123 | which is environment-dependent configuration and you should configure it properly. |
| 124 | |
| 125 | netcfg is configured in the Helm Value files and please check the following example. |
| 126 | |
| 127 | .. code-block:: bash |
| 128 | |
| 129 | ╰─$ cat aether-app-configs/aether-dev/app/onos/overlays/dev-sdfabric-menlo/values.yaml 130 ↵ |
| 130 | # SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org> |
| 131 | |
| 132 | # Value file for SDFabric helm chart. |
| 133 | ... |
| 134 | onos-classic: |
| 135 | config: |
| 136 | componentConfig: |
| 137 | "org.onosproject.net.host.impl.HostManager": > |
| 138 | { |
| 139 | "monitorHosts": "true", |
| 140 | "probeRate": "10000" |
| 141 | } |
| 142 | "org.onosproject.provider.general.device.impl.GeneralDeviceProvider": > |
| 143 | { |
| 144 | "readPortId": true |
| 145 | } |
| 146 | netcfg: > |
| 147 | { |
| 148 | ..... |
| 149 | } |
| 150 | |
| 151 | |
| 152 | |
| 153 | Please check |
| 154 | `SD-Fabric Configuration Guide <https://docs.sd-fabric.org/master/configuration/network.html>`_ |
| 155 | to learn more about network configuration. |
| 156 | |
| 157 | |
| 158 | Stratum App |
| 159 | """"""""""" |
| 160 | |
| 161 | Stratum reads the chassis config from the Kubernetes configmap resource but it doesn't support the function |
| 162 | to dynamically reload the chassis config, which means we have to restart the Stratum pod every time |
| 163 | when we update the chassis config. |
| 164 | |
| 165 | In order to solve this problem without modifying Stratum's source code, we have introduced the Kustomize to |
| 166 | the deployment process. Kustomize supports the function called configMapGenerator which generates the configmap |
| 167 | with a hash suffix in its name and then inject this hash-based name to the spec section of Stratum YAML file. |
| 168 | |
| 169 | See the following example, you can see the configmap name isn't fixed. |
| 170 | |
| 171 | .. code-block: bash |
| 172 | |
| 173 | ╰─$ kc -n tost get daemonset stratum -o json |
| 174 | | jq '.spec.template.spec.volumes | .[] | select(.name == "chassis-config")' |
| 175 | { |
| 176 | "configMap": { |
| 177 | "defaultMode": 484, |
| 178 | "name": "stratum-chassis-configs-7t6tt25654" |
| 179 | }, |
| 180 | "name": "chassis-config" |
| 181 | } |
| 182 | |
| 183 | |
| 184 | From the view of the Kubernetes, when it notices the spec of the YAML file is changed, it will redeploy whole |
| 185 | Stratum application, which means Stratum will read the updated chassis config eventually. |
| 186 | |
| 187 | .. code-block:: bash |
| 188 | |
| 189 | ╰─$ tree aether-dev/app/stratum |
| 190 | ├── fleet.yaml |
| 191 | └── overlays |
| 192 | ├── dev-pairedleaves-tucson |
| 193 | │ ├── kustomization.yaml |
| 194 | │ ├── leaf1 |
| 195 | │ ├── leaf2 |
| 196 | │ ├── qos-config-leaf1.yaml |
| 197 | │ ├── qos-config-leaf2.yaml |
| 198 | │ └── values.yaml |
| 199 | └── dev-sdfabric-menlo |
| 200 | ├── kustomization.yaml |
| 201 | ├── menlo-sdfabric-leaf1 |
| 202 | ├── menlo-sdfabric-leaf2 |
| 203 | └── values.yaml |
| 204 | |
| 205 | ╰─$ cat aether-dev/app/stratum/overlays/dev-pairedleaves-tucson/kustomization.yaml |
| 206 | # SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org> |
| 207 | |
| 208 | configMapGenerator: |
| 209 | - name: stratum-chassis-configs |
| 210 | files: |
| 211 | - leaf1 |
| 212 | - leaf2 |
| 213 | |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 214 | .. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 215 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 216 | Check `SD-Fabric Doc <https://gerrit.opencord.org/plugins/gitiles/sdfabric-helm-charts/+/HEAD/sdfabric/README.md>`_ |
| 217 | to learn how to write the chassis config and don't forget to add the file name into the kustomization.yaml file |
| 218 | once you set up your chassis config. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 219 | |
| 220 | .. attention:: |
| 221 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 222 | The switch-dependent config file should be named as **${hostname}**. |
| 223 | For example, if the host name of your Tofino switch is **my-leaf**, please name config file **my-leaf**. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 224 | |
| 225 | .. |
| 226 | TODO: Add an example based on the recommended topology |
| 227 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 228 | Telegraf App |
| 229 | """""""""""" |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 230 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 231 | Below is the example directory structure of Telegraf application. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 232 | |
| 233 | .. code-block:: |
| 234 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 235 | ╰─$ tree aether-dev/app/telegraf 255 ↵ |
| 236 | aether-dev/app/telegraf |
| 237 | ├── fleet.yaml |
| 238 | └── overlays |
| 239 | ├── dev-pairedleaves-tucson |
| 240 | │ └── values.yaml |
| 241 | └── dev-sdfabric-menlo |
| 242 | └── values.yaml |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 243 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 244 | |
| 245 | The **values.yaml** used to override the ONOS-Telegraf Helm Chart and its environment-dependent. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 246 | Please pay attention to the **inputs.addresses** section. |
| 247 | Telegraf will read data from stratum so we need to specify all Tofino switch’s IP addresses here. |
| 248 | Taking Menlo staging pod as example, there are four switches so we fill out 4 IP addresses. |
| 249 | |
| 250 | .. code-block:: yaml |
| 251 | |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 252 | config: |
| 253 | outputs: |
| 254 | - prometheus_client: |
| 255 | metric_version: 2 |
| 256 | listen: ":9273" |
| 257 | inputs: |
| 258 | - cisco_telemetry_gnmi: |
| 259 | addresses: |
| 260 | - 10.92.1.81:9339 |
| 261 | - 10.92.1.82:9339 |
| 262 | - 10.92.1.83:9339 |
| 263 | - 10.92.1.84:9339 |
| 264 | redial: 10s |
| 265 | - cisco_telemetry_gnmi.subscription: |
| 266 | name: stratum_counters |
| 267 | origin: openconfig-interfaces |
| 268 | path: /interfaces/interface[name=*]/state/counters |
| 269 | sample_interval: 5000ns |
| 270 | subscription_mode: sample |
| 271 | |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 272 | |
| 273 | Create Your Own Configs |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 274 | """"""""""""""""""""""" |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 275 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 276 | Assume we would like to deploy the SD-Fabric to the ace-example cluster in the development environment. |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 277 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 278 | 1. Modify the fleet.yaml to customize your cluster with specific value file. |
| 279 | 2. Add your Helm Values into the overlays folder. |
| 280 | 3. Have to add the chassis config file into the kustomization.yaml for Stratum application. |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 281 | |
| 282 | .. code-block:: console |
| 283 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 284 | ╰─$ git st |
| 285 | On branch master |
| 286 | Your branch is up to date with 'origin/master'. |
| 287 | |
| 288 | Changes to be committed: |
| 289 | (use "git restore --staged <file>..." to unstage) |
| 290 | modified: aether-dev/app/onos/fleet.yaml |
| 291 | new file: aether-dev/app/onos/overlays/dev-my-cluster/values.yaml |
| 292 | modified: aether-dev/app/stratum/fleet.yaml |
| 293 | new file: aether-dev/app/stratum/overlays/dev-my-cluster/kustomization.yaml |
| 294 | new file: aether-dev/app/stratum/overlays/dev-my-cluster/menlo-sdfabric-leaf1 |
| 295 | new file: aether-dev/app/stratum/overlays/dev-my-cluster/menlo-sdfabric-leaf2 |
| 296 | new file: aether-dev/app/stratum/overlays/dev-my-cluster/values.yaml |
| 297 | modified: aether-dev/app/telegraf/fleet.yaml |
| 298 | new file: aether-dev/app/telegraf/overlays/dev-my-cluster/values.yaml |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 299 | |
| 300 | |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 301 | Quick recap |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 302 | """"""""""" |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 303 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 304 | To recap, most of the files in **app** folder can be copied from existing examples. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 305 | However, there are a few files we need to pay extra attentions to. |
| 306 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 307 | - ``fleet.yaml`` in each app folder |
| 308 | - Chassis config in **app/stratum/overlays/$cluster_name/** folder |
Zack Williams | 794532a | 2021-03-18 17:38:36 -0700 | [diff] [blame] | 309 | There should be one chassis config for each switch. The file name needs to be |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 310 | **${hostname}** |
| 311 | - **values.yaml** in **telegraf** folder need to be updated with all switch |
Zack Williams | 794532a | 2021-03-18 17:38:36 -0700 | [diff] [blame] | 312 | IP addresses |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 313 | |
| 314 | Double check these files and make sure they have been updated accordingly. |
| 315 | |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 316 | Create a review request |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 317 | """"""""""""""""""""""" |
| 318 | |
Zack Williams | 794532a | 2021-03-18 17:38:36 -0700 | [diff] [blame] | 319 | We also need to create a gerrit review request, similar to what we have done in |
| 320 | the **Aether Runtime Deployment**. |
| 321 | |
| 322 | Please refer to :doc:`Aether Runtime Deployment <runtime_deployment>` to |
| 323 | create a review request. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 324 | |
Hung-Wei Chiu | 3accfe9 | 2021-11-02 12:23:53 -0700 | [diff] [blame] | 325 | Deploy to ACE cluster |
| 326 | """"""""""""""""""""" |
| 327 | |
| 328 | SD-Fabric is environment dependent application and you have to prepare correct |
| 329 | configurations for both ONOS and Stratum to make it work. |
| 330 | |
Hung-Wei Chiu | 3accfe9 | 2021-11-02 12:23:53 -0700 | [diff] [blame] | 331 | Check below section to learn more about how we setup the Jenkins job and how it works |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 332 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 333 | Create SD-Fabric deployment job in Jenkins |
| 334 | ------------------------------------------ |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 335 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 336 | We have been using the Rancher Fleet to deploy SD-Fabric as the GitOps approach which means every change |
| 337 | we push to the Git repo will be synced to the target cluster automatically. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 338 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 339 | However, ONOS doesn't support the incremental upgrade which means we have to delete all ONOS instance and |
| 340 | then create all instance again every time we want to upgrade ONOS application. |
| 341 | |
| 342 | Rancher Fleet doesn't support the full recreation during the Application upgrade and that's reason we have |
| 343 | created a Jenkins job to recreate the ONOSs application. |
| 344 | |
| 345 | You have to add the Jenkins job for new cluster by modifying ``aether-ci-management`` |
Zack Williams | 794532a | 2021-03-18 17:38:36 -0700 | [diff] [blame] | 346 | |
| 347 | Download the ``aether-ci-management`` repository. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 348 | |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 349 | .. code-block:: shell |
| 350 | |
| 351 | $ cd $WORKDIR |
| 352 | $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-ci-management" |
| 353 | |
| 354 | |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 355 | Create Your Own Jenkins Job |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 356 | """"""""""""""""""""""""""" |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 357 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 358 | Modify jjb/repos/sdfabric.yaml to add your cluster. |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 359 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 360 | For example, we want to deploy the SD-Fabric to our new cluster **my-cluster** which is on the staging environment. |
| 361 | Add the following content into jjb/repo/sdfabric.yaml. |
| 362 | |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 363 | |
| 364 | .. code-block:: yaml |
| 365 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 366 | --- a/jjb/repos/sdfabric.yaml |
| 367 | +++ b/jjb/repos/sdfabric.yaml |
| 368 | @@ -50,6 +50,17 @@ |
| 369 | - "deploy-sdfabric-app": |
| 370 | - "deploy-debug" |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 371 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 372 | +- project: |
| 373 | + name: my-cluster |
| 374 | + disable-job: false |
| 375 | + fleet-workspace: 'aether-dev' |
| 376 | + properties: |
| 377 | + - onf-infra-onfstaff-private |
| 378 | + jobs: |
| 379 | + - "deploy-sdfabric-app": |
| 380 | + - "deploy-debug" |
| 381 | + |
| 382 | + |
Hung-Wei Chiu | f7cadb3 | 2020-11-19 04:49:35 +0000 | [diff] [blame] | 383 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 384 | If your cluster is on the production environment, you have to change both **terraform_env** and **fleet-workspace** |
Hung-Wei Chiu | 3accfe9 | 2021-11-02 12:23:53 -0700 | [diff] [blame] | 385 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 386 | Trigger SD-Fabric deployment in Jenkins |
Hung-Wei Chiu | 6ed7910 | 2021-08-24 14:27:26 -0700 | [diff] [blame] | 387 | --------------------------------------------------------------- |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 388 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 389 | Whenever a change is merged into **aether-app-config**, |
| 390 | the Jenkins job should be triggered automatically to (re)deploy SD-Fabric . |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 391 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 392 | You can also manually trigger the job to redeploy SD-Fabric if needed and below |
| 393 | is an example of default parameters when you run the job. |
| 394 | |
| 395 | .. image:: images/jenkins-sdfabric-params.png |
| 396 | :width: 480px |
| 397 | |
| 398 | |
| 399 | If you want to capture all SD-Fabric related containers logs before redeploying them, |
| 400 | please enable ``POD_LOG`` option. |
| 401 | The Jenkins job helps to redeploy ONOS, Stratum and PFCP-Agent application and the default |
| 402 | options is ONOS and Stratum, you can redeploy what you want by click those ``REDEPLOY_XXXX`` |
| 403 | options. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 404 | |
Charles Chan | 2cb05c7 | 2020-12-09 16:31:20 -0800 | [diff] [blame] | 405 | |
| 406 | Verification |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 407 | ------------ |
| 408 | |
Charles Chan | 2cb05c7 | 2020-12-09 16:31:20 -0800 | [diff] [blame] | 409 | Fabric connectivity should be fully ready at this point. |
| 410 | We should verify that **all servers**, including compute nodes and the management server, |
| 411 | have an IP address and are **able to reach each other via fabric interface** before continuing the next step. |
| 412 | |
| 413 | This can be simply done by running a **ping** command from one server to another server's fabric IP. |
| 414 | |
| 415 | |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 416 | Troubleshooting |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 417 | --------------- |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 418 | |
| 419 | The deployment process involves the following steps: |
| 420 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 421 | 1. Jenkins Job (For ONOS Only) |
| 422 | 2. Rancher Fleet upgrade application based on Git change |
| 423 | 3. Applications be deployed into Kubernetes cluster |
| 424 | 4. ONOS/Stratum will read the configuration (network config, chassis config) |
| 425 | 5. Pod become running |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 426 | |
| 427 | Taking ONOS as an example, here's what you can do to troubleshoot. |
| 428 | |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 429 | You can see the log message of the first step in Jenkins console. |
Charles Chan | 4a10722 | 2020-10-30 17:23:48 -0700 | [diff] [blame] | 430 | If something goes wrong, the status of the Jenkins job will be in red. |
Hung-Wei Chiu | b392a16 | 2022-02-15 11:09:33 -0800 | [diff] [blame] | 431 | If Jenkins doesn't report any error message, the next step is going to Rancher Fleet's |
| 432 | portal to ensure Fleet works as expected. |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 433 | |
| 434 | Accessing the Stratum CLI |
| 435 | """"""""""""""""""""""""" |
| 436 | |
| 437 | You can login to the Stratum container running on a switch using this script: |
| 438 | |
| 439 | .. code-block:: sh |
| 440 | |
| 441 | #!/bin/bash |
| 442 | echo 'Attaching to Stratum container. Ctrl-P Ctrl-Q to exit' |
| 443 | echo 'Press Enter to continue...' |
| 444 | DOCKER_ID=`docker ps | grep stratum-bf | awk '{print $1}'` |
| 445 | docker attach $DOCKER_ID |
| 446 | |
Zack Williams | 1ae109e | 2021-07-27 11:17:04 -0700 | [diff] [blame] | 447 | You should then see the ``bf_sde`` prompt: |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 448 | |
| 449 | .. code-block:: sh |
| 450 | |
| 451 | bf_sde> pm |
| 452 | bf_sde.pm> show -a |
| 453 | |
| 454 | Accessing the ONOS CLI |
| 455 | """""""""""""""""""""" |
| 456 | |
Hung-Wei Chiu | 6ed7910 | 2021-08-24 14:27:26 -0700 | [diff] [blame] | 457 | After setting up kubectl to access the SD-Fabric pods, run: |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 458 | |
| 459 | .. code-block:: sh |
| 460 | |
| 461 | $ kubectl get pods -n tost |
| 462 | |
Hung-Wei Chiu | 6ed7910 | 2021-08-24 14:27:26 -0700 | [diff] [blame] | 463 | Pick a SD-Fabric pod, and make a port forward to it, then login to it with the |
Zack Williams | bcc4c2b | 2021-04-07 16:58:03 -0700 | [diff] [blame] | 464 | ``onos`` CLI tool: |
| 465 | |
| 466 | .. code-block:: sh |
| 467 | |
| 468 | $ kubectl -n tost port-forward onos-tost-onos-classic-0 8181 8101 |
| 469 | $ onos karaf@localhost |
| 470 | |
| 471 | In some rare cases, you may need to access the ONOS master instance CLI, in |
| 472 | which case you can run ``roles``: |
| 473 | |
| 474 | .. code-block:: sh |
| 475 | |
| 476 | karaf@root > roles |
| 477 | device:devswitch1: master=onos-tost-onos-classic-1, standbys=[ onos-tost-onos-classic-0 ] |
| 478 | |
| 479 | Above lines show that ``onos-tost-onos-classic-1`` is the master. So switch to |
| 480 | that by killing the port forward, starting a new one pointing at the master, |
| 481 | then logging into that one: |
| 482 | |
| 483 | .. code-block:: sh |
| 484 | |
| 485 | $ ps ax | grep -i kubectl |
| 486 | # returns kubectl commands running, pick the port-forward one and kill it |
| 487 | $ kill 0123 |
| 488 | $ kubectl -n tost port-forward onos-tost-onos-classic-1 8181 8101 |
| 489 | $ onos karaf@localhost |