-
Notifications
You must be signed in to change notification settings - Fork 28
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 support for RouteGroups #251
Merged
Merged
Conversation
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
c47ca35
to
538237d
Compare
Pull Request Test Coverage Report for Build 1869
💛 - Coveralls |
538237d
to
96e266c
Compare
96e266c
to
f07e0ff
Compare
aryszka
approved these changes
Sep 17, 2020
👍 |
f07e0ff
to
25dceec
Compare
👍 |
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
25dceec
to
5956316
Compare
👍 |
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
👍 |
👍 |
Some low hanging fruits to improve the coverage:
|
jonathanbeber
pushed a commit
that referenced
this pull request
Nov 17, 2020
The HTTP resources (Ingresses and RouteGroups) migration, introduced on the [#251][0], checks for the `CreationTimestamp` attribute of the resources. When the migration follows the path of: 1. adding a new resource (does not matter if it's an Ingress or RouteGroup) with a new hostname for migration and testing purposes; 2. validating the configuration of the new resource. 3. dropping the old resource in favor of the new one. For that the new resource receives the actual hostname. the controller does not respect the `IngressSourceSwitchTTL` duration as expected. During the 3rd step, the `CreationTimestamp` attribute of the new resource tends to be greater than the `IngressSourceSwitchTTL` configuration, due to the time spent in the 2nd step. That leads to the almost instantaneous deletion of the old resource, without considering the configured TTL for routes propagation. This commit introduces a new annotation to the above-mentioned resources: `stackset-controller.zalando.org/updated-timestamp`. This annotation is responsible for tracking the last time the controller updated a resource. Also, it changes the migration process introduced on the [#251][0] to compare `IngressSourceSwitchTTL` with the newly added annotation instead of the `CreationTimestamp` attribute. This way, the change of hostname on the new resource, during the 3rd step, resets the timer to delete the old resource and guarantees route propagation. [0]: #251 [1]: https://github.com/zalando-incubator/stackset-controller/blob/e72232e799e5ff8ba5b51d29dc5ddff153907162/cmd/stackset-controller/main.go#L42 Co-authored-by: Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
jonathanbeber
pushed a commit
that referenced
this pull request
Nov 18, 2020
The HTTP resources (Ingresses and RouteGroups) migration, introduced on the [#251][0], checks for the `CreationTimestamp` attribute of the resources. When the migration follows the path of: 1. adding a new resource (does not matter if it's an Ingress or RouteGroup) with a new hostname for migration and testing purposes; 2. validating the configuration of the new resource. 3. dropping the old resource in favor of the new one. For that the new resource receives the actual hostname. the controller does not respect the [`IngressSourceSwitchTTL`][1] duration as expected. During the 3rd step, the `CreationTimestamp` attribute of the new resource tends to be greater than the `IngressSourceSwitchTTL` configuration, due to the time spent in the 2nd step. That leads to the almost instantaneous deletion of the old resource, without considering the configured TTL for routes propagation. This commit introduces a new annotation to the above-mentioned resources: `stackset-controller.zalando.org/updated-timestamp`. This annotation is responsible for tracking the last time the controller updated a resource. Also, it changes the migration process introduced on the [#251][0] to compare `IngressSourceSwitchTTL` with the newly added annotation instead of the `CreationTimestamp` attribute. This way, the change of hostname on the new resource, during the 3rd step, resets the timer to delete the old resource and guarantees route propagation. Also, it adds a new e2e test file. This new test create the above mentioned migration process and verifies that the controller delete the old resources after the `IngressSourceSwitchTTL` duration. As a minor change, this commit also updates the `run_e2e.sh` script, allowing one to define the environment variable `TEST_NAME`. It will set the maximum parallelism to 1 and run the given test name. [0]: #251 [1]: https://github.com/zalando-incubator/stackset-controller/blob/e72232e799e5ff8ba5b51d29dc5ddff153907162/cmd/stackset-controller/main.go#L42 Co-authored-by: Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
jonathanbeber
pushed a commit
that referenced
this pull request
Nov 19, 2020
The HTTP resources (Ingresses and RouteGroups) migration, introduced on the [#251][0], checks for the `CreationTimestamp` attribute of the resources. When the migration follows the path of: 1. adding a new resource (does not matter if it's an Ingress or RouteGroup) with a new hostname for migration and testing purposes; 2. validating the configuration of the new resource. 3. dropping the old resource in favor of the new one. For that the new resource receives the actual hostname. the controller does not respect the [`IngressSourceSwitchTTL`][1] duration as expected. During the 3rd step, the `CreationTimestamp` attribute of the new resource tends to be greater than the `IngressSourceSwitchTTL` configuration, due to the time spent in the 2nd step. That leads to the almost instantaneous deletion of the old resource, without considering the configured TTL for routes propagation. This commit introduces a new annotation to the above-mentioned resources: `stackset-controller.zalando.org/updated-timestamp`. This annotation is responsible for tracking the last time the controller updated a resource. Also, it changes the migration process introduced on the [#251][0] to compare `IngressSourceSwitchTTL` with the newly added annotation instead of the `CreationTimestamp` attribute. This way, the change of hostname on the new resource, during the 3rd step, resets the timer to delete the old resource and guarantees route propagation. Also, it adds a new e2e test file. This new test create the above mentioned migration process and verifies that the controller delete the old resources after the `IngressSourceSwitchTTL` duration. As a minor change, this commit also updates the `run_e2e.sh` script, allowing one to define the environment variable `TEST_NAME`. It will set the maximum parallelism to 1 and run the given test name. [0]: #251 [1]: https://github.com/zalando-incubator/stackset-controller/blob/e72232e799e5ff8ba5b51d29dc5ddff153907162/cmd/stackset-controller/main.go#L42 Co-authored-by: Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
jonathanbeber
pushed a commit
that referenced
this pull request
Nov 20, 2020
The HTTP resources (Ingresses and RouteGroups) migration, introduced on the [#251][0], checks for the `CreationTimestamp` attribute of the resources. When the migration follows the path of: 1. adding a new resource (does not matter if it's an Ingress or RouteGroup) with a new hostname for migration and testing purposes; 2. validating the configuration of the new resource. 3. dropping the old resource in favor of the new one. For that the new resource receives the actual hostname. the controller does not respect the [`IngressSourceSwitchTTL`][1] duration as expected. During the 3rd step, the `CreationTimestamp` attribute of the new resource tends to be greater than the `IngressSourceSwitchTTL` configuration, due to the time spent in the 2nd step. That leads to the almost instantaneous deletion of the old resource, without considering the configured TTL for routes propagation. This commit introduces a new annotation to the above-mentioned resources: `stackset-controller.zalando.org/updated-timestamp`. This annotation is responsible for tracking the last time the controller updated a resource. Also, it changes the migration process introduced on the [#251][0] to compare `IngressSourceSwitchTTL` with the newly added annotation instead of the `CreationTimestamp` attribute. This way, the change of hostname on the new resource, during the 3rd step, resets the timer to delete the old resource and guarantees route propagation. Also, it adds a new e2e test file. This new test create the above mentioned migration process and verifies that the controller delete the old resources after the `IngressSourceSwitchTTL` duration. As a minor change, this commit also updates the `run_e2e.sh` script, allowing one to define the environment variable `TEST_NAME`. It will set the maximum parallelism to 1 and run the given test name. [0]: #251 [1]: https://github.com/zalando-incubator/stackset-controller/blob/e72232e799e5ff8ba5b51d29dc5ddff153907162/cmd/stackset-controller/main.go#L42 Co-authored-by: Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
jonathanbeber
pushed a commit
that referenced
this pull request
Nov 20, 2020
The HTTP resources (Ingresses and RouteGroups) migration, introduced on the [#251][0], checks for the `CreationTimestamp` attribute of the resources. When the migration follows the path of: 1. adding a new resource (does not matter if it's an Ingress or RouteGroup) with a new hostname for migration and testing purposes; 2. validating the configuration of the new resource. 3. dropping the old resource in favor of the new one. For that the new resource receives the actual hostname. the controller does not respect the [`IngressSourceSwitchTTL`][1] duration as expected. During the 3rd step, the `CreationTimestamp` attribute of the new resource tends to be greater than the `IngressSourceSwitchTTL` configuration, due to the time spent in the 2nd step. That leads to the almost instantaneous deletion of the old resource, without considering the configured TTL for routes propagation. This commit introduces a new annotation to the above-mentioned resources: `stackset-controller.zalando.org/updated-timestamp`. This annotation is responsible for tracking the last time the controller updated a resource. Also, it changes the migration process introduced on the [#251][0] to compare `IngressSourceSwitchTTL` with the newly added annotation instead of the `CreationTimestamp` attribute. This way, the change of hostname on the new resource, during the 3rd step, resets the timer to delete the old resource and guarantees route propagation. Also, it adds a new e2e test file. This new test create the above mentioned migration process and verifies that the controller delete the old resources after the `IngressSourceSwitchTTL` duration. As a minor change, this commit also updates the `run_e2e.sh` script, allowing one to define the environment variable `TEST_NAME`. It will set the maximum parallelism to 1 and run the given test name. [0]: #251 [1]: https://github.com/zalando-incubator/stackset-controller/blob/e72232e799e5ff8ba5b51d29dc5ddff153907162/cmd/stackset-controller/main.go#L42 Co-authored-by: Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
mikkeloscar
pushed a commit
that referenced
this pull request
Nov 20, 2020
The HTTP resources (Ingresses and RouteGroups) migration, introduced on the [#251][0], checks for the `CreationTimestamp` attribute of the resources. When the migration follows the path of: 1. adding a new resource (does not matter if it's an Ingress or RouteGroup) with a new hostname for migration and testing purposes; 2. validating the configuration of the new resource. 3. dropping the old resource in favor of the new one. For that the new resource receives the actual hostname. the controller does not respect the [`IngressSourceSwitchTTL`][1] duration as expected. During the 3rd step, the `CreationTimestamp` attribute of the new resource tends to be greater than the `IngressSourceSwitchTTL` configuration, due to the time spent in the 2nd step. That leads to the almost instantaneous deletion of the old resource, without considering the configured TTL for routes propagation. This commit introduces a new annotation to the above-mentioned resources: `stackset-controller.zalando.org/updated-timestamp`. This annotation is responsible for tracking the last time the controller updated a resource. Also, it changes the migration process introduced on the [#251][0] to compare `IngressSourceSwitchTTL` with the newly added annotation instead of the `CreationTimestamp` attribute. This way, the change of hostname on the new resource, during the 3rd step, resets the timer to delete the old resource and guarantees route propagation. Also, it adds a new e2e test file. This new test create the above mentioned migration process and verifies that the controller delete the old resources after the `IngressSourceSwitchTTL` duration. As a minor change, this commit also updates the `run_e2e.sh` script, allowing one to define the environment variable `TEST_NAME`. It will set the maximum parallelism to 1 and run the given test name. [0]: #251 [1]: https://github.com/zalando-incubator/stackset-controller/blob/e72232e799e5ff8ba5b51d29dc5ddff153907162/cmd/stackset-controller/main.go#L42 Co-authored-by: Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds support for RouteGroups as an alternative to
ingress
orexternalIngress
definitions.Migration path
The intended migration path from
Ingress
->RouteGroup
or the other way is the following:RouteGroup
definition and keeps the existingIngress
in place. Proposed it to first add the newRouteGroup
with a different hostname such that it won't overlap with the existingIngress
for the initial tests.Ingress
andRouteGroup
is the same theIngress
can be dropped from theStackSet
spec.Ingress
if it detects that aRouteGroup
is defined. This allows the underlying proxy (skipper) to configure the routes forRouteGroup
before deleting the corresponding routes which were configured for theIngress
. - Default setting is to delete theIngress
no sooner than 5 minutes after theRouteGroup
resource has been created. 5 minutes seems like a reasonable time where skipper has plenty of time to be configured AND not too long that it will mess with the routes if the user starts to add additional features via the newRouteGroup
configuration.Traffic weight rounding
Since
RouteGroup
s expect the weight to be inint
as opposed tofloat64
I introduced a rounding which affects the weights when they're calculated to be assigned on the StackSet spec/status thus also changing the behavior slightly for how weights are calculated foringress
orexternalIngress
. Basically the weights are still stored infloat64
, but they are rounded to whole numbers still summing up to 100. See theroundWeights
function inpkg/core/traffic.go
for details.This can be the first step for eventually getting rid of floats and just use integers for weights. Related #214
WORK IN PROGRESS