-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathfeast.tf
More file actions
121 lines (108 loc) · 3.26 KB
/
feast.tf
File metadata and controls
121 lines (108 loc) · 3.26 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
locals {
feast_postgres_secret_name = "${var.name_prefix}-postgres-secret"
feast_helm_values = {
redis = {
enabled = false
}
kafka = {
enabled = true
externalAccess = {
enabled = true
service = {
types = "LoadBalancer"
port = 9094
loadBalancerIPs = [google_compute_address.kafka_broker.address]
loadBalancerSourceRanges = ["10.0.0.0/8"]
annotations = {
"cloud.google.com/load-balancer-type" = "Internal"
}
}
}
}
grafana = {
enabled = false
}
postgresql = {
existingSecret = local.feast_postgres_secret_name
}
feast-core = {
postgresql = {
existingSecret = local.feast_postgres_secret_name
}
}
feast-serving = {
enabled = true
"application-override.yaml" = {
feast = {
core-host = "${var.name_prefix}-feast-core"
core-grpc-port = 6565
active_store = "online_store"
stores = [
{
name = "online_store"
type = "REDIS"
config = {
host = google_redis_instance.online_store.host
port = 6379
subscriptions = [
{
name = "*"
project = "*"
}
]
}
}
]
}
}
}
feast-jupyter = {
enabled = true
envOverrides = {
feast_redis_host = google_redis_instance.online_store.host,
feast_redis_port = 6379,
feast_spark_launcher = "dataproc"
feast_dataproc_cluster_name = google_dataproc_cluster.feast_dataproc_cluster.name
feast_dataproc_project = var.gcp_project_name
feast_dataproc_region = var.region
feast_spark_staging_location = "gs://${var.dataproc_staging_bucket}/artifacts/"
feast_historical_feature_output_location : "gs://${var.dataproc_staging_bucket}/out/"
feast_historical_feature_output_format : "parquet"
demo_kafka_brokers : "${google_compute_address.kafka_broker.address}:9094"
demo_data_location : "gs://${var.dataproc_staging_bucket}/test-data/"
}
gcpServiceAccount = {
enabled = true
name = var.feast_sa_secret_name
key = "credentials.json"
}
}
}
}
resource "random_password" "feast-postgres-password" {
length = 16
special = false
}
resource "kubernetes_secret" "feast-postgres-secret" {
metadata {
name = local.feast_postgres_secret_name
}
data = {
postgresql-password = random_password.feast-postgres-password.result
}
}
resource "google_compute_address" "kafka_broker" {
project = var.gcp_project_name
region = var.region
subnetwork = var.subnetwork
name = "${var.name_prefix}-kafka"
address_type = "INTERNAL"
}
resource "helm_release" "feast" {
depends_on = [kubernetes_secret.feast-postgres-secret, kubernetes_secret.feast_sa_secret]
name = var.name_prefix
chart = "https://feast-helm-charts.storage.googleapis.com/feast-0.100.4.tgz"
values = [
yamlencode(local.feast_helm_values)
]
}