blob: 18a6905ee6ff302ba31a07e4609082b95bf5eb1f [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
40specific configurations, except **rancher-monitoring** and **uedns**.
Hyunsun Moonb9c7dde2021-08-01 06:11:08 -070041For these applications, you will have to manually create custom configurations and
42commit 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
51Configure rancher-monitoring
Zack Williams1ae109e2021-07-27 11:17:04 -070052""""""""""""""""""""""""""""
Hyunsun Moond12f32b2021-07-30 12:55:00 -070053
Hyunsun Moonb9c7dde2021-08-01 06:11:08 -070054Open ``fleet.yaml`` under ``infrastructure/rancher-monitoring``, add a custom target
55with the new cluster name as a selector, and provide cluster specific Helm values and
56kustomize overlay directory path like below.
Hyunsun Moond12f32b2021-07-30 12:55:00 -070057
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070058.. code-block:: yaml
Hyunsun Moond12f32b2021-07-30 12:55:00 -070059
60 $ cd $WORKDIR/aether-app-configs/infrastructure/rancher-monitoring
61 $ vi fleet.yaml
62 # add following block at the end
Hyunsun Moonb9c7dde2021-08-01 06:11:08 -070063 - name: ace-test
Hyunsun Moond12f32b2021-07-30 12:55:00 -070064 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 Williams1ae109e2021-07-27 11:17:04 -070082Configure ``ue-dns``
83""""""""""""""""""""
Hyunsun Moond12f32b2021-07-30 12:55:00 -070084
Hyunsun Moonb9c7dde2021-08-01 06:11:08 -070085For UE-DNS, it is required to create a Helm values file for the new cluster.
Zack Williams1ae109e2021-07-27 11:17:04 -070086You'll need cluster domain and ``kube-dns`` ClusterIP. Both can be found in
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070087``aether-pod-configs/production/cluster_map.tfvars``.
Hyunsun Moonb9c7dde2021-08-01 06:11:08 -070088Be sure to replace ``[ ]`` in the example configuration below to the actual cluster values.
Hyunsun Moond12f32b2021-07-30 12:55:00 -070089
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070090.. code-block:: yaml
Hyunsun Moond12f32b2021-07-30 12:55:00 -070091
92 $ cd $WORKDIR/aether-app-configs/infrastructure/coredns
93 $ mkdir overlays/prd-ace-test
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070094 $ vi overlays/prd-ace-test/values.yaml
95 # SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
Hyunsun Moond12f32b2021-07-30 12:55:00 -070096
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -070097 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 Moond12f32b2021-07-30 12:55:00 -0700134
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700135
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700136Next, update ``fleet.yaml`` under ``infrastructure/coredns`` so that Fleet can use the custom configuration
137you just created when deploying UE-DNS to the cluster.
138
139.. code-block:: yaml
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700140
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 Moon2b2bf9a2021-08-01 05:29:48 -0700153Submit your changes.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700154
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 Moona6af4682021-09-06 18:39:14 -0700163Now, it's ready to deploy K8S.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700164
Hyunsun Moona6af4682021-09-06 18:39:14 -0700165K8S cluster deployment
166----------------------
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700167
Hyunsun Moona6af4682021-09-06 18:39:14 -0700168Download ``aether-pod-configs`` repository if you don't have it already in
169your development machine.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700170
Hyunsun Moona6af4682021-09-06 18:39:14 -0700171.. code-block:: shell
Zack Williams1ae109e2021-07-27 11:17:04 -0700172
Hyunsun Moona6af4682021-09-06 18:39:14 -0700173 $ cd $WORKDIR
174 $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-pod-configs"
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700175
Hyunsun Moona6af4682021-09-06 18:39:14 -0700176.. attention::
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700177
Hyunsun Moona6af4682021-09-06 18:39:14 -0700178 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 Moond12f32b2021-07-30 12:55:00 -0700181
Hyunsun Moona6af4682021-09-06 18:39:14 -0700182Run the following commands to automatically generate Terraform configurations needed to
183create a new cluster in `Rancher <https://rancher.aetherproject.org>`_ and add the servers
184and 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
210Create 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
219Once your review request is accepted and merged, Aether CI/CD system starts to deploy K8S.
220Wait until the cluster status changes to **Active** in `Rancher <https://rancher.aetherproject.org>`_.
221It normally takes 10 - 15 minutes depending on the speed of the container images
222download at the edge.
223
224It is also a good idea to check the system pod status after successful K8S deployment.
225To 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.
227Run 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 Moond12f32b2021-07-30 12:55:00 -0700234
235.. attention::
236
Hyunsun Moon35868bc2021-08-11 15:01:13 -0700237 Ignore BESS UPF failure at this point if BESS UPF is enabled.
Hyunsun Moona6af4682021-09-06 18:39:14 -0700238 We'll fix it in :doc:`BESS UPF </edge_deployment/bess_upf_deployment>` step.