Hung-Wei Chiu | 77c969e | 2020-10-23 18:13:07 +0000 | [diff] [blame] | 1 | .. |
| 2 | SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 3 | SPDX-License-Identifier: Apache-2.0 |
| 4 | |
Hyunsun Moon | 049b505 | 2021-07-30 12:41:03 -0700 | [diff] [blame] | 5 | Runtime Deployment |
| 6 | ================== |
Zack Williams | 794532a | 2021-03-18 17:38:36 -0700 | [diff] [blame] | 7 | |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame^] | 8 | This section describes how to install and configure Aether Edge Runtime including Kubernetes |
| 9 | and system level applications listed below. |
| 10 | |
| 11 | * sealed-secrets |
| 12 | * rancher-monitoring |
| 13 | * fluent-bit |
| 14 | * opendistro-es |
| 15 | * hostpath-provisioner |
| 16 | * edge-maintenance-agent |
| 17 | * sriov-device-plugin |
| 18 | * uedns |
| 19 | |
| 20 | For this, we will be using GitOps based CI/CD systems and what you will need to do is |
| 21 | create patches in Aether GitOps repositories, **aether-pod-configs** and **aether-app-configs**, |
| 22 | to provide the cluster configurations to the CI/CD systems. |
Hyunsun Moon | 049b505 | 2021-07-30 12:41:03 -0700 | [diff] [blame] | 23 | |
| 24 | .. attention:: |
| 25 | |
| 26 | If you skipped VPN bootstap step and didn't add the deployment jobs for the new edge, |
| 27 | go to :ref:`Add deployment jobs <add_deployment_jobs>` step and finish it first |
| 28 | before proceeding. |
Hyunsun Moon | 5ca6bfb | 2020-10-29 22:29:12 -0700 | [diff] [blame] | 29 | |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame^] | 30 | K8S cluster deployment |
| 31 | ---------------------- |
Zack Williams | 794532a | 2021-03-18 17:38:36 -0700 | [diff] [blame] | 32 | |
Hyunsun Moon | 049b505 | 2021-07-30 12:41:03 -0700 | [diff] [blame] | 33 | Download ``aether-pod-configs`` repository if you don't have it already in |
Zack Williams | 794532a | 2021-03-18 17:38:36 -0700 | [diff] [blame] | 34 | your development machine. |
Hyunsun Moon | 5ca6bfb | 2020-10-29 22:29:12 -0700 | [diff] [blame] | 35 | |
| 36 | .. code-block:: shell |
| 37 | |
| 38 | $ cd $WORKDIR |
| 39 | $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-pod-configs" |
| 40 | |
Hyunsun Moon | 5c1e0b0 | 2020-11-20 11:09:00 -0800 | [diff] [blame] | 41 | .. attention:: |
| 42 | |
Hyunsun Moon | 049b505 | 2021-07-30 12:41:03 -0700 | [diff] [blame] | 43 | If you skipped VPN bootstap step and didn't update global resource maps for the new edge, |
| 44 | go to :ref:`Update global resource maps <update_global_resource>` step and |
| 45 | finish ``cluster_map.tfvars`` and ``user_map.tfvars`` update first before proceeding. |
Zack Williams | 794532a | 2021-03-18 17:38:36 -0700 | [diff] [blame] | 46 | |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame^] | 47 | Run the following commands to automatically generate Terraform configurations needed to |
| 48 | create a new cluster in `Rancher <https://rancher.aetherproject.org>`_ and add the servers |
| 49 | and switches to the cluster. |
Hyunsun Moon | 5ca6bfb | 2020-10-29 22:29:12 -0700 | [diff] [blame] | 50 | |
| 51 | .. code-block:: shell |
| 52 | |
Hyunsun Moon | a703edf | 2021-07-29 15:55:15 -0700 | [diff] [blame] | 53 | # Create ace_cofig.yaml file if you haven't yet |
Hyunsun Moon | a79c742 | 2020-11-18 04:52:56 -0800 | [diff] [blame] | 54 | $ cd $WORKDIR/aether-pod-configs/tools |
Hyunsun Moon | a703edf | 2021-07-29 15:55:15 -0700 | [diff] [blame] | 55 | $ cp ace_config.yaml.example ace_config.yaml |
| 56 | $ vi ace_config.yaml |
| 57 | # Set all values |
Hyunsun Moon | 5ca6bfb | 2020-10-29 22:29:12 -0700 | [diff] [blame] | 58 | |
Hyunsun Moon | a79c742 | 2020-11-18 04:52:56 -0800 | [diff] [blame] | 59 | $ make runtime |
Hyunsun Moon | a703edf | 2021-07-29 15:55:15 -0700 | [diff] [blame] | 60 | Created ../production/ace-test/provider.tf |
Hyunsun Moon | 049b505 | 2021-07-30 12:41:03 -0700 | [diff] [blame] | 61 | Created ../production/ace-test/cluster.tf |
Hyunsun Moon | a703edf | 2021-07-29 15:55:15 -0700 | [diff] [blame] | 62 | Created ../production/ace-test/rke-bare-metal.tf |
| 63 | Created ../production/ace-test/addon-manifests.yml.tpl |
| 64 | Created ../production/ace-test/project.tf |
Hyunsun Moon | 049b505 | 2021-07-30 12:41:03 -0700 | [diff] [blame] | 65 | Created ../production/ace-test/member.tf |
| 66 | Created ../production/ace-test/backend.tf |
| 67 | Created ../production/ace-test/cluster_val.tfvars |
Hyunsun Moon | a703edf | 2021-07-29 15:55:15 -0700 | [diff] [blame] | 68 | |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame^] | 69 | Create a review request. |
Zack Williams | 794532a | 2021-03-18 17:38:36 -0700 | [diff] [blame] | 70 | |
Hyunsun Moon | 5ca6bfb | 2020-10-29 22:29:12 -0700 | [diff] [blame] | 71 | .. code-block:: shell |
| 72 | |
Hyunsun Moon | a79c742 | 2020-11-18 04:52:56 -0800 | [diff] [blame] | 73 | $ cd $WORKDIR/aether-pod-configs |
Hyunsun Moon | 5ca6bfb | 2020-10-29 22:29:12 -0700 | [diff] [blame] | 74 | $ git add . |
Hyunsun Moon | a79c742 | 2020-11-18 04:52:56 -0800 | [diff] [blame] | 75 | $ git commit -m "Add test ACE runtime configs" |
Hyunsun Moon | 5ca6bfb | 2020-10-29 22:29:12 -0700 | [diff] [blame] | 76 | $ git review |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame^] | 77 | |
| 78 | Once your review request is accepted and merged, Aether CI/CD system starts to deploy K8S. |
| 79 | Wait until the cluster status changes to **Active** in `Rancher <https://rancher.aetherproject.org>`_. |
| 80 | It normally takes 10 - 15 minutes depending on the speed of the container images |
| 81 | download at the edge. |
| 82 | |
| 83 | System Application Deployment |
| 84 | ----------------------------- |
| 85 | |
| 86 | For the system application deployment, we will be using Rancher's built-in GitOps tool, **Fleet**. |
| 87 | Fleet uses a git repository as a single source of truth to manage applications in the clusters. |
| 88 | For Aether, **aether-app-configs** is the repository for Fleet, where all Aether applications |
| 89 | are configured. |
| 90 | |
| 91 | Most of the Aether system applications do not require cluster specific configurations, |
| 92 | except **rancher-monitoring** and **uedns**. |
| 93 | For these applications, you are required to manually create custom configurations and |
| 94 | commit to aether-app-configs. |
| 95 | |
| 96 | Download ``aether-app-configs`` if you don't have it already in your development machine. |
| 97 | |
| 98 | .. code-block:: shell |
| 99 | |
| 100 | $ cd $WORKDIR |
| 101 | $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-app-configs" |
| 102 | |
| 103 | Configure rancher-monitoring |
| 104 | ############################ |
| 105 | |
| 106 | Open ``fleet.yaml`` under ``infrastructure/rancher-monitoring`` and add a new custom target |
| 107 | with the new cluster name as selector like the example below. |
| 108 | Don't forget to replace ``ace-test`` in the example to the new cluster name. |
| 109 | |
| 110 | .. code-block:: shell |
| 111 | |
| 112 | $ cd $WORKDIR/aether-app-configs/infrastructure/rancher-monitoring |
| 113 | $ vi fleet.yaml |
| 114 | # add following block at the end |
| 115 | - name: ace-eks |
| 116 | clusterSelector: |
| 117 | matchLabels: |
| 118 | management.cattle.io/cluster-display-name: ace-test |
| 119 | helm: |
| 120 | values: |
| 121 | prometheus: |
| 122 | prometheusSpec: |
| 123 | additionalAlertRelabelConfigs: |
| 124 | - source_labels: [__address__] |
| 125 | target_label: cluster |
| 126 | replacement: ace-test |
| 127 | kustomize: |
| 128 | dir: overlays/prd-ace |
| 129 | |
| 130 | .. note:: |
| 131 | |
| 132 | Above step will not be required in Rancher v2.6 as it supports using cluster labels as helm values in a list. |
| 133 | |
| 134 | Configure ue-dns |
| 135 | ################ |
| 136 | |
| 137 | For UE-DNS, you are required to generate a Helm value for the new cluster. |
| 138 | You can use the same ``Makefile`` that you used for generating the runtime configs for this. |
| 139 | |
| 140 | .. code-block:: shell |
| 141 | |
| 142 | $ cd $WORKDIR/aether-app-configs/infrastructure/coredns |
| 143 | $ mkdir overlays/prd-ace-test |
| 144 | |
| 145 | $ cd $WORKDIR/aether-pod-configs/tools |
| 146 | $ make uedns > $WORKDIR/aether-app-configs/infrastructure/coredns/overlays/prd-ace-test/values.yaml |
| 147 | |
| 148 | Update ``fleet.yaml`` under ``infrastructure/coredns`` for the new cluster and specify the Helm values file |
| 149 | you just created. |
| 150 | |
| 151 | .. code-block:: shell |
| 152 | |
| 153 | $ cd $WORKDIR/aether-app-configs/infrastructure/coredns |
| 154 | $ vi fleet.yaml |
| 155 | # add following block at the end |
| 156 | - name: prd-ace-test |
| 157 | clusterSelector: |
| 158 | matchLabels: |
| 159 | management.cattle.io/cluster-display-name: ace-test |
| 160 | helm: |
| 161 | valuesFiles: |
| 162 | - overlays/prd-ace-test/values.yaml |
| 163 | |
| 164 | |
| 165 | Commit your changes. |
| 166 | |
| 167 | .. code-block:: shell |
| 168 | |
| 169 | $ cd $WORKDIR/aether-app-configs |
| 170 | $ git status |
| 171 | $ git add . |
| 172 | $ git commit -m "Add test ACE application configs" |
| 173 | $ git review |
| 174 | |
| 175 | |
| 176 | Assign Fleet workspace |
| 177 | ###################### |
| 178 | |
| 179 | By default, all new clusters are assgiend to a default Fleet workspace called **fleet-default**. |
| 180 | To make a cluster part of Aether and have the applications defined in aether-app-configs deployed, |
| 181 | you must assign the cluster to either **aether-stable** or **aether-alpha** workspace. |
| 182 | For clusters expecting minimal downtime, assign them to **aether-stable**. |
| 183 | For clusters for development or previewing upcoming release, assign them to **aether-alpha**. |
| 184 | |
| 185 | Log in to `Rancher <https://rancher.aetherproject.org>`_ as ``admin`` or ``onfadmin`` user |
| 186 | and go to the **Cluster Explorer**. |
| 187 | In the top left dropdown menu, click **Cluster Explorer > Continuous Delivery**. |
| 188 | |
| 189 | .. image:: images/fleet-move-workspace.png |
| 190 | |
| 191 | |
| 192 | 1) Switch the Fleet workspace to **fleet-default** by selecting it from the drop down menu |
| 193 | in the top menu bar. |
| 194 | 2) Select **Clusters** on the left menu and you'll see the new cluster. |
| 195 | 3) Select the cluster by clicking the checkbox on the left of the cluster name. |
| 196 | 4) Select **Assign to...** button to assign the cluster to the target workspace. |
| 197 | |
| 198 | Switch to the target workspace, click **Clusters** in the left menu, and check the |
| 199 | new cluster exists. |
| 200 | Wait until the cluster state becomes **Active**. |
| 201 | |
| 202 | .. attention:: |
| 203 | |
| 204 | Ignore BESS UPF failure at this point. |