Skip to content

Latest commit

 

History

History
118 lines (90 loc) · 6.7 KB

File metadata and controls

118 lines (90 loc) · 6.7 KB

terraform-oci-infra-k8s-oracle-cloud

Terraform module to provision infrastructure used to create free Kubernetes cluster in Oracle Cloud

Prerequisites

  1. Install tools:

Usage

  1. Authenticate to Oracle Cloud:
oci session authenticate --region eu-frankfurt-1 --profile-name k8s-oci

Token can be later refreshed by command:

oci session refresh --profile k8s-oci
  1. Initialize Terraform:
cd examples/basic
terraform init
  1. Prepare file with variables values:
cp example.tfvars terraform.tfvars
vi terraform.tfvars
  1. Apply code for infrastructure:
terraform apply

Requirements

Name Version
terraform >= 1.3.0
oci ~> 6.17.0

Providers

Name Version
oci ~> 6.17.0

Modules

No modules.

Resources

Name Type
oci_core_default_route_table.k8s_vcn_route_table resource
oci_core_default_security_list.k8s_vcn_security_list resource
oci_core_instance.k8s_node resource
oci_core_internet_gateway.k8s_internet_gateway resource
oci_core_subnet.k8s_subnet resource
oci_core_vcn.k8s_vcn resource
oci_network_load_balancer_backend.k8s_backend resource
oci_network_load_balancer_backend.nginx_http_backend resource
oci_network_load_balancer_backend_set.k8s_backend_set resource
oci_network_load_balancer_backend_set.nginx_http_backend_set resource
oci_network_load_balancer_listener.k8s_listener resource
oci_network_load_balancer_listener.nginx_http_listener resource
oci_network_load_balancer_network_load_balancer.k8s_network_load_balancer resource
oci_core_images.oci_ubuntu_images data source
oci_identity_availability_domains.ads data source

Inputs

Name Description Type Default Required
availability_domains Availability domains in which instances are going to be created list(number)
[
0,
1,
2,
0
]
no
compartment_id Compartment ID string n/a yes
egress_security_rules Egress security rules list(map(string)) [] no
id_rsa_pub SSH public key string n/a yes
ingress_security_rules Ingress security rules list(map(string)) [] no
instance_count Number of instances to create number 4 no
instance_shape Shape of instance string "VM.Standard.A1.Flex" no
my_public_ip My public IP address string n/a yes
subnet_cidr_block Subnet CIDR string "172.16.0.0/24" no
vcn_cidr_block VCN CIDR string "172.16.0.0/20" no

Outputs

Name Description
availability_domain availability domain
compute_instances Names and IPs of created instances
compute_instances_public_ip Public IPs of created nodes
lb_id ID of LB
lb_public_ip Public IPs of LB
oci_ubuntu_images List of possible Ubuntu images
subnet_cidr CIDR block of the core subnet
subnet_id ID of the core subnet
subnet_state The state of the subnet
vcn_cidr CIDR block of the core VCN
vcn_id ID of the core VCN
vcn_state the state of the VCN

License

MIT Licensed. See LICENSE.