-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
120 lines (112 loc) · 2.53 KB
/
main.tf
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
module "vpc" {
source = "./modules/vpc"
region = var.region
profile = var.profile
name = var.eks_vpc_name
}
module "eks" {
source = "./modules/eks"
region = var.region
profile = var.profile
cluster_name = var.cluster_name
eks_vpc_id = module.vpc.vpc_id
private_subnets = module.vpc.private_subnets
}
# module "loadbalancer-controller" {
# depends_on = [module.eks]
# source = "./modules/loadbalancer-controller"
# oidc_provider_arn = module.eks.oidc_provider_arn
# name = var.nlb_name
# cluster_name = module.eks.cluster_name
# region = var.region
# vpc_id = module.vpc.vpc_id
# }
#################################
# SEQ
#################################
resource "kubernetes_namespace" "fiap_log" {
metadata {
name = "fiap-log"
}
}
resource "kubernetes_service" "svc_seq" {
metadata {
name = "api-internal"
namespace = kubernetes_namespace.fiap_log.metadata.0.name
labels = {
"terraform" = true
}
annotations = {
"service.beta.kubernetes.io/aws-load-balancer-type" = "nlb"
"service.beta.kubernetes.io/aws-load-balancer-scheme" = "internal"
}
}
spec {
type = "LoadBalancer"
port {
port = 80
node_port = 30008
}
selector = {
app = "seq"
}
}
}
resource "kubernetes_deployment" "deployment_seq" {
metadata {
name = "deployment-seq"
namespace = kubernetes_namespace.fiap_log.metadata.0.name
labels = {
app = "seq"
"terraform" = true
}
}
spec {
replicas = 1
selector {
match_labels = {
app = "seq"
}
}
template {
metadata {
name = "pod-seq"
labels = {
app = "seq"
"terraform" = true
}
}
spec {
automount_service_account_token = false
container {
name = "seq-container"
image = "datalust/seq:latest"
port {
container_port = 80
}
image_pull_policy = "IfNotPresent"
env {
name = "ACCEPT_EULA"
value = "Y"
}
resources {
requests = {
cpu = "50m"
memory = "120Mi"
}
limits = {
cpu = "100m"
memory = "220Mi"
}
}
}
volume {
name = "dashboards-volume"
host_path {
path = "/home/docker/seq"
}
}
}
}
}
}