-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathadmissionregistration.tf
70 lines (69 loc) · 2 KB
/
admissionregistration.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
resource "kubernetes_validating_webhook_configuration" "linkerd_sp_validator" {
metadata {
name = "linkerd-sp-validator-webhook-config"
labels = merge(local.linkerd_label_control_plane_ns, {
"linkerd.io/control-plane-component" = local.linkerd_sp_validator_name
})
}
webhook {
name = "linkerd-sp-validator.linkerd.io"
namespace_selector {
match_expressions {
key = "config.linkerd.io/admission-webhooks"
operator = "NotIn"
values = ["disabled"]
}
}
admission_review_versions = ["v1", "v1beta1"]
client_config {
service {
name = local.linkerd_sp_validator_name
namespace = local.linkerd_namespace
path = "/"
}
ca_bundle = base64encode(local.validating_webhook_ca_bundle)
}
failure_policy = "Ignore"
rule {
api_groups = ["linkerd.io"]
api_versions = ["v1alpha1", "v1alpha2"]
operations = ["CREATE", "UPDATE"]
resources = ["serviceprofiles"]
}
side_effects = "None"
}
}
resource "kubernetes_mutating_webhook_configuration" "linkerd_proxy_injector" {
metadata {
name = "linkerd-proxy-injector-webhook-config"
labels = merge(local.linkerd_label_control_plane_ns, {
"linkerd.io/control-plane-component" = local.linkerd_proxy_injector_name
})
}
webhook {
name = "linkerd-proxy-injector.linkerd.io"
namespace_selector {
match_expressions {
key = "config.linkerd.io/admission-webhooks"
operator = "NotIn"
values = ["disabled"]
}
}
admission_review_versions = ["v1", "v1beta1"]
client_config {
service {
name = local.linkerd_proxy_injector_name
namespace = local.linkerd_namespace
path = "/"
}
ca_bundle = base64encode(local.mutating_webhook_ca_bundle)
}
rule {
api_groups = [""]
api_versions = ["v1"]
operations = ["CREATE"]
resources = ["pods"]
}
side_effects = "None"
}
}