Terraform module to configure free Kubernetes cluster in Oracle Cloud
- Install tools:
- Authenticate to Oracle Cloud:
oci session authenticate --region eu-frankfurt-1 --profile-name k8s-ociToken can be later refreshed by command:
oci session refresh --profile k8s-oci- Initialize Terraform:
cd examples/basic
terraform init- Prepare file with variables values:
cp example.tfvars terraform.tfvars
vi terraform.tfvars- Apply code for infrastructure:
terraform apply- Use Kubernetes:
mkdir -p ~/.kube
terraform output -raw microk8s_config_public > ~/.kube/microk8s.conf
export KUBECONFIG=$KUBECONFIG:~/.kube/config:~/.kube/microk8s.conf
kubectl get all --all-namespaces| Name | Version |
|---|---|
| terraform | >= 1.3.0 |
| external | ~> 2.3.3 |
| null | ~> 3.2.2 |
| oci | ~> 6.32.0 |
| remote | 0.1.3 |
| time | ~> 0.13.0 |
| Name | Version |
|---|---|
| external | ~> 2.3.3 |
| null | ~> 3.2.2 |
| oci | ~> 6.32.0 |
| remote | 0.1.3 |
| time | ~> 0.13.0 |
No modules.
| Name | Type |
|---|---|
| null_resource.k8s_cluster_join | resource |
| null_resource.k8s_cluster_setup | resource |
| null_resource.master_setup | resource |
| null_resource.worker_setup | resource |
| time_sleep.wait_60_seconds | resource |
| external_external.microk8s_config | data source |
| oci_network_load_balancer_network_load_balancer.k8s_network_load_balancer | data source |
| remote_file.join_command_token | data source |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| compute_instances | A map of compute instances to create | map(any) |
n/a | yes |
| id_rsa | SSH private key | string |
n/a | yes |
| lb_id | ID of the load balancer | string |
n/a | yes |
| my_public_ip | My public IP address | string |
n/a | yes |
| subnet_cidr | CIDR block for the subnet | string |
n/a | yes |
| Name | Description |
|---|---|
| master_public_ip | The public IP address of the master node |
| microk8s_config_private | The private configuration for microk8s |
| microk8s_config_public | The public configuration for microk8s |
MIT Licensed. See LICENSE.