blob: e60366882c1683cbd70ae1a59b9df079f1eef932 [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
110.. code-block:: shell
111
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
137For UE-DNS, you are required to generate a Helm value for the new cluster.
138You can use the same ``Makefile`` that you used for generating the runtime configs for this.
139
140.. code-block:: shell
141
142 $ cd $WORKDIR/aether-app-configs/infrastructure/coredns
143 $ mkdir overlays/prd-ace-test
144
145 $ cd $WORKDIR/aether-pod-configs/tools
146 $ make uedns > $WORKDIR/aether-app-configs/infrastructure/coredns/overlays/prd-ace-test/values.yaml
147
148Update ``fleet.yaml`` under ``infrastructure/coredns`` for the new cluster and specify the Helm values file
149you just created.
150
151.. code-block:: shell
152
153 $ cd $WORKDIR/aether-app-configs/infrastructure/coredns
154 $ vi fleet.yaml
155 # add following block at the end
156 - name: prd-ace-test
157 clusterSelector:
158 matchLabels:
159 management.cattle.io/cluster-display-name: ace-test
160 helm:
161 valuesFiles:
162 - overlays/prd-ace-test/values.yaml
163
164
165Commit your changes.
166
167.. code-block:: shell
168
169 $ cd $WORKDIR/aether-app-configs
170 $ git status
171 $ git add .
172 $ git commit -m "Add test ACE application configs"
173 $ git review
174
175
176Assign Fleet workspace
177######################
178
179By default, all new clusters are assgiend to a default Fleet workspace called **fleet-default**.
180To make a cluster part of Aether and have the applications defined in aether-app-configs deployed,
181you must assign the cluster to either **aether-stable** or **aether-alpha** workspace.
182For clusters expecting minimal downtime, assign them to **aether-stable**.
183For clusters for development or previewing upcoming release, assign them to **aether-alpha**.
184
185Log in to `Rancher <https://rancher.aetherproject.org>`_ as ``admin`` or ``onfadmin`` user
186and go to the **Cluster Explorer**.
187In the top left dropdown menu, click **Cluster Explorer > Continuous Delivery**.
188
189.. image:: images/fleet-move-workspace.png
190
191
1921) Switch the Fleet workspace to **fleet-default** by selecting it from the drop down menu
193 in the top menu bar.
1942) Select **Clusters** on the left menu and you'll see the new cluster.
1953) Select the cluster by clicking the checkbox on the left of the cluster name.
1964) Select **Assign to...** button to assign the cluster to the target workspace.
197
198Switch to the target workspace, click **Clusters** in the left menu, and check the
199new cluster exists.
200Wait until the cluster state becomes **Active**.
201
202.. attention::
203
204 Ignore BESS UPF failure at this point.