Aller au contenu

TP 0 : Mise en place de l'environnement

Prérequis : Docker Desktop doit être installé et en cours d’exécution avant de démarrer les TP Docker, Kind et LocalStack.

Ouvrir PowerShell en mode administrateur, puis exécuter :

Fenêtre de terminal
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Vérifier :

Fenêtre de terminal
choco --version
Fenêtre de terminal
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Vérifier :

Fenêtre de terminal
brew --version
Fenêtre de terminal
choco install terraform
Fenêtre de terminal
brew tap hashicorp/tap && brew install hashicorp/tap/terraform
Fenêtre de terminal
sudo apt-get update && sudo apt-get install -y gnupg software-properties-common
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt-get update && sudo apt-get install terraform

Vérifier :

Fenêtre de terminal
terraform version

OpenTofu est l’alternative open source à Terraform (TP 13).

Fenêtre de terminal
choco install opentofu
Fenêtre de terminal
brew install opentofu
Fenêtre de terminal
curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh | sudo sh -s -- --install-method deb

Vérifier :

Fenêtre de terminal
tofu version
Fenêtre de terminal
choco install kubernetes-cli
Fenêtre de terminal
brew install kubectl
Fenêtre de terminal
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

Vérifier :

Fenêtre de terminal
kubectl version --client
Fenêtre de terminal
choco install kind
Fenêtre de terminal
brew install kind
Fenêtre de terminal
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.26.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind

Vérifier :

Fenêtre de terminal
kind version
Fenêtre de terminal
choco install kubernetes-helm
Fenêtre de terminal
brew install helm
Fenêtre de terminal
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

Vérifier :

Fenêtre de terminal
helm version
Fenêtre de terminal
choco install k9s
Fenêtre de terminal
brew install k9s
Fenêtre de terminal
curl -sS https://webinstall.dev/k9s | bash

Vérifier :

Fenêtre de terminal
k9s version

Trivy est utilisé pour scanner le code Terraform (TP 11).

Fenêtre de terminal
choco install trivy
Fenêtre de terminal
brew install trivy
Fenêtre de terminal
sudo apt-get install wget apt-transport-https gnupg
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo deb https://aquasecurity.github.io/trivy-repo/deb generic main | sudo tee /etc/apt/sources.list.d/trivy.list
sudo apt-get update && sudo apt-get install trivy

Vérifier :

Fenêtre de terminal
trivy --version

Infracost est utilisé pour estimer les coûts d’infrastructure (TP 12).

Fenêtre de terminal
choco install infracost
Fenêtre de terminal
brew install infracost
Fenêtre de terminal
curl -fsSL https://raw.githubusercontent.com/infracost/infracost/master/scripts/install.sh | sh

Vérifier et configurer (clé API gratuite requise) :

Fenêtre de terminal
infracost --version
infracost auth login

jq est utilisé pour parser les rapports JSON d’Infracost (TP 12).

Fenêtre de terminal
choco install jq
Fenêtre de terminal
brew install jq
Fenêtre de terminal
sudo apt-get install jq

Vérifier :

Fenêtre de terminal
jq --version
Fenêtre de terminal
terraform version
tofu version
docker version
kubectl version --client
kind version
helm version
k9s version
trivy --version
infracost --version
jq --version
Fenêtre de terminal
terraform version
tofu version
docker version
kubectl version --client
kind version
helm version
k9s version
trivy --version
infracost --version
jq --version