Skip to content

robinlieb/terraform-oci-free-tier-kubernetes

Repository files navigation

Terraform Module for Kubernetes Cluster on OCI Cloud Free Tier

This project uses Terraform to create a Kubernetes cluster on the Oracle Cloud Infrastructure (OCI) Free Tier resources. The cluster consists of 4 nodes: one control plane and three worker nodes. Each node uses the Arm-based Ampere A1 core and 6 GM of memory.

Note: This project is not intended to be used in production environments.

Prerequisites

Before running this project, you must have the following:

  • An OCI account with Free Tier resources available
  • Terraform installed on your local machine
  • OCI CLI installed on your local machine
  • SSH key pair generated on your local machine

Example

To help get started quickly with this Terraform module, I have included an example configuration in the example folder. This example demonstrates how to use the module to provision a sample infrastructure that showcases its functionality.

Inputs

Name Description Type Default Required
fingerprint The fingerprint of the private_key, e.g. 8c:bf:17:7b:5f:e0:7d:13:75:11:d6:39:0d:e2:84:74. string n/a yes
private_key The private key retrieved from the Oracle account. string n/a yes
region The desired region of the cluster, e.g. us-phoenix-1. string n/a yes
ssh_private_key The private key used for SSH to the instances. string n/a yes
ssh_public_key The public key used for SSH to the instances. string n/a yes
tenancy_ocid The OCID of the tenany, e.g. ocid1.tenancy.oc1..aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa. string n/a yes
user_ocid The OCID of the user, e.g. ocid1.user.oc1..aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa. string n/a yes
availability_domain The availability domain in which the instance should be created, e.g Uocm:PHX-AD-1. string null no
instance_count Number of instances which should be created. number 4 no
instance_memory Amount of memory available to the instance, in gigabytes. number 6 no
instance_ocpus Number of OCPUs available to the instance. number 1 no
instance_os Operating system for compute instances. string "Canonical Ubuntu" no
instance_shape Shape of the instances. string "VM.Standard.A1.Flex" no
linux_os_version Operating system version for all Linux instances. string "22.04" no
name Name will be used for compartment and kubeconfig. string "terraform-oci-free-tier-kubernetes" no

Outputs

Name Description
all_availability_domains All availaility domains.
available_images Available images.
client_certificate Kubernetes Client Certificate
client_key Kubernetes Client Key
cluster_ca_certificate Kubernetes Cluster CA Certificate
compartment_id ID of the compartment.
compartment_name Name of the compartment.
instance_OCPUs CPUs of the instances.
instance_memory_in_GBs Memory in GB of the instances.
instance_name Names of the instances.
instance_ocid OCID of the instances.
instance_region Region of the instances.
instance_shape Shape of the instances.
instance_state State of the instances.
kubeconfig Kubeconfig to access the cluster
kubeconfig_commands Kubeconfig commands to apply to local kubeconfig
public_ip_for_compute_instance Public IPs of the instances.
time_created Creation time of the instances
vcn_id_route_id ID of the route.
vcn_nat_gateway_id ID of the NAT gateway.
vcn_nat_route_id ID of the NAT route.
vcp_id ID of the VCN.

License

This project is released under the Apache License 2.0. For more information, see the LICENSE file.