Skip to content

Commit

Permalink
fix: Make MIW / Keycloak constant static IPs as variables (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
hemantxpatel authored Mar 20, 2024
1 parent 55c8231 commit 86c9866
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions mxd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ Alternatively, please check out the [Postman collections here](./postman)
* [File Transfer: Amazon S3 to Azure Blob Storage](./docs/File%20Transfer%20S3%20to%20Azure.md)
* [Simplify negotiation and transfer using the EDR API](./docs/EDR%20Transfer%20Tutorial.md)
* [Add a new Participant](./docs/Trudy%20Connector%20Tutorial.md)
* [Deploying MXD on Remote Kubernetes Cluster (AWS / GCP)](./docs/MXD%20Remote%20Deployment.md)

## 4. Improving the setup

Expand Down
13 changes: 13 additions & 0 deletions mxd/docs/MXD Remote Deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Deploying MXD on Remote Kubernetes Cluster (AWS / GCP)

We should be able to deploy MXD on a Kubernetes cluster deployed on a local machine / computer as per the steps defined in the [MXD README](../README.md#2-basic-dataspace-setup).
But there are certain changes needed if we want to deploy it on a remote Kubernetes cluster.

## Provide Static IP for MIW / Keycloak
MIW and Keycloak both require static IPs.
Different Kubernetes clusters may have different allowed IP ranges.
So, we can pass these IPs as Terraform variable while running `terraform apply`.

```shell
terraform.exe apply -var miw-static-ip="10.96.81.225" -var keycloak-static-ip="10.96.103.90"
```
2 changes: 1 addition & 1 deletion mxd/keycloak.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@ resource "kubernetes_service" "keycloak" {
}

locals {
keycloak-ip = "10.96.103.80"
keycloak-ip = var.keycloak-static-ip
keycloak-url = "${local.keycloak-ip}:${var.keycloak-port}"
}
2 changes: 1 addition & 1 deletion mxd/miw.tf
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ resource "kubernetes_service" "miw" {
}

locals {
miw-ip = "10.96.81.222"
miw-ip = var.miw-static-ip
miw-url = "${local.miw-ip}:${var.miw-api-port}"
keycloak-realm = "miw_test"
}
8 changes: 8 additions & 0 deletions mxd/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@ variable "postgres-port" {
default = 5432
}

variable "keycloak-static-ip" {
default = "10.96.103.80"
}

variable "keycloak-port" {
default = 8080
}

variable "miw-static-ip" {
default = "10.96.81.222"
}

variable "miw-api-port" {
default = 8000
}
Expand Down

0 comments on commit 86c9866

Please sign in to comment.