blob: b89bad7634bae4c9f7a79378c834596a3dc9f619 [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
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
19
20For this, we will be using GitOps based CI/CD systems and what you will need to do is
21create patches in Aether GitOps repositories, **aether-pod-configs** and **aether-app-configs**,
22to provide the cluster configurations to the CI/CD systems.
Hyunsun Moon049b5052021-07-30 12:41:03 -070023
24.. attention::
25
26 If you skipped VPN bootstap step and didn't add the deployment jobs for the new edge,
27 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 Moond12f32b2021-07-30 12:55:00 -070030K8S cluster deployment
31----------------------
Zack Williams794532a2021-03-18 17:38:36 -070032
Hyunsun Moon049b5052021-07-30 12:41:03 -070033Download ``aether-pod-configs`` repository if you don't have it already in
Zack Williams794532a2021-03-18 17:38:36 -070034your development machine.
Hyunsun Moon5ca6bfb2020-10-29 22:29:12 -070035
36.. code-block:: shell
37
38 $ cd $WORKDIR
39 $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-pod-configs"
40
Hyunsun Moon5c1e0b02020-11-20 11:09:00 -080041.. attention::
42
Hyunsun Moon049b5052021-07-30 12:41:03 -070043 If you skipped VPN bootstap step and didn't update global resource maps for the new edge,
44 go to :ref:`Update global resource maps <update_global_resource>` step and
45 finish ``cluster_map.tfvars`` and ``user_map.tfvars`` update first before proceeding.
Zack Williams794532a2021-03-18 17:38:36 -070046
Hyunsun Moond12f32b2021-07-30 12:55:00 -070047Run the following commands to automatically generate Terraform configurations needed to
48create a new cluster in `Rancher <https://rancher.aetherproject.org>`_ and add the servers
49and switches to the cluster.
Hyunsun Moon5ca6bfb2020-10-29 22:29:12 -070050
51.. code-block:: shell
52
Hyunsun Moona703edf2021-07-29 15:55:15 -070053 # Create ace_cofig.yaml file if you haven't yet
Hyunsun Moona79c7422020-11-18 04:52:56 -080054 $ cd $WORKDIR/aether-pod-configs/tools
Hyunsun Moona703edf2021-07-29 15:55:15 -070055 $ cp ace_config.yaml.example ace_config.yaml
56 $ vi ace_config.yaml
57 # Set all values
Hyunsun Moon5ca6bfb2020-10-29 22:29:12 -070058
Hyunsun Moona79c7422020-11-18 04:52:56 -080059 $ make runtime
Hyunsun Moona703edf2021-07-29 15:55:15 -070060 Created ../production/ace-test/provider.tf
Hyunsun Moon049b5052021-07-30 12:41:03 -070061 Created ../production/ace-test/cluster.tf
Hyunsun Moona703edf2021-07-29 15:55:15 -070062 Created ../production/ace-test/rke-bare-metal.tf
63 Created ../production/ace-test/addon-manifests.yml.tpl
64 Created ../production/ace-test/project.tf
Hyunsun Moon049b5052021-07-30 12:41:03 -070065 Created ../production/ace-test/member.tf
66 Created ../production/ace-test/backend.tf
67 Created ../production/ace-test/cluster_val.tfvars
Hyunsun Moona703edf2021-07-29 15:55:15 -070068
Hyunsun Moond12f32b2021-07-30 12:55:00 -070069Create a review request.
Zack Williams794532a2021-03-18 17:38:36 -070070
Hyunsun Moon5ca6bfb2020-10-29 22:29:12 -070071.. code-block:: shell
72
Hyunsun Moona79c7422020-11-18 04:52:56 -080073 $ cd $WORKDIR/aether-pod-configs
Hyunsun Moon5ca6bfb2020-10-29 22:29:12 -070074 $ git add .
Hyunsun Moona79c7422020-11-18 04:52:56 -080075 $ git commit -m "Add test ACE runtime configs"
Hyunsun Moon5ca6bfb2020-10-29 22:29:12 -070076 $ git review
Hyunsun Moond12f32b2021-07-30 12:55:00 -070077
78Once your review request is accepted and merged, Aether CI/CD system starts to deploy K8S.
79Wait until the cluster status changes to **Active** in `Rancher <https://rancher.aetherproject.org>`_.
80It normally takes 10 - 15 minutes depending on the speed of the container images
81download at the edge.
82
83System Application Deployment
84-----------------------------
85
86For the system application deployment, we will be using Rancher's built-in GitOps tool, **Fleet**.
87Fleet uses a git repository as a single source of truth to manage applications in the clusters.
88For Aether, **aether-app-configs** is the repository for Fleet, where all Aether applications
89are configured.
90
91Most of the Aether system applications do not require cluster specific configurations,
92except **rancher-monitoring** and **uedns**.
93For these applications, you are required to manually create custom configurations and
94commit to aether-app-configs.
95
96Download ``aether-app-configs`` if you don't have it already in your development machine.
97
98.. code-block:: shell
99
100 $ cd $WORKDIR
101 $ git clone "ssh://[username]@gerrit.opencord.org:29418/aether-app-configs"
102
103Configure rancher-monitoring
104############################
105
106Open ``fleet.yaml`` under ``infrastructure/rancher-monitoring`` and add a new custom target
107with the new cluster name as selector like the example below.
108Don't forget to replace ``ace-test`` in the example to the new cluster name.
109
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700110.. code-block:: yaml
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700111
112 $ cd $WORKDIR/aether-app-configs/infrastructure/rancher-monitoring
113 $ vi fleet.yaml
114 # add following block at the end
115 - name: ace-eks
116 clusterSelector:
117 matchLabels:
118 management.cattle.io/cluster-display-name: ace-test
119 helm:
120 values:
121 prometheus:
122 prometheusSpec:
123 additionalAlertRelabelConfigs:
124 - source_labels: [__address__]
125 target_label: cluster
126 replacement: ace-test
127 kustomize:
128 dir: overlays/prd-ace
129
130.. note::
131
132 Above step will not be required in Rancher v2.6 as it supports using cluster labels as helm values in a list.
133
134Configure ue-dns
135################
136
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700137For UE-DNS, you are required to create Helm values for the new cluster.
138You'll need cluster domain and kube-dns ClusterIP address. Both can be found in
139``aether-pod-configs/production/cluster_map.tfvars``.
140Be sure to replace ``[ ]`` in the example configuration below to the actual cluster value.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700141
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700142.. code-block:: yaml
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700143
144 $ cd $WORKDIR/aether-app-configs/infrastructure/coredns
145 $ mkdir overlays/prd-ace-test
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700146 $ vi overlays/prd-ace-test/values.yaml
147 # SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700148
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700149 serviceType: ClusterIP
150 service:
151 clusterIP: [next address of the kube-dns ip]
152 servers:
153 - zones:
154 - zone: .
155 port: 53
156 plugins:
157 - name: errors
158 - name: health
159 configBlock: |-
160 lameduck 5s
161 - name: ready
162 - name: prometheus
163 parameters: 0.0.0.0:9153
164 - name: forward
165 parameters: . /etc/resolv.conf
166 - name: cache
167 parameters: 30
168 - name: loop
169 - name: reload
170 - name: loadbalance
171 - zones:
172 - zone: aetherproject.net
173 port: 53
174 plugins:
175 - name: errors
176 - name: rewrite continue
177 configBlock: |-
178 name regex (.*)\.aetherproject.net {1}.svc.[cluster domain]
179 answer name (.*)\.svc\.[cluster domain] {1}.aetherproject.net
180 - name: forward
181 parameters: . [kube-dns ip]
182 configBlock: |-
183 except kube-system.svc.[cluster domain] aether-sdcore.svc.[cluster domain] tost.svc.[cluster domain]
184 - name: cache
185 parameters: 30
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700186
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700187
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700188Next, update ``fleet.yaml`` under ``infrastructure/coredns`` so that Fleet can use the custom configuration
189you just created when deploying UE-DNS to the cluster.
190
191.. code-block:: yaml
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700192
193 $ cd $WORKDIR/aether-app-configs/infrastructure/coredns
194 $ vi fleet.yaml
195 # add following block at the end
196 - name: prd-ace-test
197 clusterSelector:
198 matchLabels:
199 management.cattle.io/cluster-display-name: ace-test
200 helm:
201 valuesFiles:
202 - overlays/prd-ace-test/values.yaml
203
204
Hyunsun Moon2b2bf9a2021-08-01 05:29:48 -0700205Submit your changes.
Hyunsun Moond12f32b2021-07-30 12:55:00 -0700206
207.. code-block:: shell
208
209 $ cd $WORKDIR/aether-app-configs
210 $ git status
211 $ git add .
212 $ git commit -m "Add test ACE application configs"
213 $ git review
214
215
216Assign Fleet workspace
217######################
218
219By default, all new clusters are assgiend to a default Fleet workspace called **fleet-default**.
220To make a cluster part of Aether and have the applications defined in aether-app-configs deployed,
221you must assign the cluster to either **aether-stable** or **aether-alpha** workspace.
222For clusters expecting minimal downtime, assign them to **aether-stable**.
223For clusters for development or previewing upcoming release, assign them to **aether-alpha**.
224
225Log in to `Rancher <https://rancher.aetherproject.org>`_ as ``admin`` or ``onfadmin`` user
226and go to the **Cluster Explorer**.
227In the top left dropdown menu, click **Cluster Explorer > Continuous Delivery**.
228
229.. image:: images/fleet-move-workspace.png
230
231
2321) Switch the Fleet workspace to **fleet-default** by selecting it from the drop down menu
233 in the top menu bar.
2342) Select **Clusters** on the left menu and you'll see the new cluster.
2353) Select the cluster by clicking the checkbox on the left of the cluster name.
2364) Select **Assign to...** button to assign the cluster to the target workspace.
237
238Switch to the target workspace, click **Clusters** in the left menu, and check the
239new cluster exists.
240Wait until the cluster state becomes **Active**.
241
242.. attention::
243
244 Ignore BESS UPF failure at this point.