- NOTES:
- This section depends on Kubernetes and a
~/.kubeconfigfrom above NodePortwas used instead ofLoadBalancerforservice.type- MetalLB is a stretch goal for future deployments
- This section depends on Kubernetes and a
- Install
terraformvia `asdf# terraform asdf plugin-add terraform asdf install terraform latest - Add aliases to
~/.bashrcor~/.zshrc# ~/.bashrc alias tf='terraform' alias tfi='terraform init -backend-config=./state.conf' alias tfa='terraform apply' alias tfp='terraform plan' alias tfpn='terraform plan -refresh=false'
- Navigate to
./terraform/and initialize theterraformworking directorycd terraform/ tfi - Create an execution plan
tfp
- Apply/execute the actions from Terraform plan
tfa
- Navigate to
http://localhost:<port>- Port can be found via
kubectlk get svc # 80:31942/TCP
- Port can be found via
- Tear down deployment
tf destroy
-
Verbose logging and redirection to a file
export TF_LOG="trace" # unset via "off" export TF_LOG_PATH="$HOME/Downloads/tf.log" # `~` doesn't expand
- Log levels
- TRACE
- DEBUG
- INFO
- WARN
- ERROR
- Log levels
-
Error: cannot re-use a name that is still in useI think I resolved the issue. This is what I did: 1) mv the terraform.tfstate to another name, 2) mv the terraform.tfstate.backup to terraform.tfstate, and 3) run 'terraform refresh' command to confirm the state is synchronized, and 4) run 'terraform apply' to delete/create the resource. I will mark your reply as the answer, as it gives me the clue for solving the issue. Thanks! – ozmhsh Dec 9, 2021 at 4:57
nginx - Stuck in the partial helm release on Terraform to Kubernetes - Stack Overflow
