Clouder Documentation Release 1.0
Total Page:16
File Type:pdf, Size:1020Kb
Clouder Documentation Release 1.0 Yannick Buron May 15, 2017 Contents 1 Getting Started 3 1.1 Odoo installation.............................................3 1.2 Clouder configuration..........................................4 1.3 Services deployed by the oneclick....................................6 2 Connect to a new node 9 3 Images 13 4 Applications 15 4.1 Application Types............................................ 15 4.2 Application................................................ 16 5 Services 21 6 Domains and Bases 25 6.1 Domains................................................. 25 6.2 Bases................................................... 27 7 Backups and Configuration 31 7.1 Backups................................................. 31 7.2 Configuration............................................... 33 i ii Clouder Documentation, Release 1.0 Contents: Contents 1 Clouder Documentation, Release 1.0 2 Contents CHAPTER 1 Getting Started In this chapter, we’ll see a step by step guide to install a ready-to-use infrastructure. For the example, the base we will create will be another Clouder. Odoo installation This guide will not cover the Odoo installation in itself, we suggest you read the installation documentation on the official website. You can also, and it’s probably the easier way, use an Odoo Docker image like https://hub.docker.com/ _/odoo/ or https://hub.docker.com/r/tecnativa/odoo-base/ Due to the extensive use of ssh, Clouder is only compatible with Linux. Once your Odoo installation is ready, install the paramiko, erppeek and apache-libcloud python libraries (pip install paramiko erppeek apache-libcloud), download the OCA/Connector module on Github and the Clouder modules on Github and add them in your addons directory, then install the clouder module and clouder_template_odoo (this module will install a lot of template dependencies, like postgres, postfix etc...). 3 Clouder Documentation, Release 1.0 Clouder configuration The first thing to do is to set the sysadmin email in the Clouder configuration. You can also configure here how Clouder will deploy the container. You can either use Docker Engine (for single node) or Docker Swarm mode (for multiple node), see Configuration for more information about the settings and actions available in configuration page. Then you have to create a new Environment. An environment shall be seen as a project, this is the object where access right are based upon. All services/bases are linked to an environment, you’ll usually create one for each customers. So first we’ll create the main environment, which will deploy all the core services. 4 Chapter 1. Getting Started Clouder Documentation, Release 1.0 You’ll also need to create a Domain. The first base you’ll deploy will be accessible under this domain. Finally you have to configure the node you want to connect. See how to connect a node for more explanation. 1.2. Clouder configuration 5 Clouder Documentation, Release 1.0 In the node form, click on Test Connection to check there is no problem. Also make sure your node is configured as the DNS nameserver of your domain. If everything is ok, select the Odoo oneclick, assign the critical port and click on deploy to launch the oneclick deploy. This will deploy all on your node all the services you need for your infrastructure, with an example of Odoo service with his database. Keep an eye on your Odoo logs because you’ll see all executed command there, and see if something wrong happen. You can also afterward check the log in the node record to see them. Theses logs can be seen on all objects in Clouder, and are generated each time an action is perform. They are the best way for you to understand how each action work, and see if something wrong happened. Services deployed by the oneclick The oneclick will deploy 5 root services. 6 Chapter 1. Getting Started Clouder Documentation, Release 1.0 • The backup service, which will store your backup. Of course, we suggest you move this service on another node once in production. • The DNS service, which will resolve the DNS record of your infrastructure. You can ei- ther use a bind container on your node for this (deployed by the oneclick), or a cloud provider <http://libcloud.readthedocs.io/en/latest/dns/supported_providers.html>_. • The mail service, which will redirect outgoing and incoming emails from your containers. • The proxy service, which will redirect incoming http request to the correct service. It also take care of https encryption and LetsEncrypt cert generation. • The Odoo/Clouder service, which will deploy the Postgres database and the Odoo service. The example base deploy by the oneclick will be linked to this service. Services has a notion of parent/child, when a root service is deploy it will also deploy all child services. You can see them by removing the root filter. Only children on the lowest level are containers actually deployed on your node. 1.3. Services deployed by the oneclick 7 Clouder Documentation, Release 1.0 Usually a service can contain theses containers/childs : • A Data container, which only represent the volume created for this service. Removing this container means destroying the data. • A Files container, which represent the version of the application you want to deploy. For example for Odoo, this container will contain the files downloaded from Github, of Odoo but also community module you specified. Replace this container with another one when you want to update you service. • An Exec container, which contain the binary executed by this service. The proxy services usually redirect to the http port of this container. This container shall contain no data, it is linked to Data and Files containers, hence you can destroy and rebuilt it at will. • A SSH container, linked to others containers it allow you to give an SSH access to files to your customers, without having to give them access to the node itself. Note that you can have several layer of services. For example, the root Odoo services contain PostgreSQL and Odoo children, which themselves have Data/Files/Exec/SSH children. Finally, once all services are deployed, the oneclick will also deploy an example base. This will create a new database on your Odoo service, and will configure it with the credentials and with the modules specified in application (here the clouder module). It will also configure the links to DNS/Proxy/Mail and generate LetsEncrypt certificate. After the deployment, you shall be able to access your example Odoo instance on the url clouder9.mydomain.com. Congratulations! You can now easily create another base or deploy any other application you can find in the clouder_template_* modules, or even create your own images and applications. 8 Chapter 1. Getting Started CHAPTER 2 Connect to a new node We will see in this chapter how we can configure the nodes and connect them to your Clouder. Clouder is only compatible with Linux, and the Debian distribution is recommended. First, if it’s not already done, you shall install openssh on your server and Docker. In Debian, you just have to execute these commands : For ssh : apt-get install openssh-client For Docker : sudo curl -sSL https://get.docker.com/ | sudo sh You can also follow the official instructions <https://docs.docker.com/engine/installation/>. Then, you need to add the public key of your clouder in the /root/.ssh/authorized_keys file, so Clouder can connect to the server. Root rights are needed for the docker commands. If you don’t have a public key or don’t know how to create one, a public key will be automatically generated when you register the server in your Clouder. And that’s it. Now we can go to the Server menu in Clouder and create a new record. 9 Clouder Documentation, Release 1.0 Here the fields needed : • The prefix domain name used to contact the server. You can only use here lowercase, digit, hyphen and dot. • The domain name used to contact the server. • The server public IP. You can only use here digit and dot. This IP will be used to publish the services to Internet. • The server private IP. You can only use here digit and dot. This IP will be used internally for communication between services deployed by Clouder. • The ssh login user to use. Note you shall make sure this user can use the docker daemon. Otherwise root will be used. • The ssh port to connect to the server. • The environment of the server, define which user can use this server. • The provider field, if you want to use clouder provider. More detail below. • The SSH private and public key to connect to the server. A couple of keys are automatically generated when you create a new record, but you can use your owns. • The ports range for the containers which will be created in this server. When you create a container without specifying an hostport, a new port from this range will be attributed to it. • Assign port with public IP if you want to have several services with the same port on this node, with IP failover. This is interesting with Docker Engine to have several Clouder infrastructure on the same node. Otherwise, the 25/53/80/443 ports of mail/DNS/proxy services will conflicts. This doesn’t work with Docker Swarm mode. • Check the public checkbox if you want all users of the Clouder to be able to use this server. Otherwise, a user can only access a server if he is the manager of this server (or an administrator). When you save the new record, the ssh key will be saved in the system hosting the Clouder so it can connect to the new server. You can check the result of the command in the logs. 10 Chapter 2. Connect to a new node Clouder Documentation, Release 1.0 You have several actions available : • The reinstall action, if you think the ssh key wasn’t correctly installed.