This repository has been archived by the owner on Dec 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.tf
73 lines (61 loc) · 1.59 KB
/
deployment.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
resource "kubernetes_deployment" "metrics" {
metadata {
name = "kube-state-metrics"
namespace = "kube-system"
labels = local.metadata_labels
}
spec {
replicas = 1
selector {
match_labels = {
"app.kubernetes.io/name" = local.metadata_labels["app.kubernetes.io/name"]
}
}
template {
metadata {
labels = local.metadata_labels
}
spec {
service_account_name = kubernetes_service_account.metrics.metadata.0.name
automount_service_account_token = true
node_selector = {
"kubernetes.io/os" = "linux"
}
container {
name = "kube-state-metrics"
image = "registry.k8s.io/kube-state-metrics/kube-state-metrics:v${local.version}"
port {
name = "http-metrics"
container_port = 8080
}
port {
name = "telemetry"
container_port = 8081
}
readiness_probe {
http_get {
path = "/"
port = 8081
}
}
liveness_probe {
http_get {
path = "/healthz"
port = 8080
}
initial_delay_seconds = 5
timeout_seconds = 5
}
security_context {
run_as_user = 65534
allow_privilege_escalation = false
read_only_root_filesystem = true
capabilities {
drop = ["ALL"]
}
}
}
}
}
}
}