Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Latest commit

 

History

History

example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Example

Modify secret.yaml with your Digital Ocean token and desired droplet name.

Create the module:

kubectl create -f module.yaml -n tf-operator

Create the resources the Execution will require to run:

kubectl create -f secret.yaml -f envvar.yaml -n tf-operator

This creates a secret with the Digital Ocean token for creating the droplet and a config map that will be pulled into the environment of the Execution Run.

Create the exectution:

kubectl create -f execution.yaml -n tf-operator

Check the logs of the Execution Run to verify Terraform is going to perform the expected operations:

kubectl logs [pod-name] -n tf-operator

Assuming the action Terraform is going to perform is correct annotate the Execution Run to approve the changes:

kubectl annotate executionruns.terraform-operator.cattle.io [execution-run-name] -n tf-operator approved="yes" --overwrite

Once the job completes, you can see the outputs from Terraform by checking the Execution Run:

kubectl get executionruns.terraform-operator.cattle.io [execution-run-name] -n tf-operator -o yaml

To remove the resource Terraform created, delete the Execution and follow the same steps to validate the logs from the Job and annotate the Execution Run.