Credit: I forked this repository https://github.com/nce/oci-free-cloud-k8s in order to create this infrastructure on Oracle Cloud. Thank you to https://github.com/nce for the awesome Terraform bootstrap!
Parent Article: How to play Pokemon in VR Minecraft
If you are starting from scratch with Terraform on Oracle, I recommend you check out their tutorial series https://developer.hashicorp.com/terraform/tutorials/oci-get-started to get familiar with the concepts.
Then again, if you are already familiar with the concept of Infrastructure as Code you may be able to dive right in. Up to you!
Disclaimer: This infrastructure utilizes a Pay-As-You-Go account setup. Only follow this guide if you are ok with the possibility of incurring costs on Oracle. This setup is completely free, but I won’t be held responsible if you end up with a bill when something went sideways. I had to pay about a dollar to Oracle while exploring and learning how this worked.
Check out my repository https://github.com/saranicole/minecraft-oci-k8s with git. You will be making use of the infra directory in this guide, so change into that in your terminal:
git clone https://github.com/saranicole/minecraft-oci-k8s.git
cd oci-free-cloud-k8s/terraform/infra
If you haven’t registered for a Pay as You Go account on Oracle, do that now. Sign up at https://signup.cloud.oracle.com and add a payment method to convert it to Pay as You Go. Without doing this payment method step, your resources will never get created (the terraform will hang). Make sure you have the oci command line tool installed and authenticated as well – see https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm .
Manually create a single bucket in Oracle Cloud to hold your Terraform state – see https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/managingbuckets_topic-To_create_a_bucket.htm . Name it “terraform-states” or similar – this name will need to match the “bucket” parameter in backend.conf . Note the “Namespace” in the bucket details – you will need that for you backend.conf file.
You will need to create a few files to make this work.
In the infra directory:
backend.conf
general.auto.tfvars
Example backend.conf ( replace <<Storage Namespace>> with the namespace you retrieved when you created the bucket ):
namespace = "<<Storage Namespace>>"
bucket = "terraform-states"
key = "infra/cluster.tfstate"
Example general.auto.tfvars
compartment_id = << Tenancy OCID >>
region = << Region >>
ssh_public_key = << SSH Public Key >>
kubernetes_version = "v1.35.0"
user_ocid = << User OCID >>
fingerprint = << API Key fingerprint >>
private_key_path = << Path to API Key Secret File >>
bucket_namespace = << Storage Namespace >>
enable_minecraft_port = true
Parameters Explanation:
compartment_id – this is your tenancy ID. Retrieve it by clicking the profile dropdown, selecting “Tenancy”, then copying the first “OCID” value.

region – the region where you provisioned your account, this should be reasonably closest to you. See https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm for a list of available choices. Try to avoid going with Ashburn since it is the most popular and has a chance of not being able to provision resources
ssh_public_key – This is the public (non-secret) component of an API Key. See https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm for an explanation of API Key authentication. Create one at https://cloud.oracle.com/identity/domains/my-profile/auth-tokens and make sure to save the private key so that you can authenticate to Terraform using the oci command line tool
kubernetes_version – This is the Kubernetes Cluster version. See https://kubernetes.io/releases/ for the available versions. v1.35.0 was the latest at the time of writing.
user_ocid – This is the OCID under “User Settings”. Copy the value from https://cloud.oracle.com/identity/domains/my-profile/details
fingerprint – This is the fingerprint given to you when you created the API Key
private_key_path – this is the file path to the location where you saved the private key part of the API Key. Something like $HOME/my_secret_key.pem . Note this is not an SSH private key
bucket_namespace – this is the Storage Namespace again
enable_minecraft_port – set to true if you plan on using this as a Minecraft server. This will open up port 25565. If you want this for some other purpose, keep this turned off using false .
Run the init first to confirm that Terraform is working and make sure to inspect everything it will create.
terraform init -backend-config=backend.conf
Then run the plan
terraform plan
It should output something like this:
data.oci_containerengine_node_pool_option.node_pool_options: Reading...
module.vcn.data.oci_core_services.all_oci_services[0]: Reading...
data.oci_identity_availability_domains.ads: Reading...
oci_identity_tag_namespace.k8s_node_pool: Refreshing state...
...
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
+ create
~ update in-place
Terraform will perform the following actions:
# oci_core_security_list.private_subnet_sl will be created
... yadda yadda
If there are any errors due to missing information, make sure your files are all filled out correctly.
Once the plan succeeds with no errors, you can apply the Terraform.
terraform apply
Enter “yes” when it prompts you.
It should finish like this:
Apply complete! Resources: xx added, 0 changed, 0 destroyed.
It will also create a .kube.config file that you will need for further provisioning and to access the cluster with kubectl.
After everything is running for a day, make sure to visit https://cloud.oracle.com/account-management/cost-analysis to make sure everything is truly running without any costs, or that any cost you did get is within your expectation.
Congratulations! You now have a Kubernetes cluster running on Oracle Cloud. Check out the next post in this series to install Minecraft on this cluster.
Create a Modded Minecraft Server on a hosted Kubernetes Cluster