| 1 | locals { |
| 2 | dataplane_release_name = "dataplane" |
| 3 | |
| 4 | dpf_selector_url = "http://${local.controlplane_release_name}:8383/api/control/v1/dataplanes" |
| 5 | } |
| 6 | |
| 7 | resource "helm_release" "dataplane" { |
| 8 | name = local.dataplane_release_name |
| 9 | cleanup_on_fail = true |
| 10 | dependency_update = true |
| 11 | recreate_pods = true |
| 12 | chart = "./dataplane.tgz" |
| 13 | |
| 14 | values = [ |
| 15 | yamlencode({ |
| 16 | "dataplane" : { |
| 17 | "image" : { |
| 18 | "repository" : "eonax-data-plane-postgresql-hashicorpvault" |
| 19 | "tag" : "latest" |
| 20 | "pullPolicy" : "Never" |
| 21 | }, |
| 22 | "keys" : { |
| 23 | // use the same key pair for simplicity |
| 24 | "dataplane" : { |
| 25 | "privateKeyVaultAlias" : var.private_key_alias, |
| 26 | "publicKeyVaultAlias" : var.public_key_alias |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | "logging" : <<EOT |
| 31 | .level=INFO |
| 32 | org.eclipse.edc.level=ALL |
| 33 | handlers=java.util.logging.ConsoleHandler |
| 34 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter |
| 35 | java.util.logging.ConsoleHandler.level=ALL |
| 36 | java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n |
| 37 | EOT |
| 38 | |
| 39 | "config" : <<EOT |
| 40 | edc.vault.hashicorp.token.scheduled-renew-enabled=false |
| 41 | edc.dataplane.state-machine.iteration-wait-millis=${var.data_plane_state_machine_wait_millis} |
| 42 | EOT |
| 43 | "ingress" : { |
| 44 | "enabled" : true |
| 45 | "className" : "nginx" |
| 46 | "annotations" : { |
| 47 | "nginx.ingress.kubernetes.io/ssl-redirect" : "false" |
| 48 | "nginx.ingress.kubernetes.io/use-regex" : "true" |
| 49 | "nginx.ingress.kubernetes.io/rewrite-target" : "/api/$1$2" |
| 50 | }, |
| 51 | "endpoints" : [ |
| 52 | { |
| 53 | "port" : 8181, |
| 54 | "path" : "/dp/(public)(.*)" |
| 55 | }, |
| 56 | { |
| 57 | "port" : 8282, |
| 58 | "path" : "/dp/(data)(.*)" |
| 59 | } |
| 60 | ] |
| 61 | }, |
| 62 | |
| 63 | "selector" : { |
| 64 | "url" : local.dpf_selector_url |
| 65 | } |
| 66 | |
| 67 | "url" : { |
| 68 | "public" : var.data_plane_public_url |
| 69 | }, |
| 70 | |
| 71 | "postgresql" : { |
| 72 | "jdbcUrl" : "jdbc:postgresql://${var.db_server_fqdn}/${var.db_name}", |
| 73 | "credentials" : { |
| 74 | "secret" : { |
| 75 | "name" : kubernetes_secret.db-user-credentials.metadata.0.name |
| 76 | } |
| 77 | } |
| 78 | }, |
| 79 | "vault" : { |
| 80 | "hashicorp" : { |
| 81 | "url" : var.vault_url |
| 82 | "token" : { |
| 83 | "secret" : { |
| 84 | "name" : var.vault_token_secret_name |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | }) |
| 91 | ] |
| 92 | |
| 93 | depends_on = [module.db, helm_release.controlplane] |
| 94 | } |