Skip to content
Snippets Groups Projects
Commit 40645930 authored by Nathan Rodet's avatar Nathan Rodet
Browse files

Added documentation

parent ec495833
No related branches found
No related tags found
1 merge request!2Develop
Pipeline #50983 failed
# Scaleway Instances Template - Quickstart # Scaleway Instances Template - Quickstart
## How does it work ? # How does it work ?
The template will provision several resources (including your instances) to the Scaleway cloud provider using Terraform and Gitlab CI. The template will provision several resources (including your instances) to the Scaleway cloud provider using Terraform and Gitlab CI.
After provisioning, configuration of the instances and deployment of the services (Atrium and TTYD) will be done using Cloud-init and bash scripts. After provisioning, configuration of the instances and deployment of the services (Atrium and TTYD) will be done using Cloud-init and bash scripts.
> All your information must be stored in Gitlab and passed as variable to Terraform. > All your information must be stored in Gitlab and passed as variable to Terraform.
### How the deployment is managed ? ## How the deployment is managed ?
The whole project is managed by Gitlab using the Gitlab CI. The whole project is managed by Gitlab using the Gitlab CI.
Launching the pipeline will start the deployment of your infrastructure in 3 steps. Launching the pipeline will start the deployment of your infrastructure in 3 steps.
**Plan :** **Plan :**
Terraform will perform a "fake deployment" and initialize everything he needs before deploying. Terraform will perform a "fake deployment" and initialize everything he needs before deploying.
After performing, you will be able to see the plan of the future creation/modification/destruction in the log of the pipeline. After performing, you will be able to see the plan of the future creation/modification/destruction in the log of the pipeline.
If the modification could lead to break changes and errors, you must not launch the next step of the pipeline. If the modification could lead to break changes and errors, you must not launch the next step of the pipeline.
**Creation :** **Creation :**
Terraform will be applying the exact changes you reviewed in the Plan step. Terraform will be applying the exact changes you reviewed in the Plan step.
**Destruction :** **Destruction :**
Terraform will destroy the resources he managed to create (or manually imported one). Terraform will destroy the resources he managed to create (or manually imported one).
## How can I use it ? ##How can I use it ?
### Step 0 : Prerequisite ## Step 0 : Prerequisite
**On The Forge (Gitlab)**, you must have or ask for the right to fork the repository. **On The Forge (Gitlab)**, you must have or ask for the right to fork the repository.
...@@ -33,11 +33,11 @@ and create one for your project. Please make sure to add a description starting ...@@ -33,11 +33,11 @@ and create one for your project. Please make sure to add a description starting
**The Certificate Authority (CA)** Let's Encrypt needs an email. He will use it to send a notification before the certificate expires to proceed with **The Certificate Authority (CA)** Let's Encrypt needs an email. He will use it to send a notification before the certificate expires to proceed with
the renewal. the renewal.
### Step 1 : Getting your own repository ## Step 1 : Getting your own repository
Fork the project from [this repository](https://forge.grandlyon.com/systemes-dinformation/alpha/pocs/scaleway-instances-template) Fork the project from [this repository](https://forge.grandlyon.com/systemes-dinformation/alpha/pocs/scaleway-instances-template)
### Step 2 : Setting up the variables with credentials and others information ## Step 2 : Setting up the variables with credentials and others information
Go to the `Settings` menu, `CI/CD` and look for the `Variables` submenu. Go to the `Settings` menu, `CI/CD` and look for the `Variables` submenu.
Once it's done, you will need to create the variable bellow : Once it's done, you will need to create the variable bellow :
...@@ -50,7 +50,7 @@ Once it's done, you will need to create the variable bellow : ...@@ -50,7 +50,7 @@ Once it's done, you will need to create the variable bellow :
- **TF_VAR_SCW_SECRET_KEY** : Scaleway Secret Key. - **TF_VAR_SCW_SECRET_KEY** : Scaleway Secret Key.
- **TF_VAR_USER_PASSWORD** : User password for accessing services and instances. - **TF_VAR_USER_PASSWORD** : User password for accessing services and instances.
### Step 3 : Every is set up, deployment is coming ! ## Step 3 : Every is set up, deployment is coming !
Go the `CI/CD` menu and `Pipelines`. Go the `CI/CD` menu and `Pipelines`.
From now, you will need to click on `Run pipeline` with your selected branch. From now, you will need to click on `Run pipeline` with your selected branch.
...@@ -63,7 +63,7 @@ on production infrastructure. ...@@ -63,7 +63,7 @@ on production infrastructure.
Once plan is done and ok, click the `Apply button` to deploy the infrastructure. Please be sure to click the `Destroy Once plan is done and ok, click the `Apply button` to deploy the infrastructure. Please be sure to click the `Destroy
button` to destroy the infrastructure when you don't need it anymore. button` to destroy the infrastructure when you don't need it anymore.
### Step 4 : Accessing your services ## Step 4 : Accessing your services
After deployment, each resource can be accessed though HTTPS, URL depends of the variable you defined before : After deployment, each resource can be accessed though HTTPS, URL depends of the variable you defined before :
- **TTYD :** https://terminal-<INSTANCE_COUNT>.<ENVIRONMENT>-<INSTANCE_COUNT>.<PROJECT_DOMAIN/ - **TTYD :** https://terminal-<INSTANCE_COUNT>.<ENVIRONMENT>-<INSTANCE_COUNT>.<PROJECT_DOMAIN/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment