-
Notifications
You must be signed in to change notification settings - Fork 0
/
filestore.tf
66 lines (62 loc) · 1.45 KB
/
filestore.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
resource "google_filestore_instance" "filestore" {
provider = google-beta
name = "ctfd"
location = var.google_zone
tier = "BASIC_HDD"
file_shares {
capacity_gb = 1024
name = "share1"
nfs_export_options {
ip_ranges = ["10.0.0.0/24", "10.132.0.0/20"]
access_mode = "READ_WRITE"
squash_mode = "NO_ROOT_SQUASH"
}
}
networks {
network = google_compute_network.blue_net.name
modes = ["MODE_IPV4"]
}
}
resource "kubernetes_persistent_volume_claim" "ctfd" {
metadata {
name = "ctfd"
namespace = kubernetes_namespace.ctfd.metadata.0.name
}
spec {
access_modes = ["ReadWriteMany"]
storage_class_name = "standard"
resources {
requests = {
storage = "100Gi"
}
}
volume_name = kubernetes_persistent_volume.ctfd.metadata.0.name
}
depends_on = [
kubernetes_namespace.ctfd,
kubernetes_persistent_volume.ctfd,
google_container_node_pool.primary
]
}
resource "kubernetes_persistent_volume" "ctfd" {
metadata {
name = "fileserver"
}
spec {
capacity = {
storage = "1T"
}
access_modes = ["ReadWriteMany"]
storage_class_name = "standard"
persistent_volume_source {
nfs {
path = "/share1"
server = google_filestore_instance.filestore.networks.0.ip_addresses.0
}
}
}
depends_on = [
google_container_cluster.primary,
google_container_node_pool.primary
]
}