-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheks.tf
More file actions
91 lines (85 loc) · 2.77 KB
/
Copy patheks.tf
File metadata and controls
91 lines (85 loc) · 2.77 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# 2 EKS Clusters, one in Virginia, one in Ohio
# Virginia EKS Cluster
data "aws_eks_cluster" "cluster-virginia" {
name = module.eks-virginia.cluster_id
provider = aws.virginia
}
data "aws_eks_cluster_auth" "cluster-virginia" {
name = module.eks-virginia.cluster_id
provider = aws.virginia
}
provider "kubernetes" {
host = data.aws_eks_cluster.cluster-virginia.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster-virginia.certificate_authority.0.data)
token = data.aws_eks_cluster_auth.cluster-virginia.token
load_config_file = false
version = "~> 1.9"
alias = "virginia"
}
module "eks-virginia" {
source = "terraform-aws-modules/eks/aws"
cluster_version = "1.18"
version = "13.0.0"
cluster_name = "virginia-cluster"
vpc_id = module.virginia-vpc.vpc_id
subnets = concat(module.virginia-vpc.private_subnets, module.virginia-vpc.public_subnets)
enable_irsa = true
workers_group_defaults = {
subnets = module.virginia-vpc.private_subnets
}
worker_groups = [
{
instance_type = "t3a.medium"
asg_max_size = 4
asg_min_size = 2
asg_desired_capacity = 2
}
]
providers = {
aws = aws.virginia
kubernetes = kubernetes.virginia
}
worker_additional_security_group_ids = [aws_security_group.allow-traffic-from-ohio-vpc.id]
}
# Ohio EKS Cluster
data "aws_eks_cluster" "cluster-ohio" {
name = module.eks-ohio.cluster_id
provider = aws.ohio
}
data "aws_eks_cluster_auth" "cluster-ohio" {
name = module.eks-ohio.cluster_id
provider = aws.ohio
}
provider "kubernetes" {
host = data.aws_eks_cluster.cluster-ohio.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster-ohio.certificate_authority.0.data)
token = data.aws_eks_cluster_auth.cluster-ohio.token
load_config_file = false
version = "~> 1.9"
alias = "ohio"
}
module "eks-ohio" {
source = "terraform-aws-modules/eks/aws"
cluster_version = "1.18"
version = "13.0.0"
cluster_name = "ohio-cluster"
vpc_id = module.ohio-vpc.vpc_id
subnets = concat(module.ohio-vpc.private_subnets, module.ohio-vpc.public_subnets)
enable_irsa = true
workers_group_defaults = {
subnets = module.ohio-vpc.private_subnets
}
worker_groups = [
{
instance_type = "t3a.medium"
asg_max_size = 4
asg_min_size = 2
asg_desired_capacity = 2
}
]
providers = {
aws = aws.ohio
kubernetes = kubernetes.ohio
}
worker_additional_security_group_ids = [aws_security_group.allow-traffic-from-virginia-vpc.id]
}