manual, sysadmins, terra
This commit is contained in:
parent
bd835ef00b
commit
982bd66987
@ -65,31 +65,31 @@ We present two different methods to create the Terraform files. In the first met
|
|||||||
Creating the Terraform files is very straightforward. We want to clone the repository `terraform-provider-grid` locally and run some simple commands to properly set and start the deployment.
|
Creating the Terraform files is very straightforward. We want to clone the repository `terraform-provider-grid` locally and run some simple commands to properly set and start the deployment.
|
||||||
|
|
||||||
* Clone the repository `terraform-provider-grid`
|
* Clone the repository `terraform-provider-grid`
|
||||||
* ```
|
```
|
||||||
git clone https://github.com/threefoldtech/terraform-provider-grid
|
git clone https://github.com/threefoldtech/terraform-provider-grid
|
||||||
```
|
```
|
||||||
* Go to the subdirectory containing the examples
|
* Go to the subdirectory containing the examples
|
||||||
* ```
|
```
|
||||||
cd terraform-provider-grid/examples/resources/qsfs
|
cd terraform-provider-grid/examples/resources/qsfs
|
||||||
```
|
```
|
||||||
* Set your own mnemonics (replace `mnemonics words` with your own mnemonics)
|
* Set your own mnemonics (replace `mnemonics words` with your own mnemonics)
|
||||||
* ```
|
```
|
||||||
export MNEMONICS="mnemonics words"
|
export MNEMONICS="mnemonics words"
|
||||||
```
|
```
|
||||||
* Set the network (replace `network` by the desired network, e.g. `dev`, `qa`, `test` or `main`)
|
* Set the network (replace `network` by the desired network, e.g. `dev`, `qa`, `test` or `main`)
|
||||||
* ```
|
```
|
||||||
export NETWORK="network"
|
export NETWORK="network"
|
||||||
```
|
```
|
||||||
* Initialize the Terraform deployment
|
* Initialize the Terraform deployment
|
||||||
* ```
|
```
|
||||||
terraform init
|
terraform init
|
||||||
```
|
```
|
||||||
* Apply the Terraform deployment
|
* Apply the Terraform deployment
|
||||||
* ```
|
```
|
||||||
terraform apply
|
terraform apply
|
||||||
```
|
```
|
||||||
* At any moment, you can destroy the deployment with the following line
|
* At any moment, you can destroy the deployment with the following line
|
||||||
* ```
|
```
|
||||||
terraform destroy
|
terraform destroy
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -100,21 +100,21 @@ When using this method, you might need to change some parameters within the `mai
|
|||||||
For this method, we use two files to deploy with Terraform. The first file contains the environment variables (**credentials.auto.tfvars**) and the second file contains the parameters to deploy our workloads (**main.tf**). To facilitate the deployment, only the environment variables file needs to be adjusted. The **main.tf** file contains the environment variables (e.g. `var.size` for the disk size) and thus you do not need to change this file, but only the file **credentials.auto.tfvars**.
|
For this method, we use two files to deploy with Terraform. The first file contains the environment variables (**credentials.auto.tfvars**) and the second file contains the parameters to deploy our workloads (**main.tf**). To facilitate the deployment, only the environment variables file needs to be adjusted. The **main.tf** file contains the environment variables (e.g. `var.size` for the disk size) and thus you do not need to change this file, but only the file **credentials.auto.tfvars**.
|
||||||
|
|
||||||
* Open the terminal and go to the home directory (optional)
|
* Open the terminal and go to the home directory (optional)
|
||||||
* ```
|
```
|
||||||
cd ~
|
cd ~
|
||||||
```
|
```
|
||||||
|
|
||||||
* Create the folder `terraform` and the subfolder `deployment-qsfs-microvm`:
|
* Create the folder `terraform` and the subfolder `deployment-qsfs-microvm`:
|
||||||
* ```
|
```
|
||||||
mkdir -p terraform && cd $_
|
mkdir -p terraform && cd $_
|
||||||
```
|
```
|
||||||
* ```
|
```
|
||||||
mkdir deployment-qsfs-microvm && cd $_
|
mkdir deployment-qsfs-microvm && cd $_
|
||||||
```
|
```
|
||||||
* Create the `main.tf` file:
|
* Create the `main.tf` file:
|
||||||
* ```
|
```
|
||||||
nano main.tf
|
nano main.tf
|
||||||
```
|
```
|
||||||
|
|
||||||
* Copy the `main.tf` content and save the file.
|
* Copy the `main.tf` content and save the file.
|
||||||
|
|
||||||
@ -274,12 +274,12 @@ output "ygg_ip" {
|
|||||||
Note that we named the VM as **vm1**.
|
Note that we named the VM as **vm1**.
|
||||||
|
|
||||||
* Create the `credentials.auto.tfvars` file:
|
* Create the `credentials.auto.tfvars` file:
|
||||||
* ```
|
```
|
||||||
nano credentials.auto.tfvars
|
nano credentials.auto.tfvars
|
||||||
```
|
```
|
||||||
|
|
||||||
* Copy the `credentials.auto.tfvars` content and save the file.
|
* Copy the `credentials.auto.tfvars` content and save the file.
|
||||||
* ```terraform
|
```terraform
|
||||||
# Network
|
# Network
|
||||||
network = "main"
|
network = "main"
|
||||||
|
|
||||||
@ -311,17 +311,17 @@ For the section QSFS Parameters, you can decide on how many VMs your data will b
|
|||||||
We now deploy the QSFS deployment with Terraform. Make sure that you are in the correct folder `terraform/deployment-qsfs-microvm` containing the main and variables files.
|
We now deploy the QSFS deployment with Terraform. Make sure that you are in the correct folder `terraform/deployment-qsfs-microvm` containing the main and variables files.
|
||||||
|
|
||||||
* Initialize Terraform by writing the following in the terminal:
|
* Initialize Terraform by writing the following in the terminal:
|
||||||
* ```
|
```
|
||||||
terraform init
|
terraform init
|
||||||
```
|
```
|
||||||
* Apply the Terraform deployment:
|
* Apply the Terraform deployment:
|
||||||
* ```
|
```
|
||||||
terraform apply
|
terraform apply
|
||||||
```
|
```
|
||||||
* Terraform will then present you the actions it will perform. Write `yes` to confirm the deployment.
|
* Terraform will then present you the actions it will perform. Write `yes` to confirm the deployment.
|
||||||
|
|
||||||
Note that, at any moment, if you want to see the information on your Terraform deployments, write the following:
|
Note that, at any moment, if you want to see the information on your Terraform deployments, write the following:
|
||||||
* ```
|
```
|
||||||
terraform show
|
terraform show
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -59,15 +59,15 @@ There are two options when it comes to finding a node to deploy on. You can use
|
|||||||
We cover the basic preparations beforing explaining the main file.
|
We cover the basic preparations beforing explaining the main file.
|
||||||
|
|
||||||
- Make a directory for your project
|
- Make a directory for your project
|
||||||
- ```
|
```
|
||||||
mkdir myfirstproject
|
mkdir myfirstproject
|
||||||
```
|
```
|
||||||
- Change directory
|
- Change directory
|
||||||
- ```
|
```
|
||||||
cd myfirstproject
|
cd myfirstproject
|
||||||
```
|
```
|
||||||
- Create a main file and insert content
|
- Create a main file and insert content
|
||||||
- ```
|
```
|
||||||
nano main.tf
|
nano main.tf
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -109,11 +109,11 @@ provider "grid" {
|
|||||||
When writing the main file, you can decide to leave a variable content empty. In this case you can export the variable content as environment variables.
|
When writing the main file, you can decide to leave a variable content empty. In this case you can export the variable content as environment variables.
|
||||||
|
|
||||||
* Export your mnemonics
|
* Export your mnemonics
|
||||||
* ```
|
```
|
||||||
export MNEMONICS="..."
|
export MNEMONICS="..."
|
||||||
```
|
```
|
||||||
* Export the network
|
* Export the network
|
||||||
* ```
|
```
|
||||||
export NETWORK="..."
|
export NETWORK="..."
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -94,20 +94,20 @@ Open the terminal.
|
|||||||
|
|
||||||
- Go to the home folder
|
- Go to the home folder
|
||||||
|
|
||||||
- ```
|
```
|
||||||
cd ~
|
cd ~
|
||||||
```
|
```
|
||||||
|
|
||||||
- Create the folder `terraform` and the subfolder `deployment-full-vm`:
|
- Create the folder `terraform` and the subfolder `deployment-full-vm`:
|
||||||
- ```
|
```
|
||||||
mkdir -p terraform/deployment-full-vm
|
mkdir -p terraform/deployment-full-vm
|
||||||
```
|
```
|
||||||
- ```
|
```
|
||||||
cd terraform/deployment-full-vm
|
cd terraform/deployment-full-vm
|
||||||
```
|
```
|
||||||
- Create the `main.tf` file:
|
- Create the `main.tf` file:
|
||||||
|
|
||||||
- ```
|
```
|
||||||
nano main.tf
|
nano main.tf
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ In this file, we name the VM as `vm1`.
|
|||||||
|
|
||||||
- Create the `credentials.auto.tfvars` file:
|
- Create the `credentials.auto.tfvars` file:
|
||||||
|
|
||||||
- ```
|
```
|
||||||
nano credentials.auto.tfvars
|
nano credentials.auto.tfvars
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -239,12 +239,12 @@ We now deploy the full VM with Terraform. Make sure that you are in the correct
|
|||||||
|
|
||||||
- Initialize Terraform:
|
- Initialize Terraform:
|
||||||
|
|
||||||
- ```
|
```
|
||||||
terraform init
|
terraform init
|
||||||
```
|
```
|
||||||
|
|
||||||
- Apply Terraform to deploy the full VM:
|
- Apply Terraform to deploy the full VM:
|
||||||
- ```
|
```
|
||||||
terraform apply
|
terraform apply
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -255,7 +255,7 @@ After deployments, take note of the 3Node' IPv4 address. You will need this addr
|
|||||||
## SSH into the 3Node
|
## SSH into the 3Node
|
||||||
|
|
||||||
- To [SSH into the 3Node](ssh_guide.md), write the following:
|
- To [SSH into the 3Node](ssh_guide.md), write the following:
|
||||||
- ```
|
```
|
||||||
ssh root@VM_IPv4_Address
|
ssh root@VM_IPv4_Address
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user