Рет қаралды 1,451
Follow along step-by-step, and by the end of this video, you'll have your own Kubernetes cluster up and running on AWS EC2, ready to power your containerized applications. Don't forget to like, share, and subscribe for more in-depth tech tutorials!
Follow Me: / ramalab
Website: cloudwithramal...
Terraform Code Used:
provider "aws" {
region = "ap-south-1"
}
resource "aws_security_group" "cluster_sg" {
name = "cluster_sg"
description = "Security group created for Kube Cluster"
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
resource "aws_instance" "controlpane" {
ami = "ami-0f58b397bc5c1f2e8"
instance_type = "t3.medium"
key_name = "controlplane-key"
vpc_security_group_ids = [aws_security_group.cluster_sg.id]
tags = {
Name = "controlpane"
Project = "kube"
}
}
resource "aws_instance" "workernode01" {
ami = "ami-0f58b397bc5c1f2e8"
instance_type = "t3.medium"
key_name = "workernode01-key"
vpc_security_group_ids = [aws_security_group.cluster_sg.id]
tags = {
Name = "workernode01"
Project = "kube"
}
}