generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add orchestration resources to Terraform #30
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
816f489
add orchestration chart to terraform deployments
emmastephenson 4e343b6
Merge branch 'main' of https://github.com/CDCgov/phdi-playground into…
emmastephenson 8da39f6
temp change to use 'orchestration' instead of 'orchestration-chart'
emmastephenson 1477ec9
remove orchestration from foreach
emmastephenson cd66ff3
add release specific to ingress
emmastephenson 022ac4f
change chart name
emmastephenson 6de683e
update ingress release
emmastephenson 7eb7393
change value names for URLS
emmastephenson 3833064
remove quotes around secret values
emmastephenson 7cebbbd
remove trailing slash
emmastephenson 26845c2
add full URL path (https)
emmastephenson bf682a6
add message parsing block
emmastephenson 0a6d214
update name
emmastephenson e874ac5
wip
emmastephenson 8f2c341
update services_to_chart map
emmastephenson 60614b7
change release name
emmastephenson 81bf00f
update release name
emmastephenson dcc0bef
add orchestration chart to main release
emmastephenson fa54cf2
remove new
emmastephenson 5c64cf4
remove https for hostname
emmastephenson f818035
update ingress locally - temp
emmastephenson 4cad8eb
update ingress locally
emmastephenson 5fedc60
change ingress name to temp
emmastephenson 554f968
update chart
emmastephenson e10b6aa
make ingress service names dynamic
emmastephenson 1a136f1
update the right values block
emmastephenson 096fa56
update ingress hostname
emmastephenson 4b521b5
add ingress back to regular chart installation
emmastephenson 02ae93b
temp remove ingress to make deployment happy
emmastephenson 04cb661
ingress is back
emmastephenson 70121c0
temp remove orchestration chart
emmastephenson 05e48b9
add orchestration back
emmastephenson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,16 +19,21 @@ locals { | |
resource_group_name = var.resource_group_name, | ||
subscription_id = var.subscription_id, | ||
})) | ||
} | ||
|
||
services = toset([ | ||
"fhir-converter", | ||
"ingestion", | ||
"ingress", | ||
"message-parser", | ||
"validation", | ||
]) | ||
variable "services_to_chart" { | ||
type = map(string) | ||
default = { | ||
fhir-converter = "fhir-converter-chart", | ||
ingestion = "ingestion-chart", | ||
ingress = "ingress-chart", | ||
message-parser = "message-parser-chart", | ||
orchestration = "orchestration", | ||
validation = "validation-chart" | ||
} | ||
} | ||
|
||
|
||
# Service Principal | ||
resource "azuread_application" "aks" { | ||
display_name = "phdi-playground-${terraform.workspace}-aks" | ||
|
@@ -320,19 +325,20 @@ spec: | |
YAML | ||
} | ||
|
||
# Helm Releases | ||
|
||
resource "helm_release" "building_blocks" { | ||
for_each = local.services | ||
repository = "https://cdcgov.github.io/phdi-charts/" | ||
name = "phdi-playground-${terraform.workspace}-${each.key}" | ||
chart = "${each.key}-chart" | ||
recreate_pods = true | ||
depends_on = [helm_release.agic] | ||
for_each = var.services_to_chart | ||
repository = "https://cdcgov.github.io/phdi-charts/" | ||
name = "phdi-playground-${terraform.workspace}-${each.key}" | ||
chart = each.value | ||
depends_on = [helm_release.agic] | ||
force_update = true | ||
recreate_pods = true | ||
cleanup_on_fail = true | ||
|
||
set { | ||
name = "image.tag" | ||
value = "latest" | ||
value = "v1.1.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
|
||
} | ||
|
||
set { | ||
|
@@ -349,8 +355,56 @@ resource "helm_release" "building_blocks" { | |
name = "ingressHostname" | ||
value = "${var.resource_group_name}-${terraform.workspace}.${var.location}.cloudapp.azure.com" | ||
} | ||
|
||
# Service names needed for ingress routes | ||
set { | ||
name = "ingestionServiceName" | ||
value = "phdi-playground-${terraform.workspace}-ingestion-ingestion-service" | ||
} | ||
|
||
set { | ||
name = "fhirConverterServiceName" | ||
value = "phdi-playground-${terraform.workspace}-fhir-converter-fhir-converter-service" | ||
} | ||
|
||
set { | ||
name = "messageParserServiceName" | ||
value = "phdi-playground-${terraform.workspace}-message-parser-message-parser-service" | ||
} | ||
|
||
set { | ||
name = "validationServiceName" | ||
value = "phdi-playground-${terraform.workspace}-validation-validation-service" | ||
} | ||
|
||
set { | ||
name = "orchestrationServiceName" | ||
value = "phdi-playground-${terraform.workspace}-orchestration-orchestration-service" | ||
} | ||
|
||
# Values needed for orchestration service | ||
set { | ||
name = "fhirConverterUrl" | ||
value = "https://${var.resource_group_name}-${terraform.workspace}.${var.location}.cloudapp.azure.com/fhir-converter" | ||
} | ||
|
||
set { | ||
name = "ingestionUrl" | ||
value = "https://${var.resource_group_name}-${terraform.workspace}.${var.location}.cloudapp.azure.com/ingestion" | ||
} | ||
|
||
set { | ||
name = "messageParserUrl" | ||
value = "https://${var.resource_group_name}-${terraform.workspace}.${var.location}.cloudapp.azure.com/message-parser" | ||
} | ||
|
||
set { | ||
name = "validationUrl" | ||
value = "https://${var.resource_group_name}-${terraform.workspace}.${var.location}.cloudapp.azure.com/validation" | ||
} | ||
} | ||
|
||
|
||
# Metrics Dashboard | ||
|
||
resource "azurerm_portal_dashboard" "pipeline_metrics" { | ||
|
@@ -388,7 +442,7 @@ resource "kubectl_manifest" "keda_trigger" { | |
} | ||
|
||
resource "kubectl_manifest" "keda_scaled_object" { | ||
for_each = local.services | ||
for_each = var.services_to_chart | ||
depends_on = [kubectl_manifest.keda_trigger] | ||
yaml_body = data.kubectl_path_documents.keda_scaled_object[each.key].documents[0] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note:
orchestration-chart
didn't work because the name kept cutting off right atorchestration-
and TF would complain that it was an invalid name. The solution here was to rename the chart at the Helm level, and create this mapping to track microservice name <=> chart name.