Skaffold a full Kubernetes Cluster with nothing but Terraform and ansible, and deploy a sample application on it.
- Terraform (tested with 1.3.9)
- Ansible (tested core with 2.14.4)
- AWS CLI configured with your credentials (tested with 2.10.1)
Refer to the AWS IAM User Configuration for more information on how to configure your AWS credentials.
$ git clone https://github.com/darklight147/kubernetes-the-easier-way.git
$ cd kubernetes-the-easier-way
$ aws s3api create-bucket --bucket YOUR_BUCKET_NAME --region us-east-1
$ aws dynamodb create-table --table-name YOUR_DYNAMODB_TABLE_NAME --attribute-definitions AttributeName=LockID,AttributeType=S --key-schema AttributeName=LockID,KeyType=HASH --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1
$ cat > backend.tfvars <<EOF
bucket = "YOUR_BUCKET_NAME"
dynamodb_table = "YOUR_DYNAMODB_TABLE_NAME"
region = "YOUR_AWS_REGION"
key = "terraform.tfstate"
EOF
Finally, here is the structure of the project you just ended up with:
.
├── IAM.md
├── README.md
├── ansible
│ └── k8s.yml
├── backend.tfvars
├── main.tf
├── outputs.tf
├── providers.tf
└── variables.tf
2 directories, 11 files
- Initialize Terraform
$ terraform init -backend-config=backend.tfvars
- Create the infrastructure
$ terraform apply
-
Say yes to the prompt and wait for the infrastructure to be created.
-
Done! You now have a fully functional Kubernetes cluster with 1 master and 1 worker.