-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkubernetes.tf
More file actions
34 lines (28 loc) · 841 Bytes
/
kubernetes.tf
File metadata and controls
34 lines (28 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module "eks-cluster" {
source = "terraform-aws-modules/eks/aws"
cluster_name = "${var.name}-cluster"
cluster_version = "1.18"
subnets = module.vpc.private_subnets
vpc_id = module.vpc.vpc_id
workers_group_defaults = {
root_volume_type = "gp2"
}
worker_groups = [
{
instance_type = "t3a.medium"
asg_max_size = 2
}
]
}
data "aws_eks_cluster" "cluster" {
name = module.eks-cluster.cluster_id
}
data "aws_eks_cluster_auth" "cluster" {
name = module.eks-cluster.cluster_id
}
provider "kubernetes" {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data)
token = data.aws_eks_cluster_auth.cluster.token
load_config_file = false
}