Skip to content

galovics/free-kubernetes-oracle-cloud-terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Free Kubernetes cluster on Oracle Cloud with Terraform

The repository contains a Terraform script for creating a fully functioning Kubernetes cluster on Oracle Cloud.

The repo was created for this article: Free Oracle Cloud Kubernetes cluster with Terraform

Setup in a nutshell

  1. Get the following data from your Oracle Cloud account
    • User OCID
    • Tenancy OCID
    • Compartment OCID
  2. Open a terminal within the oci-infra folder
  3. Execute a terraform init
  4. Execute a terraform apply
  5. Create your Kubernetes configuration file using
    $ oci ce cluster create-kubeconfig --cluster-id <cluster OCID> --file ~/.kube/free-k8s-config --region <region> --token-version 2.0.0 --kube-endpoint PUBLIC_ENDPOINT
  6. Apply your K8S config for kubectl
    $ export KUBECONFIG=~/.kube/free-k8s-config
  7. To verify cluster access, do a kubectl get nodes
  8. Enjoy