-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add acceptance tests for VirtualMachine labels (tags) and LoadBalancer resources. The labeling/tagging mechnism is crucial for these tests to work, since a LoadBalancer is required by the admission webhook to have at least one VM that matches its selectors. Also improve documentation. Signed-off-by: Moritz Röhrich <[email protected]>
- Loading branch information
1 parent
e8d42ae
commit e029365
Showing
10 changed files
with
296 additions
and
35 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
resource "harvester_loadbalancer" "service_loadbalancer" { | ||
name = "service-loadbalancer" | ||
|
||
# This ensures correct ordering for the creation of the resources. | ||
# The loadbalancer resource will be rejected by the admission webhook, if not | ||
# at least one virtual machine with labels matching the backend_selector(s) | ||
# already exists. This dependency ordering can be used to create that virtual | ||
# machine with the same Terraform file. | ||
depends_on = [ | ||
harvester_virtualmachine.name | ||
] | ||
|
||
listener { | ||
port = 443 | ||
protocol = "tcp" | ||
backend_port = 8080 | ||
} | ||
|
||
listener { | ||
port = 80 | ||
protocol = "tcp" | ||
backend_port = 8080 | ||
} | ||
|
||
ipam = "ippool" | ||
ippool = "service-ips" | ||
|
||
workload_type = "vm" | ||
|
||
backend_selector { | ||
key = "app" | ||
values = [ "test" ] | ||
} | ||
|
||
backend_selector { | ||
key = "component" | ||
values = [ "frontend", "ui" ] | ||
} | ||
|
||
healthcheck { | ||
port = 443 | ||
success_threshold = 1 | ||
failure_threshold = 3 | ||
period_seconds = 10 | ||
timeout_seconds = 5 | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.