Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #47 from xoap-io/dev
Browse files Browse the repository at this point in the history
added additional ingresses
  • Loading branch information
bbrauneck authored Apr 26, 2023
2 parents 0791a4f + b374361 commit a86284a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.3.6
uses: dependabot/fetch-metadata@v1.4.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Approve a PR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/megalinter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fetch-depth: 0
- name: MegaLinter
id: ml
uses: megalinter/megalinter/flavors/terraform@v6.18.0
uses: megalinter/megalinter/flavors/terraform@v6.22.2
env:
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_additional_hosts"></a> [additional\_hosts](#input\_additional\_hosts) | Map of additional hosts to be added to the ingress. | `map(string)` | `{}` | no |
| <a name="input_context"></a> [context](#input\_context) | Default environmental context | <pre>object({<br> organization = string<br> environment = string<br> account = string<br> product = string<br> tags = map(string)<br> })</pre> | n/a | yes |
| <a name="input_environment_variables"></a> [environment\_variables](#input\_environment\_variables) | Map with environment variables injected to the containers. | `map(any)` | n/a | yes |
| <a name="input_hpa"></a> [hpa](#input\_hpa) | Object with autoscaler limits and requests. | <pre>object({<br> max_replicas = number<br> min_replicas = number<br> target_cpu_utilization_percentage = number<br> })</pre> | n/a | yes |
Expand Down
20 changes: 20 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,26 @@ resource "kubernetes_ingress_v1" "this" {
}
}
}
dynamic "rule" {
for_each = var.additional_hosts
content {
host = rule.key
http {
path {
path = rule.value

backend {
service {
name = kubernetes_service.this[0].metadata[0].name
port {
number = var.service.target_port
}
}
}
}
}
}
}
}
lifecycle {
ignore_changes = [
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ variable "paths" {
description = "Object mapping local paths to container paths"
default = {}
}

variable "additional_hosts" {
type = map(string)
description = "Map of additional hosts to be added to the ingress."
default = {}
}
variable "namespace" {
type = string
description = "Kubernetes namespace where resources must be created."
Expand Down

0 comments on commit a86284a

Please sign in to comment.