|
| 1 | +locals { |
| 2 | + feast_postgres_secret_name = "${var.name_prefix}-postgres-secret" |
| 3 | + feast_helm_values = { |
| 4 | + redis = { |
| 5 | + enabled = false |
| 6 | + } |
| 7 | + |
| 8 | + grafana = { |
| 9 | + enabled = false |
| 10 | + } |
| 11 | + |
| 12 | + kafka = { |
| 13 | + enabled = false |
| 14 | + } |
| 15 | + |
| 16 | + postgresql = { |
| 17 | + existingSecret = local.feast_postgres_secret_name |
| 18 | + } |
| 19 | + |
| 20 | + feast-core = { |
| 21 | + postgresql = { |
| 22 | + existingSecret = local.feast_postgres_secret_name |
| 23 | + } |
| 24 | + } |
| 25 | + |
| 26 | + feast-online-serving = { |
| 27 | + enabled = true |
| 28 | + "application-override.yaml" = { |
| 29 | + feast = { |
| 30 | + core-host = "${var.name_prefix}-feast-core" |
| 31 | + core-grpc-port = 6565 |
| 32 | + active_store = "online_store" |
| 33 | + stores = [ |
| 34 | + { |
| 35 | + name = "online_store" |
| 36 | + type = "REDIS" |
| 37 | + config = { |
| 38 | + host = azurerm_redis_cache.main.hostname |
| 39 | + port = azurerm_redis_cache.main.ssl_port |
| 40 | + ssl = true |
| 41 | + } |
| 42 | + } |
| 43 | + ] |
| 44 | + } |
| 45 | + } |
| 46 | + } |
| 47 | + |
| 48 | + feast-jupyter = { |
| 49 | + enabled = true |
| 50 | + envOverrides = { |
| 51 | + feast_redis_host = azurerm_redis_cache.main.hostname, |
| 52 | + feast_redis_port = azurerm_redis_cache.main.ssl_port, |
| 53 | + feast_redis_ssl = true |
| 54 | + feast_spark_launcher = "k8s" |
| 55 | + feast_spark_staging_location = "wasbs://${azurerm_storage_container.staging.name}@${azurerm_storage_account.main.name}.blob.core.windows.net/artifacts/" |
| 56 | + feast_historical_feature_output_location : "wasbs://${azurerm_storage_container.staging.name}@${azurerm_storage_account.main.name}.blob.core.windows.net/out/" |
| 57 | + feast_historical_feature_output_format : "parquet" |
| 58 | + demo_data_location : "wasbs://${azurerm_storage_container.staging.name}@${azurerm_storage_account.main.name}.blob.core.windows.net/test-data/" |
| 59 | + feast_azure_blob_account_name = azurerm_storage_account.main.name |
| 60 | + feast_azure_blob_account_access_key = azurerm_storage_account.main.primary_access_key |
| 61 | + } |
| 62 | + } |
| 63 | + } |
| 64 | +} |
| 65 | + |
| 66 | +resource "random_password" "feast-postgres-password" { |
| 67 | + length = 16 |
| 68 | + special = false |
| 69 | +} |
| 70 | + |
| 71 | +resource "kubernetes_secret" "feast-postgres-secret" { |
| 72 | + metadata { |
| 73 | + name = local.feast_postgres_secret_name |
| 74 | + } |
| 75 | + data = { |
| 76 | + postgresql-password = random_password.feast-postgres-password.result |
| 77 | + } |
| 78 | +} |
| 79 | + |
| 80 | +resource "helm_release" "feast" { |
| 81 | + depends_on = [kubernetes_secret.feast-postgres-secret] |
| 82 | + |
| 83 | + name = var.name_prefix |
| 84 | + namespace = var.aks_namespace |
| 85 | + chart = "../../charts/feast" |
| 86 | + |
| 87 | + values = [ |
| 88 | + yamlencode(local.feast_helm_values) |
| 89 | + ] |
| 90 | +} |
| 91 | + |
| 92 | +resource "helm_release" "sparkop" { |
| 93 | + name = "sparkop" |
| 94 | + namespace = "default" |
| 95 | + repository = "https://googlecloudplatform.github.io/spark-on-k8s-operator" |
| 96 | + chart = "spark-operator" |
| 97 | + set { |
| 98 | + name = "serviceAccounts.spark.name" |
| 99 | + value = "spark" |
| 100 | + } |
| 101 | +} |
0 commit comments