blob: 774e3648313b1f0dc4afb5493c3652073742457b [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
48 $ cd $WORKDIR
49 $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-app-configs"
50
Zack Williams1ae109e2021-07-27 11:17:04 -070051Configure ``ue-dns``
52""""""""""""""""""""
Hyunsun Moond12f32b2021-07-30 12:55:00 -070053
Hyunsun Moonb9c7dde2021-08-01 06:11:08 -070054For UE-DNS, it is required to create a Helm values file for the new cluster.
Zack Williams1ae109e2021-07-27 11:17:04 -070055You'll need cluster domain and ``kube-dns`` ClusterIP. Both can be found in
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070056``aether-pod-configs/production/cluster_map.tfvars``.
Hyunsun Moonb9c7dde2021-08-01 06:11:08 -070057Be sure to replace ``[ ]`` in the example configuration below to the actual cluster values.
Hyunsun Moond12f32b2021-07-30 12:55:00 -070058
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070059.. code-block:: yaml
Hyunsun Moond12f32b2021-07-30 12:55:00 -070060
Hyunsun Moon530327a2022-03-04 09:41:39 -080061 $ cd $WORKDIR/aether-app-configs/ace-<cluster group>/infra/coredns
Hyunsun Moond12f32b2021-07-30 12:55:00 -070062 $ mkdir overlays/prd-ace-test
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070063 $ vi overlays/prd-ace-test/values.yaml
Hyunsun Moon530327a2022-03-04 09:41:39 -080064 # SPDX-FileCopyrightText: 2022-present Open Networking Foundation <info@opennetworking.org>
Hyunsun Moond12f32b2021-07-30 12:55:00 -070065
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070066 serviceType: ClusterIP
67 service:
68 clusterIP: [next address of the kube-dns ip]
69 servers:
70 - zones:
71 - zone: .
72 port: 53
73 plugins:
74 - name: errors
75 - name: health
76 configBlock: |-
77 lameduck 5s
78 - name: ready
79 - name: prometheus
80 parameters: 0.0.0.0:9153
81 - name: forward
82 parameters: . /etc/resolv.conf
83 - name: cache
84 parameters: 30
85 - name: loop
86 - name: reload
87 - name: loadbalance
88 - zones:
89 - zone: aetherproject.net
90 port: 53
91 plugins:
92 - name: errors
93 - name: rewrite continue
94 configBlock: |-
95 name regex (.*)\.aetherproject.net {1}.svc.[cluster domain]
96 answer name (.*)\.svc\.[cluster domain] {1}.aetherproject.net
97 - name: forward
98 parameters: . [kube-dns ip]
99 configBlock: |-
100 except kube-system.svc.[cluster domain] aether-sdcore.svc.[cluster domain] tost.svc.[cluster domain]
101 - name: cache
102 parameters: 30
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700103
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700104
Hyunsun Moon530327a2022-03-04 09:41:39 -0800105Next, update ``fleet.yaml`` under ``infra/coredns`` so that Fleet can use the custom configuration
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700106you just created when deploying UE-DNS to the cluster.
107
108.. code-block:: yaml
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700109
Hyunsun Moon530327a2022-03-04 09:41:39 -0800110 $ cd $WORKDIR/aether-app-configs/ace-<cluster group>/infra/coredns
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700111 $ vi fleet.yaml
112 # add following block at the end
113 - name: prd-ace-test
114 clusterSelector:
115 matchLabels:
116 management.cattle.io/cluster-display-name: ace-test
117 helm:
118 valuesFiles:
119 - overlays/prd-ace-test/values.yaml
120
121
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700122Submit your changes.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700123
124.. code-block:: shell
125
126 $ cd $WORKDIR/aether-app-configs
127 $ git status
128 $ git add .
129 $ git commit -m "Add test ACE application configs"
130 $ git review
131
Hyunsun Moona6af4682021-09-06 18:39:14 -0700132Now, it's ready to deploy K8S.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700133
Hyunsun Moona6af4682021-09-06 18:39:14 -0700134K8S cluster deployment
135----------------------
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700136
Hyunsun Moona6af4682021-09-06 18:39:14 -0700137Download ``aether-pod-configs`` repository if you don't have it already in
138your development machine.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700139
Hyunsun Moona6af4682021-09-06 18:39:14 -0700140.. code-block:: shell
Zack Williams1ae109e2021-07-27 11:17:04 -0700141
Hyunsun Moona6af4682021-09-06 18:39:14 -0700142 $ cd $WORKDIR
143 $ 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
158 $ cd $WORKDIR/aether-pod-configs/tools
159 $ cp ace_config.yaml.example ace_config.yaml
160 $ vi ace_config.yaml
161 # Set all values
162
163 $ make runtime
164 Created ../production/ace-test/provider.tf
165 Created ../production/ace-test/cluster.tf
166 Created ../production/ace-test/rke-bare-metal.tf
167 Created ../production/ace-test/addon-manifests.yml.tpl
168 Created ../production/ace-test/project.tf
Hyunsun Moona6af4682021-09-06 18:39:14 -0700169 Created ../production/ace-test/backend.tf
170 Created ../production/ace-test/cluster_val.tfvars
171
172.. attention::
173
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**
176 roles.
177
178Create a review request.
179
180.. code-block:: shell
181
182 $ cd $WORKDIR/aether-pod-configs
183 $ git add .
184 $ git commit -m "Add test ACE runtime configs"
185 $ git review
186
187Once your review request is accepted and merged, Aether CI/CD system starts to deploy K8S.
188Wait until the cluster status changes to **Active** in `Rancher <https://rancher.aetherproject.org>`_.
189It normally takes 10 - 15 minutes depending on the speed of the container images
190download at the edge.
191
192It is also a good idea to check the system pod status after successful K8S deployment.
193To do so, login to Rancher, open the cluster that you just deployed in the **Global** view, and click
194**Launch kubectl** button. You can interact with the cluster using the window that opens.
195Run the following commands and make sure all pods are ``Running``.
196
197.. code-block:: shell
198
199 # Run kubectl commands inside here
200 # e.g. kubectl get all
201 > kubectl get po -A
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700202
203.. attention::
204
Hyunsun Moon35868bc2021-08-11 15:01:13 -0700205 Ignore BESS UPF failure at this point if BESS UPF is enabled.
Hyunsun Moona6af4682021-09-06 18:39:14 -0700206 We'll fix it in :doc:`BESS UPF </edge_deployment/bess_upf_deployment>` step.
Hyunsun Moon2009a192021-10-29 13:46:52 -0700207
208Disable deployment jobs
209-----------------------
210After confirming the K8S cluster is ready, disable the deployment job.
211
212.. code-block:: diff
213
214 $ cd $WORKDIR/aether-ci-management
215 $ vi jjb/repos/cd-pipeline-terraform.yaml
216
217 # Add jobs for the new cluster
218 diff jjb/repos/cd-pipeline-terraform.yamll
219 --- a/jjb/repos/cd-pipeline-terraform.yaml
220 +++ b/jjb/repos/cd-pipeline-terraform.yaml
221 @@ -227,3 +227,9 @@
222 - 'cd-pipeline-terraform-postmerge-cluster':
223 cluster: 'ace-eks'
224 - 'cd-pipeline-terraform-premerge-cluster':
225 cluster: 'ace-test'
226 - disable-job: false
227 - 'cd-pipeline-terraform-postmerge-cluster':
228 cluster: 'ace-test'
229 - disable-job: false
230
231Submit your change and wait for the job is updated.