User Tools

Site Tools


hosts:k8s:working-with-terraform

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
hosts:k8s:working-with-terraform [2025/02/18 00:32] – created emily747hosts:k8s:working-with-terraform [2025/02/18 03:22] (current) emily747
Line 1: Line 1:
-sd+.====== Terraform ====== 
 + 
 +Terraform is how we manage our k8s. As an Infrastructure-as-Code solution, it allows us to create a reproducible deployment using just a few configuration files and commands (in theory). These configurations are managed in the [[https://git.tardisproject.uk/tardis/k8s|Kubernetes Configs]] repository. 
 + 
 +========= Step-by-step deployment ========= 
 + 
 +The first step to deploying is to configure your working environment. You'll need to ssh into sandbox and follow the steps in [[https://console.tardisproject.uk|console]] to configure your standard-user Kubernetes. 
 + 
 +Once this is done, you can run the following commands in sandbox. 
 + 
 +    kubectl config set-context tardis-admin --cluster=tardis --user=tardis-oidc --namespace=tardis-admin 
 +    kubectl config use-context tardis-admin 
 + 
 +Following this, you'll need to clone the repository by running 
 + 
 +    git clone https://git.tardisproject.uk/tardis/k8s 
 +    cd k8s 
 + 
 +You can now run the following commands to setup terraform. 
 + 
 +    terraform init 
 + 
 +And run the following commands to deploy your changes each time 
 + 
 +    terraform plan # shows you the changes 
 +    terraform apply # applies the changes to production 
 + 
 +While much of this is handled in terraform, for debugging purposes, you may need to use ''kubectl''
 + 
hosts/k8s/working-with-terraform.1739838757.txt.gz · Last modified: 2025/02/18 00:32 by emily747