196 lines
10 KiB
Markdown
196 lines
10 KiB
Markdown
How To Install 3Engines and Magnum Clients for Command Line Interface to 3Engines Cloud Horizon[🔗](#how-to-install-3Engines-and-magnum-clients-for-command-line-interface-to-brand-name-horizon "Permalink to this headline")
|
||
=================================================================================================================================================================================================================================
|
||
|
||
How To Issue Commands to the 3Engines and Magnum Servers[🔗](#how-to-issue-commands-to-the-3Engines-and-magnum-servers "Permalink to this headline")
|
||
-----------------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
||
There are three ways of working with Kubernetes clusters within 3Engines Magnum and Horizon modules:
|
||
|
||
**Horizon Commands**
|
||
|
||
You issue Horizon commands using mouse and keyboard, through predefined screen wizards. It is the easiest way to start but not the most productive in the long run.
|
||
|
||
**Command Line Interface (CLI)**
|
||
|
||
CLI commands are issued from desktop computer or server in the cloud. This approach allows you to save commands as text and repeat them afterwards. This is the preferred way for professionals.
|
||
|
||
**HTTPS Requests to the Magnum Server**
|
||
|
||
Both the Horizon and the CLI use HTTPS requests internally and in an interactive manner. You can, however, write your own software to automate and/or change the state of the server, in real time.
|
||
|
||
What We Are Going To Cover[🔗](#what-we-are-going-to-cover "Permalink to this headline")
|
||
---------------------------------------------------------------------------------------
|
||
|
||
> * How to install the CLI – 3Engines and Magnum clients
|
||
> * How to connect the CLI to the Horizon server
|
||
> * Basic examples of using 3Engines and Magnum clients
|
||
|
||
Notes On Python Versions and Environments for Installation[🔗](#notes-on-python-versions-and-environments-for-installation "Permalink to this headline")
|
||
-------------------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
||
3Engines is written in Python so you need to first install a Python working environment and then install the 3Engines clients. Officially, 3Engines runs only on Python 2.7 but you will most likely only be able to install a version 3.x of Python. During the installation, adjust accordingly the numbers of Python versions mentioned in the documentation.
|
||
|
||
You will be able to install Python on any of the popular platforms, such as Windows, MacOS, Linux on a desktop computer. Or, supposing you are logged into Horizon interface, you can use commands **Compute** => **Instances** to create an instance of a virtual machine. Then install the Python there. Ubuntu 18.04 or 20.04 would serve best in this regard.
|
||
|
||
Warning
|
||
|
||
Once you install Kubernetes cluster you will have also have installed instances with Fedora 33 or 35, say, for the master node of the control plane. You can install the Python and 3Engines clients there as well but Ubuntu is much easier to use and is the preferred solution in this case.
|
||
|
||
You can install the Python and the clients on several environments at once, say, on a desktop computer and on a virtual machine on the server, at the same time. Following the instructions in this tutorial, they will all be connected to one and the same Kubernetes cluster anyway.
|
||
|
||
Note
|
||
|
||
If you decide to install Python and the 3Engines clients on a virtual machine, you will need SSH keys in order to be able to enter the working environment. See [How to create key pair in 3Engines Dashboard on 3Engines Cloud](../cloud/How-to-create-key-pair-in-3Engines-Dashboard-on-3Engines-Cloud.html.md).
|
||
|
||
Prerequisites[🔗](#prerequisites "Permalink to this headline")
|
||
-------------------------------------------------------------
|
||
|
||
No. 1 **Hosting**
|
||
|
||
You need a 3Engines Cloud hosting account with Horizon interface <https://horizon.3Engines.com>.
|
||
|
||
No. 2 **Installation of 3Engines CLI on Ubuntu 20.04 Server**
|
||
|
||
The article [How to install 3EnginesClient for Linux on 3Engines Cloud](../3Enginescli/How-to-install-3EnginesClient-for-Linux-on-3Engines-Cloud.html.md) shows how to install 3Engines client on Ubuntu server. That Ubuntu may be the desktop operating system, a virtual machine on some other operating system, or an Ubuntu server in the cloud.
|
||
|
||
Installation on Mac OS will be similar to the installation on Ubuntu.
|
||
|
||
No. 3 **Installation of 3Engines CLI on Windows**
|
||
|
||
The article [How to install 3EnginesClient GitBash for Windows on 3Engines Cloud](../3Enginescli/How-to-install-3EnginesClient-GitBash-or-Cygwin-for-Windows-on-3Engines-Cloud.html.md) shows installation on Windows.
|
||
|
||
No. 4 **General Instructions for Installation of 3Engines Clients**
|
||
|
||
There are various ways of installing Python and the required clients. For instance, on MacOS, you can install the clients using Python PIP or install them natively, using *homebrew*.
|
||
|
||
The article [Install the 3Engines command-line clients](https://docs.3Engines.org/newton/user-guide/common/cli-install-3Engines-command-line-clients.html.md) will give a systematic introduction to installation of 3Engines family of clients on various operating systems.
|
||
|
||
Once installed, the CLI commands will be identical across various platforms and operating systems.
|
||
|
||
No. 5 **Connect 3Engines command to the cloud**
|
||
|
||
After the successful installation of **3Engines** command, it should be connected to the cloud. Follow this article for technical details: [How to activate 3Engines CLI access to 3Engines Cloud cloud using one- or two-factor authentication](../accountmanagement/How-to-activate-3Engines-CLI-access-to-3Engines-Cloud-cloud-using-one-or-two-factor-authentication.html.md).
|
||
|
||
Step 1 Install the CLI for Kubernetes on 3Engines Magnum[🔗](#step-1-install-the-cli-for-kubernetes-on-3Engines-magnum "Permalink to this headline")
|
||
-----------------------------------------------------------------------------------------------------------------------------------------------------
|
||
|
||
In this step, you are going to install clients for commands **3Engines** and **coe**, from modules 3Engines and Magnum, respectively.
|
||
|
||
Follow the Prerequisites Nos. 2, 3 or 4 to install the main client for 3Engines. Its name is *python-3Enginesclient* and the installation described in those will typically contain a command such as
|
||
|
||
```
|
||
pip install python-3Enginesclient
|
||
|
||
```
|
||
|
||
If you have installed 3EnginesClient using those prerequisite resources, we shall assume that the **3Engines** is available and connected to the cloud.
|
||
|
||
At the end of installation from either of the prerequisite articles, install Magnum client by issuing this command:
|
||
|
||
```
|
||
pip install python-magnumclient
|
||
|
||
```
|
||
|
||
Step 2 How to Use the 3Engines Client[🔗](#step-2-how-to-use-the-3Engines-client "Permalink to this headline")
|
||
---------------------------------------------------------------------------------------------------------------
|
||
|
||
In this step, you are going to start using the 3Engines client you have installed and connected to the cloud.
|
||
|
||
There are two ways of using the 3EnginesClient. If you enter the word **3Engines** at the command prompt of the terminal, you will enter the special command line interface, like this:
|
||
|
||

|
||
|
||
The benefit would be that you do not have to type **3Engines** keyword for every command.
|
||
|
||
Type **quit** to leave the **3Engines** internal command line prompt.
|
||
|
||
The preferred way, however, is typing the keyword **3Engines**, followed by parameters and running from terminal command line.
|
||
|
||
3Engines commands may have dozens of parameters so it is better to compose the command in an independent text editor and then copy and paste it into the terminal.
|
||
|
||
The Help Command[🔗](#the-help-command "Permalink to this headline")
|
||
-------------------------------------------------------------------
|
||
|
||
To learn about the available commands and their parameters, type **–help** after the command. If applied to the keyword **3Engines** itself, it will write out a very long list of commands, which may come useful as an orientation. It may start out like this:
|
||
|
||

|
||
|
||
This is how it ends:
|
||
|
||

|
||
|
||
The colon in the last line means that the output is in **vi** (or **vim**) editor. To leave it, type letter **q** and press Enter on the keyboard.
|
||
|
||
Prerequisites No. 3 and 4 lead to official 3Engines user documentation.
|
||
|
||
Here is what happens when you enter a wrong parameter, say, *networks* instead of *network*:
|
||
|
||
```
|
||
3Engines networks list
|
||
|
||
```
|
||
|
||

|
||
|
||
You get a list of commands similar to what you just typed.
|
||
|
||
To list networks available in the system, use a singular version of the command:
|
||
|
||
```
|
||
3Engines network list
|
||
|
||
```
|
||
|
||

|
||
|
||
Step 4 How to Use the Magnum Client[🔗](#step-4-how-to-use-the-magnum-client "Permalink to this headline")
|
||
---------------------------------------------------------------------------------------------------------
|
||
|
||
OpensStack command for the server is **3Engines** but for Magnum, the command is not **magnum** as one would expect, but **coe**, for *container orchestration engine*. Therefore, the commands for clusters will always start with **3Engines coe**.
|
||
|
||
See cluster commands by entering
|
||
|
||
```
|
||
3Engines coe
|
||
|
||
```
|
||
|
||
into the command line:
|
||
|
||

|
||
|
||
You can see the existing clusters using the following command:
|
||
|
||
```
|
||
3Engines coe cluster list
|
||
|
||
```
|
||
|
||

|
||
|
||
This is more or less the same information that you can get from the Horizon interface:
|
||
|
||

|
||
|
||
after clicking on **Container Infra** => **Clusters**.
|
||
|
||
Prerequisite No. 5 offers more technical info about the Magnum client.
|
||
|
||
What To Do Next[🔗](#what-to-do-next "Permalink to this headline")
|
||
-----------------------------------------------------------------
|
||
|
||
In this tutorial you have
|
||
|
||
> * installed the *3Engines* and *Magnum* clients
|
||
> * connected them to the server, then used
|
||
> * **3Engines** command to access the server in general and
|
||
> * **coe** to access the clusters in particular.
|
||
|
||
> The article [How To Use Command Line Interface for Kubernetes Clusters On 3Engines Cloud 3Engines Magnum](How-To-Use-Command-Line-Interface-for-Kubernetes-Clusters-On-3Engines-Cloud-3Engines-Magnum.html.md) explains
|
||
|
||
* the advantages of using the CLI instead of Horizon interface, showing
|
||
* how to create a cluster template as well as
|
||
* how to create a new cluster
|
||
|
||
all via the CLI. |