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