egallery version upgrade
[ealt-edge.git] / ocd / infra / playbooks / README-edgegallery-installation.md
1 # EdgeGallery Ansible Offline Installation\r
2 \r
3 This Guide is for EdgeGallery (EG) installation\r
4 \r
5 The same as online installation, the offline installation is also based on Ubuntu OS and Kubernetes, supports x86_64 and ARM64 as well.\r
6 \r
7 ## 1. The Dependencies and How to Set Nodes\r
8 \r
9   EdgeGallery supports Multi Node and All-In-One (AIO) deployment now.\r
10 \r
11 ### 1.1 AIO Deployment\r
12 \r
13 \r
14 ##  Pre-requisites\r
15 \r
16    One node with below configs\r
17 \r
18   | Module     | Version | Arch            |\r
19   |------------|---------|-----------------|\r
20   | Ubuntu     | 18.04   | ARM 64 & X86_64 |\r
21   | Python     | 3.6.9   | ARM 64 & X86_64 |\r
22   | pip3       | 9.0.1   | ARM 64 & X86_64 |\r
23   | Ansible    | 2.10.7  | ARM 64 & X86_64 |\r
24   | sshpass    | 1.06-1  | ARM 64 & X86_64 |\r
25 \r
26   The Master Node should only install Ubuntu 18.04 and with the following hardware resources:\r
27 \r
28   - 4CPU\r
29   - 16G RAM\r
30   - 100G Storage\r
31   - Single or Multi NIC\r
32 \r
33   INFO: The Ansible controller node and the Master Node could be the same node.\r
34 \r
35   Download and install the pre-requisites mentioned above\r
36 \r
37 ## 2. How to Config the Ansible Controller Node\r
38 \r
39   The commands in the following sections are all executed on  **Ansible controller node**  and there is  **no commands** \r
40   that need to be executed on any other nodes.\r
41 \r
42 ### 2.1 Login Ansible controller node\r
43 \r
44   The Ansible controller node should already install ubuntu 18.04, python3.6 and pip3 in advance.\r
45 \r
46 ### 2.2 Install Ansible: (Can be skipped If installed)\r
47 \r
48   - Ansible Online Installation (Can be skipped If installed)\r
49 \r
50       ```\r
51       # Recommend to install Ansible with python3\r
52       apt install -y python3-pip\r
53       pip3 install ansible\r
54       ```\r
55 \r
56 ### Set password-less ssh from Ansible controller node to other nodes\r
57 \r
58     2.1. sshpass required:\r
59 \r
60     ```\r
61     # Install sshpass\r
62 \r
63     # Check whether sshpass installed\r
64     sshpass -V\r
65 \r
66     ```\r
67 \r
68     2.2 There should be id_rsa and id_rsa.pub under /root/.ssh/, if not, do the following to generate them:\r
69 \r
70     ```\r
71     ssh-keygen -t rsa\r
72     ```\r
73 \r
74     2.3 Do the following to set the password-less ssh, execute the command several times for all master and worker nodes\r
75         one by one where `<master-or-worker-node-ip>` is the private IP and `<master-or-worker-node-root-password>` is\r
76         the password of root user of that node.\r
77 \r
78     ```\r
79     sshpass -p <master-or-worker-node-root-password> ssh-copy-id -o StrictHostKeyChecking=no root@<master-or-worker-node-ip>\r
80     ```\r
81   3. Set hosts-aio\r
82   Open hosts-aio in playbook directory ealt-edge/ocd/infra/playbook and provide master node ip in place of master-ip\r
83 \r
84   - AIO Inventory, replace the exactly master node IP in file `host-aio`:\r
85 \r
86     ```\r
87     [master]\r
88     xxx.xxx.xxx.xxx\r
89     ```\r
90   - If SSH port is not the default value 22, should add some more info about the ssh port\r
91 \r
92     ```\r
93     [master]\r
94     xxx.xxx.xxx.xxx\r
95     [master:vars]\r
96     ansible_ssh_port=xx\r
97 \r
98 ## 3. EdgeGallery Deployment\r
99    \r
100    ```\r
101    # Install edgegallery\r
102    ansible-playbook --inventory hosts-aio ealt-eg-aio-latest.yml -e "ansible_user=root" --extra-vars "operation=install"\r
103 \r
104    ```\r
105 \r
106 ### 3.2. How to Set the Parameters\r
107 \r
108   All parameters that user could set are in file ealtedge/ocd/infra/playbooks/var.yml.\r
109 \r
110   ```\r
111   # Set the Password of Harbor admin account\r
112   HARBOR_ADMIN_PASSWORD: Harbor@edge\r
113 \r
114   # ip for portals, will be set to private IP of master node default or reset it to be the public IP of master node here\r
115   # PORTAL_IP: xxx.xxx.xxx.xxx\r
116 \r
117   # NIC name of master node\r
118   # If master node is with single NIC, not need to set it here and will get the default NIC name during the run time\r
119   # If master node is with multiple NICs, should set it here to be 2 different NICs\r
120   # EG_NODE_EDGE_MP1: eth0\r
121   # EG_NODE_EDGE_MM5: eth0\r
122   ```\r
123 \r
124   Note: No need to modify the above file.  But credentials can be changed in var.yml\r
125 \r
126 ## 5. Uninstall EdgeGallery\r
127 \r
128 AIO mode\r
129 \r
130 ```\r
131 # Uninstall AIO Deployment\r
132 cd ealt-edge/ocd/infra/playbooks\r
133 ansible-playbook --inventory hosts-aio ealt-eg-aio-unins-latest.yml -e "ansible_user=root" --extra-vars "operation=uninstall"\r
134 \r
135 ```