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 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 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` |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 19 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 20 | For this, we will be using Aether's GitOps based CI/CD systems and what you will need to do is |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 21 | create patches in Aether GitOps repositories, **aether-pod-configs** and **aether-app-configs**, |
Hyunsun Moon | bbad67d | 2021-08-12 00:47:27 -0700 | [diff] [blame] | 22 | to provide cluster and application configurations to the CI/CD systems. |
Hyunsun Moon | 049b505 | 2021-07-30 12:41:03 -0700 | [diff] [blame] | 23 | |
| 24 | .. attention:: |
| 25 | |
Zack Williams | 1ae109e | 2021-07-27 11:17:04 -0700 | [diff] [blame] | 26 | If you skipped VPN bootstrap step and didn't add the deployment jobs for the new edge, |
Hyunsun Moon | 049b505 | 2021-07-30 12:41:03 -0700 | [diff] [blame] | 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 | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 30 | Prepare System Application Configuration |
| 31 | ---------------------------------------- |
Zack Williams | 794532a | 2021-03-18 17:38:36 -0700 | [diff] [blame] | 32 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 33 | In this step, you will create system application configurations for the new |
| 34 | cluster so that the new cluster can start with proper configurations as soon as |
| 35 | it is deployed. For the K8S application configuration and deployment, Aether leverages |
| 36 | Rancher's built-in GitOps tool, **Fleet**, and **aether-app-configs** is the |
| 37 | repository where all Aether applications are defined. |
Hyunsun Moon | 5ca6bfb | 2020-10-29 22:29:12 -0700 | [diff] [blame] | 38 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 39 | Most of the Aether system applications listed above do not require cluster |
| 40 | specific configurations, except **rancher-monitoring** and **uedns**. |
Hyunsun Moon | b9c7dde | 2021-08-01 06:11:08 -0700 | [diff] [blame] | 41 | For these applications, you will have to manually create custom configurations and |
| 42 | commit them to aether-app-configs. |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 43 | |
Hyunsun Moon | b9c7dde | 2021-08-01 06:11:08 -0700 | [diff] [blame] | 44 | First, download ``aether-app-configs`` if you don't have it already in your development machine. |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 45 | |
| 46 | .. code-block:: shell |
| 47 | |
| 48 | $ cd $WORKDIR |
| 49 | $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-app-configs" |
| 50 | |
| 51 | Configure rancher-monitoring |
Zack Williams | 1ae109e | 2021-07-27 11:17:04 -0700 | [diff] [blame] | 52 | """""""""""""""""""""""""""" |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 53 | |
Hyunsun Moon | b9c7dde | 2021-08-01 06:11:08 -0700 | [diff] [blame] | 54 | Open ``fleet.yaml`` under ``infrastructure/rancher-monitoring``, add a custom target |
| 55 | with the new cluster name as a selector, and provide cluster specific Helm values and |
| 56 | kustomize overlay directory path like below. |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 57 | |
Hyunsun Moon | 2b2bf9a | 2021-08-01 05:29:48 -0700 | [diff] [blame] | 58 | .. code-block:: yaml |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 59 | |
| 60 | $ cd $WORKDIR/aether-app-configs/infrastructure/rancher-monitoring |
| 61 | $ vi fleet.yaml |
| 62 | # add following block at the end |
Hyunsun Moon | b9c7dde | 2021-08-01 06:11:08 -0700 | [diff] [blame] | 63 | - name: ace-test |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 64 | clusterSelector: |
| 65 | matchLabels: |
| 66 | management.cattle.io/cluster-display-name: ace-test |
| 67 | helm: |
| 68 | values: |
| 69 | prometheus: |
| 70 | prometheusSpec: |
| 71 | additionalAlertRelabelConfigs: |
| 72 | - source_labels: [__address__] |
| 73 | target_label: cluster |
| 74 | replacement: ace-test |
| 75 | kustomize: |
| 76 | dir: overlays/prd-ace |
| 77 | |
| 78 | .. note:: |
| 79 | |
| 80 | Above step will not be required in Rancher v2.6 as it supports using cluster labels as helm values in a list. |
| 81 | |
Zack Williams | 1ae109e | 2021-07-27 11:17:04 -0700 | [diff] [blame] | 82 | Configure ``ue-dns`` |
| 83 | """""""""""""""""""" |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 84 | |
Hyunsun Moon | b9c7dde | 2021-08-01 06:11:08 -0700 | [diff] [blame] | 85 | For UE-DNS, it is required to create a Helm values file for the new cluster. |
Zack Williams | 1ae109e | 2021-07-27 11:17:04 -0700 | [diff] [blame] | 86 | You'll need cluster domain and ``kube-dns`` ClusterIP. Both can be found in |
Hyunsun Moon | 2b2bf9a | 2021-08-01 05:29:48 -0700 | [diff] [blame] | 87 | ``aether-pod-configs/production/cluster_map.tfvars``. |
Hyunsun Moon | b9c7dde | 2021-08-01 06:11:08 -0700 | [diff] [blame] | 88 | Be sure to replace ``[ ]`` in the example configuration below to the actual cluster values. |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 89 | |
Hyunsun Moon | 2b2bf9a | 2021-08-01 05:29:48 -0700 | [diff] [blame] | 90 | .. code-block:: yaml |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 91 | |
| 92 | $ cd $WORKDIR/aether-app-configs/infrastructure/coredns |
| 93 | $ mkdir overlays/prd-ace-test |
Hyunsun Moon | 2b2bf9a | 2021-08-01 05:29:48 -0700 | [diff] [blame] | 94 | $ vi overlays/prd-ace-test/values.yaml |
| 95 | # SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org> |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 96 | |
Hyunsun Moon | 2b2bf9a | 2021-08-01 05:29:48 -0700 | [diff] [blame] | 97 | serviceType: ClusterIP |
| 98 | service: |
| 99 | clusterIP: [next address of the kube-dns ip] |
| 100 | servers: |
| 101 | - zones: |
| 102 | - zone: . |
| 103 | port: 53 |
| 104 | plugins: |
| 105 | - name: errors |
| 106 | - name: health |
| 107 | configBlock: |- |
| 108 | lameduck 5s |
| 109 | - name: ready |
| 110 | - name: prometheus |
| 111 | parameters: 0.0.0.0:9153 |
| 112 | - name: forward |
| 113 | parameters: . /etc/resolv.conf |
| 114 | - name: cache |
| 115 | parameters: 30 |
| 116 | - name: loop |
| 117 | - name: reload |
| 118 | - name: loadbalance |
| 119 | - zones: |
| 120 | - zone: aetherproject.net |
| 121 | port: 53 |
| 122 | plugins: |
| 123 | - name: errors |
| 124 | - name: rewrite continue |
| 125 | configBlock: |- |
| 126 | name regex (.*)\.aetherproject.net {1}.svc.[cluster domain] |
| 127 | answer name (.*)\.svc\.[cluster domain] {1}.aetherproject.net |
| 128 | - name: forward |
| 129 | parameters: . [kube-dns ip] |
| 130 | configBlock: |- |
| 131 | except kube-system.svc.[cluster domain] aether-sdcore.svc.[cluster domain] tost.svc.[cluster domain] |
| 132 | - name: cache |
| 133 | parameters: 30 |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 134 | |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 135 | |
Hyunsun Moon | 2b2bf9a | 2021-08-01 05:29:48 -0700 | [diff] [blame] | 136 | Next, update ``fleet.yaml`` under ``infrastructure/coredns`` so that Fleet can use the custom configuration |
| 137 | you just created when deploying UE-DNS to the cluster. |
| 138 | |
| 139 | .. code-block:: yaml |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 140 | |
| 141 | $ cd $WORKDIR/aether-app-configs/infrastructure/coredns |
| 142 | $ vi fleet.yaml |
| 143 | # add following block at the end |
| 144 | - name: prd-ace-test |
| 145 | clusterSelector: |
| 146 | matchLabels: |
| 147 | management.cattle.io/cluster-display-name: ace-test |
| 148 | helm: |
| 149 | valuesFiles: |
| 150 | - overlays/prd-ace-test/values.yaml |
| 151 | |
| 152 | |
Hyunsun Moon | 2b2bf9a | 2021-08-01 05:29:48 -0700 | [diff] [blame] | 153 | Submit your changes. |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 154 | |
| 155 | .. code-block:: shell |
| 156 | |
| 157 | $ cd $WORKDIR/aether-app-configs |
| 158 | $ git status |
| 159 | $ git add . |
| 160 | $ git commit -m "Add test ACE application configs" |
| 161 | $ git review |
| 162 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 163 | Now, it's ready to deploy K8S. |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 164 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 165 | K8S cluster deployment |
| 166 | ---------------------- |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 167 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 168 | Download ``aether-pod-configs`` repository if you don't have it already in |
| 169 | your development machine. |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 170 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 171 | .. code-block:: shell |
Zack Williams | 1ae109e | 2021-07-27 11:17:04 -0700 | [diff] [blame] | 172 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 173 | $ cd $WORKDIR |
| 174 | $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-pod-configs" |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 175 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 176 | .. attention:: |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 177 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 178 | If you skipped VPN bootstrap step and didn't update global resource maps for the new edge, |
| 179 | go to :ref:`Update global resource maps <update_global_resource>` step and |
| 180 | finish ``cluster_map.tfvars`` and ``user_map.tfvars`` update first before proceeding. |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 181 | |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 182 | Run the following commands to automatically generate Terraform configurations needed to |
| 183 | create a new cluster in `Rancher <https://rancher.aetherproject.org>`_ and add the servers |
| 184 | and switches to the cluster. |
| 185 | |
| 186 | .. code-block:: shell |
| 187 | |
| 188 | # Create ace_cofig.yaml file if you haven't yet |
| 189 | $ cd $WORKDIR/aether-pod-configs/tools |
| 190 | $ cp ace_config.yaml.example ace_config.yaml |
| 191 | $ vi ace_config.yaml |
| 192 | # Set all values |
| 193 | |
| 194 | $ make runtime |
| 195 | Created ../production/ace-test/provider.tf |
| 196 | Created ../production/ace-test/cluster.tf |
| 197 | Created ../production/ace-test/rke-bare-metal.tf |
| 198 | Created ../production/ace-test/addon-manifests.yml.tpl |
| 199 | Created ../production/ace-test/project.tf |
| 200 | Created ../production/ace-test/member.tf |
| 201 | Created ../production/ace-test/backend.tf |
| 202 | Created ../production/ace-test/cluster_val.tfvars |
| 203 | |
| 204 | .. attention:: |
| 205 | |
| 206 | If the cluster has an even number of compute nodes, edit **cluster_val.tfvars** |
| 207 | file so that only the odd number of nodes have **etcd** and **controlplane** |
| 208 | roles. |
| 209 | |
| 210 | Create a review request. |
| 211 | |
| 212 | .. code-block:: shell |
| 213 | |
| 214 | $ cd $WORKDIR/aether-pod-configs |
| 215 | $ git add . |
| 216 | $ git commit -m "Add test ACE runtime configs" |
| 217 | $ git review |
| 218 | |
| 219 | Once your review request is accepted and merged, Aether CI/CD system starts to deploy K8S. |
| 220 | Wait until the cluster status changes to **Active** in `Rancher <https://rancher.aetherproject.org>`_. |
| 221 | It normally takes 10 - 15 minutes depending on the speed of the container images |
| 222 | download at the edge. |
| 223 | |
| 224 | It is also a good idea to check the system pod status after successful K8S deployment. |
| 225 | To do so, login to Rancher, open the cluster that you just deployed in the **Global** view, and click |
| 226 | **Launch kubectl** button. You can interact with the cluster using the window that opens. |
| 227 | Run the following commands and make sure all pods are ``Running``. |
| 228 | |
| 229 | .. code-block:: shell |
| 230 | |
| 231 | # Run kubectl commands inside here |
| 232 | # e.g. kubectl get all |
| 233 | > kubectl get po -A |
Hyunsun Moon | d12f32b | 2021-07-30 12:55:00 -0700 | [diff] [blame] | 234 | |
| 235 | .. attention:: |
| 236 | |
Hyunsun Moon | 35868bc | 2021-08-11 15:01:13 -0700 | [diff] [blame] | 237 | Ignore BESS UPF failure at this point if BESS UPF is enabled. |
Hyunsun Moon | a6af468 | 2021-09-06 18:39:14 -0700 | [diff] [blame] | 238 | We'll fix it in :doc:`BESS UPF </edge_deployment/bess_upf_deployment>` step. |