These resources should be built with Terraform: https://terraform.io
Manage Kubernetes with Terraform. This effectivelly replaces all kubectl
and helm
commands with a single terraform apply
.
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo yum -y install terraform
curl -sSfL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip ./awscliv2.zip
sudo ./aws/install
rm -f awscliv2.zip
The Kubernetes provider is used to interact with the resources supported by Kubernetes. The provider needs to be configured with the proper credentials before it can be used.
This provider is likely the best way of managing Kubernetes resources in Terraform, by allowing you to use yaml.
The Helm provider is used to deploy software packages in Kubernetes.
See configuration instructions here:
https://www.lisenet.com/2020/terraform-with-aws-s3-and-dynamodb-for-remote-state-files/
See required IAM account permissions terraform-aws-iam-permissions.json.
Requires Terraform v1.0 or above.
Terraform has not been configured to create certain namespaces, therefore run the following:
kubectl create ns kubecost
kubectl create ns logging
kubectl create ns speedtest
Change to your project directory and run the following:
terraform init -upgrade
terraform apply
https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs
https://registry.terraform.io/providers/gavinbunney/kubectl/latest
https://registry.terraform.io/providers/hashicorp/helm/latest/docs