-
Notifications
You must be signed in to change notification settings - Fork 13
Update Safespring loadbalancer configuration to support kube-vip #2890
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
This file contains hidden or 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 hidden or 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,15 @@ | ||
| networkPolicies: | ||
| global: | ||
| externalLoadBalancer: false | ||
| ingressUsingHostNetwork: false | ||
| ingressNginx: | ||
| ingressOverride: | ||
| enabled: true | ||
| ips: | ||
| - 0.0.0.0/0 | ||
| ingressNginx: | ||
| controller: | ||
| service: | ||
| enabled: true | ||
| type: LoadBalancer | ||
| useHostPort: false | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -83,11 +83,13 @@ RUN curl -LOs "https://github.com/getsops/sops/releases/download/v${SOPS_VERSION | |
|
|
||
| ARG YAJSV_VERSION="1.4.1" | ||
| RUN curl -LOs "https://github.com/neilpa/yajsv/releases/download/v${YAJSV_VERSION}/yajsv.linux.amd64" && \ | ||
| echo "4bd6d2b1d6292ab1f7ba63db83c182a603a790d431429cf71f05cb0fcc677def yajsv.linux.amd64" | sha256sum -c - && \ | ||
| install -Tm 755 yajsv.linux.amd64 /usr/local/bin/yajsv && \ | ||
| rm yajsv.linux.amd64 | ||
|
|
||
| ARG YQ_VERSION="4.45.1" | ||
| RUN curl -LOs "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64" && \ | ||
| echo "654d2943ca1d3be2024089eb4f270f4070f491a0610481d128509b2834870049 yq_linux_amd64" | sha256sum -c - && \ | ||
|
Contributor
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. Neat way of validating hash inline |
||
| install -Tm 755 yq_linux_amd64 /usr/local/bin/yq && \ | ||
| rm yq_linux_amd64 | ||
|
|
||
|
|
||
73 changes: 73 additions & 0 deletions
73
tests/unit/safespring/bin-init-separate-installer-configs.bats
This file contains hidden or 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,73 @@ | ||
| #!/usr/bin/env bats | ||
|
|
||
| # bats file_tags=static,bin:init,safespring | ||
|
|
||
| setup_file() { | ||
| load "../../bats.lib.bash" | ||
| load_common "env.bash" | ||
| load_common "gpg.bash" | ||
| load_common "yq.bash" | ||
|
|
||
| gpg.setup | ||
| env.setup | ||
|
|
||
| } | ||
|
|
||
| setup() { | ||
| load "../../bats.lib.bash" | ||
| load_common "env.bash" | ||
| load_common "yq.bash" | ||
|
|
||
| load_assert | ||
| load_file | ||
| load "../templates/bin-init.bash" | ||
|
|
||
| env.private | ||
| } | ||
|
|
||
| teardown() { | ||
| env.teardown | ||
| } | ||
|
|
||
| teardown_file() { | ||
| env.teardown | ||
| gpg.teardown | ||
| } | ||
|
|
||
| @test "config is different - safespring:capi:prod" { | ||
| env.init safespring capi prod | ||
| test_init_successful | ||
|
|
||
| assert_equal "$(yq.get sc '.networkPolicies.global.externalLoadBalancer')" "false" | ||
| assert_equal "$(yq.get sc '.networkPolicies.global.ingressUsingHostNetwork')" "false" | ||
| assert_equal "$(yq.get sc '.networkPolicies.ingressNginx.ingressOverride.enabled')" "true" | ||
| assert_equal "$(yq.get sc '.networkPolicies.ingressNginx.ingressOverride.ips[0]')" "0.0.0.0/0" | ||
| assert_equal "$(yq.get sc '.ingressNginx.controller.service.enabled')" "true" | ||
| assert_equal "$(yq.get sc '.ingressNginx.controller.service.type')" "LoadBalancer" | ||
| assert_equal "$(yq.get sc '.ingressNginx.controller.useHostPort')" "false" | ||
| assert_equal "$(yq.get wc '.networkPolicies.global.externalLoadBalancer')" "false" | ||
| assert_equal "$(yq.get wc '.networkPolicies.global.ingressUsingHostNetwork')" "false" | ||
| assert_equal "$(yq.get wc '.networkPolicies.ingressNginx.ingressOverride.enabled')" "true" | ||
| assert_equal "$(yq.get wc '.networkPolicies.ingressNginx.ingressOverride.ips[0]')" "0.0.0.0/0" | ||
| assert_equal "$(yq.get wc '.ingressNginx.controller.service.enabled')" "true" | ||
| assert_equal "$(yq.get wc '.ingressNginx.controller.service.type')" "LoadBalancer" | ||
| assert_equal "$(yq.get wc '.ingressNginx.controller.useHostPort')" "false" | ||
| } | ||
|
|
||
| @test "config is different - safespring:kubespray:prod" { | ||
| env.init safespring kubespray prod | ||
| test_init_successful | ||
|
|
||
| assert_equal "$(yq.get sc '.networkPolicies.global.externalLoadBalancer')" "true" | ||
| assert_equal "$(yq.get sc '.networkPolicies.global.ingressUsingHostNetwork')" "true" | ||
| assert_equal "$(yq.get sc '.networkPolicies.ingressNginx.ingressOverride.enabled')" "false" | ||
| assert_equal "$(yq.get sc '.ingressNginx.controller.service.enabled')" "false" | ||
| assert_equal "$(yq.get sc '.ingressNginx.controller.service.type')" "NodePort" | ||
| assert_equal "$(yq.get sc '.ingressNginx.controller.useHostPort')" "true" | ||
| assert_equal "$(yq.get wc '.networkPolicies.global.externalLoadBalancer')" "true" | ||
| assert_equal "$(yq.get wc '.networkPolicies.global.ingressUsingHostNetwork')" "true" | ||
| assert_equal "$(yq.get wc '.networkPolicies.ingressNginx.ingressOverride.enabled')" "false" | ||
| assert_equal "$(yq.get wc '.ingressNginx.controller.service.enabled')" "false" | ||
| assert_equal "$(yq.get wc '.ingressNginx.controller.service.type')" "NodePort" | ||
| assert_equal "$(yq.get wc '.ingressNginx.controller.useHostPort')" "true" | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.