The repository contains a Terraform script for creating a fully functioning Kubernetes cluster on Oracle Cloud.
Fork of the repo created for this article: Free Oracle Cloud Kubernetes cluster with Terraform
- Get the following data from your Oracle Cloud account
- User OCID
- Tenancy OCID
- Compartment OCID
- Enter variables in
.envrc
and rundirenv allow
- Execute a
terraform init
- Execute a
terraform apply
- To verify cluster access, do a
kubectl get nodes
- Create your Kubernetes configuration file using
$ oci ce cluster create-kubeconfig --cluster-id <cluster OCID> --file ~/.kube/oci-k8s-config --region <region> --token-version 2.0.0 --kube-endpoint PUBLIC_ENDPOINT
- Apply your K8S config for kubectl
$ export KUBECONFIG=~/.kube/oci-k8s-config