-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcert-manager.tf
50 lines (46 loc) · 1.31 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
resource "kubernetes_namespace" "cert-manager-namespace" {
count = var.cert-manager ? 1 : 0
metadata {
name = "cert-manager"
}
}
resource "helm_release" "cert-manager" {
name = "cert-manager"
repository = "https://charts.jetstack.io"
chart = "cert-manager"
version = "v1.16.0"
namespace = "cert-manager"
count = var.cert-manager ? 1 : 0
// wait = true
// wait_for_jobs = true
values = [file("${path.module}/values/cert-manager.yaml")]
}
# resource "kubernetes_secret" "ca-key-pair" {
# metadata {
# name = "ca-key-pair"
# namespace = "cert-manager"
# }
# data = {
# "tls.crt" = file("./certs/cacerts.crt")
# "tls.key" = file("./certs/cacerts.key")
# }
# type = "kubernetes.io/tls"
# count = var.cert-manager ? 1 : 0
# }
# resource "time_sleep" "wait_x_seconds" {
# depends_on = [
# helm_release.cert-manager,
# # kubernetes_secret.ca-key-pair,
# kubernetes_namespace.cert-manager-namespace
# ]
# count = var.cert-manager ? 1 : 0
# create_duration = "20s"
# }
# resource "kubectl_manifest" "cluster-issuer" {
# depends_on = [
# time_sleep.wait_x_seconds,
# kubernetes_namespace.cert-manager-namespace
# ]
# yaml_body = file("${path.module}/values/cluster-issuer.yaml")
# count = var.cert-manager ? 1 : 0
# }