blob: ac0d089c855e1675543cc009bd9145c6aeee766e [file] [log] [blame]
Hung-Wei Chiu77c969e2020-10-23 18:13:07 +00001..
2 SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
3 SPDX-License-Identifier: Apache-2.0
4
Hyunsun Moon049b5052021-07-30 12:41:03 -07005Runtime Deployment
6==================
Zack Williams794532a2021-03-18 17:38:36 -07007
Hyunsun Moond12f32b2021-07-30 12:55:00 -07008This section describes how to install and configure Aether Edge Runtime including Kubernetes
9and system level applications listed below.
10
Hyunsun Moona6af4682021-09-06 18:39:14 -070011* `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 Moond12f32b2021-07-30 12:55:00 -070019
Hyunsun Moona6af4682021-09-06 18:39:14 -070020For this, we will be using Aether's GitOps based CI/CD systems and what you will need to do is
Hyunsun Moond12f32b2021-07-30 12:55:00 -070021create patches in Aether GitOps repositories, **aether-pod-configs** and **aether-app-configs**,
Hyunsun Moonbbad67d2021-08-12 00:47:27 -070022to provide cluster and application configurations to the CI/CD systems.
Hyunsun Moon049b5052021-07-30 12:41:03 -070023
24.. attention::
25
Zack Williams1ae109e2021-07-27 11:17:04 -070026 If you skipped VPN bootstrap step and didn't add the deployment jobs for the new edge,
Hyunsun Moon049b5052021-07-30 12:41:03 -070027 go to :ref:`Add deployment jobs <add_deployment_jobs>` step and finish it first
28 before proceeding.
Hyunsun Moon5ca6bfb2020-10-29 22:29:12 -070029
Hyunsun Moona6af4682021-09-06 18:39:14 -070030Prepare System Application Configuration
31----------------------------------------
Zack Williams794532a2021-03-18 17:38:36 -070032
Hyunsun Moona6af4682021-09-06 18:39:14 -070033In this step, you will create system application configurations for the new
34cluster so that the new cluster can start with proper configurations as soon as
35it is deployed. For the K8S application configuration and deployment, Aether leverages
36Rancher's built-in GitOps tool, **Fleet**, and **aether-app-configs** is the
37repository where all Aether applications are defined.
Hyunsun Moon5ca6bfb2020-10-29 22:29:12 -070038
Hyunsun Moona6af4682021-09-06 18:39:14 -070039Most of the Aether system applications listed above do not require cluster
Hyunsun Moon530327a2022-03-04 09:41:39 -080040specific configurations except **uedns**.
41For **uedns**, you will have to manually create custom configurations and
Hyunsun Moonb9c7dde2021-08-01 06:11:08 -070042commit them to aether-app-configs.
Hyunsun Moond12f32b2021-07-30 12:55:00 -070043
Hyunsun Moonb9c7dde2021-08-01 06:11:08 -070044First, download ``aether-app-configs`` if you don't have it already in your development machine.
Hyunsun Moond12f32b2021-07-30 12:55:00 -070045
46.. code-block:: shell
47
Hyunsun Moond12f32b2021-07-30 12:55:00 -070048 $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-app-configs"
49
Zack Williams1ae109e2021-07-27 11:17:04 -070050Configure ``ue-dns``
51""""""""""""""""""""
Hyunsun Moond12f32b2021-07-30 12:55:00 -070052
Zack Williamsb7d45152022-03-11 09:37:34 -070053For UE-DNS, it is required to create a Helm value override file for the new
54cluster. 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
58Be sure to replace ``[ ]`` in the example configuration below to the actual
59edge name and cluster values.
Hyunsun Moond12f32b2021-07-30 12:55:00 -070060
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070061.. code-block:: yaml
Hyunsun Moond12f32b2021-07-30 12:55:00 -070062
Zack Williamsb7d45152022-03-11 09:37:34 -070063 $ cd aether-app-configs/aether-[ environment ]/infra/coredns/overlays
64 $ mkdir [ cluster_name ]
65 $ vi [ cluster_name ]/values.yaml
Hyunsun Moon530327a2022-03-04 09:41:39 -080066 # SPDX-FileCopyrightText: 2022-present Open Networking Foundation <info@opennetworking.org>
Hyunsun Moond12f32b2021-07-30 12:55:00 -070067
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070068 serviceType: ClusterIP
69 service:
Zack Williamsb7d45152022-03-11 09:37:34 -070070 clusterIP: [ next IP address after kube_dns_cluster_ip ]
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070071 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 Williamsb7d45152022-03-11 09:37:34 -070097 name regex (.*)\.aetherproject.net {1}.svc.[ cluster_domain ]
98 answer name (.*)\.svc\.[ cluster_domain ] {1}.aetherproject.net
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070099 - name: forward
Zack Williamsb7d45152022-03-11 09:37:34 -0700100 parameters: . [ kube_dns_cluster_ip ]
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700101 configBlock: |-
Zack Williamsb7d45152022-03-11 09:37:34 -0700102 except kube-system.svc.[ cluster_domain ] aether-sdcore.svc.[cluster domain] tost.svc.[ cluster_domain ]
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700103 - name: cache
104 parameters: 30
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700105
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700106
Hyunsun Moon530327a2022-03-04 09:41:39 -0800107Next, update ``fleet.yaml`` under ``infra/coredns`` so that Fleet can use the custom configuration
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700108you just created when deploying UE-DNS to the cluster.
109
110.. code-block:: yaml
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700111
Zack Williamsb7d45152022-03-11 09:37:34 -0700112 $ cd aether-app-configs/aether-[ environment ]/infra/coredns
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700113 $ vi fleet.yaml
114 # add following block at the end
Zack Williamsb7d45152022-03-11 09:37:34 -0700115 - name: [ cluster_name ]
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700116 clusterSelector:
117 matchLabels:
Zack Williamsb7d45152022-03-11 09:37:34 -0700118 management.cattle.io/cluster-display-name: [ cluster_name ]
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700119 helm:
120 valuesFiles:
Zack Williamsb7d45152022-03-11 09:37:34 -0700121 - overlays/[ cluster_name ]/values.yaml
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700122
123
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700124Submit your changes.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700125
126.. code-block:: shell
127
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700128 $ git status
129 $ git add .
Zack Williamsb7d45152022-03-11 09:37:34 -0700130 $ git commit -m "Add [ cluster_name ] ACE application configs"
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700131 $ git review
132
Hyunsun Moona6af4682021-09-06 18:39:14 -0700133Now, it's ready to deploy K8S.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700134
Hyunsun Moona6af4682021-09-06 18:39:14 -0700135K8S cluster deployment
136----------------------
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700137
Hyunsun Moona6af4682021-09-06 18:39:14 -0700138Download ``aether-pod-configs`` repository if you don't have it already in
139your development machine.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700140
Hyunsun Moona6af4682021-09-06 18:39:14 -0700141.. code-block:: shell
Zack Williams1ae109e2021-07-27 11:17:04 -0700142
Hyunsun Moona6af4682021-09-06 18:39:14 -0700143 $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-pod-configs"
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700144
Hyunsun Moona6af4682021-09-06 18:39:14 -0700145.. attention::
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700146
Hyunsun Moona6af4682021-09-06 18:39:14 -0700147 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 Moon04f9d052021-10-19 00:23:58 -0700149 finish ``cluster_map.tfvars`` update first before proceeding.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700150
Hyunsun Moona6af4682021-09-06 18:39:14 -0700151Run the following commands to automatically generate Terraform configurations needed to
152create a new cluster in `Rancher <https://rancher.aetherproject.org>`_ and add the servers
153and switches to the cluster.
154
155.. code-block:: shell
156
157 # Create ace_cofig.yaml file if you haven't yet
Zack Williamsb7d45152022-03-11 09:37:34 -0700158 $ cd aether-pod-configs/tools
Hyunsun Moona6af4682021-09-06 18:39:14 -0700159 $ cp ace_config.yaml.example ace_config.yaml
160 $ vi ace_config.yaml
161 # Set all values
162
163 $ make runtime
Zack Williamsb7d45152022-03-11 09:37:34 -0700164 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 Moona6af4682021-09-06 18:39:14 -0700171
172.. attention::
173
Zack Williamsb7d45152022-03-11 09:37:34 -0700174 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 Moona6af4682021-09-06 18:39:14 -0700176 roles.
177
178Create a review request.
179
180.. code-block:: shell
181
Hyunsun Moona6af4682021-09-06 18:39:14 -0700182 $ git add .
Zack Williamsb7d45152022-03-11 09:37:34 -0700183 $ git commit -m "Add [ cluster_name ] ACE runtime configs"
Hyunsun Moona6af4682021-09-06 18:39:14 -0700184 $ git review
185
186Once your review request is accepted and merged, Aether CI/CD system starts to deploy K8S.
187Wait until the cluster status changes to **Active** in `Rancher <https://rancher.aetherproject.org>`_.
188It normally takes 10 - 15 minutes depending on the speed of the container images
189download at the edge.
190
191It is also a good idea to check the system pod status after successful K8S deployment.
192To 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.
194Run 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 Moond12f32b2021-07-30 12:55:00 -0700201
202.. attention::
203
Hyunsun Moon35868bc2021-08-11 15:01:13 -0700204 Ignore BESS UPF failure at this point if BESS UPF is enabled.
Hyunsun Moona6af4682021-09-06 18:39:14 -0700205 We'll fix it in :doc:`BESS UPF </edge_deployment/bess_upf_deployment>` step.
Hyunsun Moon2009a192021-10-29 13:46:52 -0700206
207Disable deployment jobs
208-----------------------
209After confirming the K8S cluster is ready, disable the deployment job.
210
211.. code-block:: diff
212
Zack Williamsb7d45152022-03-11 09:37:34 -0700213 $ cd aether-ci-management
Hyunsun Moon2009a192021-10-29 13:46:52 -0700214 $ 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 Williamsb7d45152022-03-11 09:37:34 -0700224 cluster: '[ cluster_name ]'
Hyunsun Moon2009a192021-10-29 13:46:52 -0700225 - disable-job: false
226 - 'cd-pipeline-terraform-postmerge-cluster':
Zack Williamsb7d45152022-03-11 09:37:34 -0700227 cluster: '[ cluster_name ]'
Hyunsun Moon2009a192021-10-29 13:46:52 -0700228 - disable-job: false
229
230Submit your change and wait for the job is updated.