-
Notifications
You must be signed in to change notification settings - Fork 10
/
cert-manager.tf
85 lines (84 loc) · 2.68 KB
/
cert-manager.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
locals {
cert_manager_ingress_ca_manifests = [
# see https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.ClusterIssuer
{
apiVersion = "cert-manager.io/v1"
kind = "ClusterIssuer"
metadata = {
name = "selfsigned"
}
spec = {
selfSigned = {}
}
},
# see https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.Certificate
{
apiVersion = "cert-manager.io/v1"
kind = "Certificate"
metadata = {
name = "ingress"
namespace = "cert-manager"
}
spec = {
isCA = true
subject = {
organizations = [
var.ingress_domain,
]
organizationalUnits = [
"Kubernetes",
]
}
commonName = "Kubernetes Ingress"
privateKey = {
algorithm = "ECDSA" # NB Ed25519 is not yet supported by chrome 93 or firefox 91.
size = 256
}
duration = "4320h" # NB 4320h (180 days). default is 2160h (90 days).
secretName = "ingress-tls"
issuerRef = {
name = "selfsigned"
kind = "ClusterIssuer"
group = "cert-manager.io"
}
}
},
# see https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.ClusterIssuer
{
apiVersion = "cert-manager.io/v1"
kind = "ClusterIssuer"
metadata = {
name = "ingress"
}
spec = {
ca = {
secretName = "ingress-tls"
}
}
},
]
cert_manager_ingress_ca_manifest = join("---\n", [for d in local.cert_manager_ingress_ca_manifests : yamlencode(d)])
}
# NB YOU CANNOT INSTALL MULTIPLE INSTANCES OF CERT-MANAGER IN A CLUSTER.
# see https://artifacthub.io/packages/helm/cert-manager/cert-manager
# see https://github.com/cert-manager/cert-manager/tree/master/deploy/charts/cert-manager
# see https://cert-manager.io/docs/installation/supported-releases/
# see https://cert-manager.io/docs/configuration/selfsigned/#bootstrapping-ca-issuers
# see https://cert-manager.io/docs/usage/ingress/
# see https://registry.terraform.io/providers/hashicorp/helm/latest/docs/data-sources/template
data "helm_template" "cert_manager" {
namespace = "cert-manager"
name = "cert-manager"
repository = "https://charts.jetstack.io"
chart = "cert-manager"
# renovate: datasource=helm depName=cert-manager registryUrl=https://charts.jetstack.io
version = "1.16.1"
kube_version = var.kubernetes_version
api_versions = []
# NB installCRDs is generally not recommended, BUT since this
# is a development cluster we YOLO it.
set {
name = "installCRDs"
value = "true"
}
}