-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnamespace.tf
80 lines (73 loc) · 2.03 KB
/
namespace.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
# Create Kubeflow namespace
data "kustomization_build" "kubeflow-namespace" {
path = "github.com/kubeflow/manifests.git/common/kubeflow-namespace/base?ref=${var.kf_version}"
}
resource "kubectl_manifest" "kubeflow-namespace" {
for_each = data.kustomization_build.kubeflow-namespace.ids
yaml_body = yamlencode(jsondecode(data.kustomization_build.kubeflow-namespace.manifests[each.value]))
wait = true
depends_on = [
kustomization_resource.istio-base,
kustomization_resource.istio-ingress,
kustomization_resource.cert-manager-base,
]
}
# Create User namespace
data "kustomization_overlay" "user-namespace" {
config_map_generator {
name = "default-install-config"
behavior = "replace"
envs = [
]
literals = [
"user=${var.dex_user_email}",
"profile-name=${var.user_profile_name}"
]
}
resources = [
"github.com/kubeflow/manifests.git/common/user-namespace/base?ref=${var.kf_version}",
]
}
resource "kubectl_manifest" "user-namespace" {
for_each = data.kustomization_overlay.user-namespace.ids
yaml_body = yamlencode(jsondecode(data.kustomization_overlay.user-namespace.manifests[each.value]))
wait = true
depends_on = [
kustomization_resource.profiles,
kustomization_resource.cert-manager-base,
]
}
# KnativeServing namespace
resource "kubectl_manifest" "serving-namespace" {
count = var.deploy_serving ? 1 : 0
yaml_body = <<YAML
apiVersion: v1
kind: Namespace
metadata:
name: knative-serving
labels:
serving.knative.dev/release: "v0.22.1"
YAML
wait = true
depends_on = [
kustomization_resource.istio-base,
kubectl_manifest.kubeflow-namespace,
]
}
# KnativeEventing namespace
resource "kubectl_manifest" "eventing-namespace" {
count = var.deploy_serving ? 1 : 0
yaml_body = <<YAML
apiVersion: v1
kind: Namespace
metadata:
name: knative-eventing
labels:
eventing.knative.dev/release: "v0.22.1"
YAML
wait = true
depends_on = [
kustomization_resource.istio-base,
kubectl_manifest.kubeflow-namespace,
]
}