Skip to content

Provision and Connect to an Minikube installed on top of an AWS EC2 instance using Terraform

Notifications You must be signed in to change notification settings

Think-iT-Labs/ec2-minikube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EC2-Minikube

Architecture

Architecture

Pre-requisite

  • yq on your host instance, go here to install

Usage

Provisioning the Infrastructure

terraform apply

Connecting to the k8s cluster

You can export the Kubeconfig file using this helper

$(terraform output -raw kubeconfig_command)

Checking the connection

kubectl cluster-info

Requirements

Name Version
terraform >= 1.0
aws >=3.28.0

Providers

Name Version
aws 3.63.0
null 3.1.0
tls 3.1.0

Modules

No modules.

Resources

Name Type
aws_eip.instance_elastic_ip resource
aws_eip_association.minikube_eip_assoc resource
aws_instance.minikube_instance resource
aws_key_pair.aws_keypair resource
aws_security_group.allow_additional_exposed_ports resource
aws_security_group.allow_kube_api_server resource
null_resource.download_kubeconfig resource
tls_private_key.private_key resource
aws_ami.ubuntu data source

Inputs

Name Description Type Default Required
exposed_ports Ports to expose from Minikube EC2 instance
list(object({
port = number
protocol = string
}))
[
{
"port": 80,
"protocol": "tcp"
}
]
no
kubeconfig_output_location KubeConfig file Location string n/a yes
minikube_instance_name Minikube EC2 Instance name string "minikube-on-ec2" no
region AWS Region string "eu-west-1" no

Outputs

Name Description
kubeconfig_command Command that needs to be run in order for your kubectl to point to the minikube
minikube_public_ip MiniKube instance public ip address

Made with ❤️ by Think-iT

About

Provision and Connect to an Minikube installed on top of an AWS EC2 instance using Terraform

Resources

Stars

Watchers

Forks