Terraform kubernetes provider on minikube. Creating kubernetes namespaes
2021, Mar 26
Prerequisites :
- terraform
- minikube
1) Start minikube :
minikube start2) Clone this article GIT repo :
cd namespaces
Edit main.tf file, and edit appropiately to point to your kubeconfig file location :
provider "kubernetes" {
config_context_cluster = "minikube"
config_path = "~/.kube/config"
}3) Initialize terraform
terraform init4) Plan
terraform plan5) Terraform apply
terraform apply6) Verify Namespaces get created
kubectl get nsShould show :
NAME STATUS AGE
applications-namespace Active 6s
monitoring-namespace Active 6s
default Active 37d
kube-node-lease Active 37d
kube-public Active 37d
kube-system Active 37d