Skip to content
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

Fix ingress Annotations replacement loop #1652

Merged
merged 1 commit into from
Jul 29, 2024
Merged

Fix ingress Annotations replacement loop #1652

merged 1 commit into from
Jul 29, 2024

Conversation

kuritka
Copy link
Collaborator

@kuritka kuritka commented Jul 10, 2024

Annotation implementation change, terratests covered, test change.

closes #932
closes #1019
related to #1018

  • When I create GSLB - not k8gb annotations are not copied to ingress. Annotations that are directly related to k8gb are now created in ingress.

  • When I modify an annotatiosn in ingress, the annotations are not copied to the GSLB

  • If I change an annotation that is related to k8gb in ingress, the GSLB as source of truth returns the annotation to it's state

  • When I change an annotation in ingress that is not related to k8gb, reconciliation is not triggered and the annotation remains in ingress and is ignored by k8gb.

  • When I create a GSLB from an ingress, the annotations are not copied to the GSLB.

  • I simplify WeightRoundRobin terratests from waiting cycles, the waiting cycles are already implemented in WaitForApp.

Annotation implementation change, terratests covered, test change.

When I create GSLB - not k8gb annotations are not copied to ingress. Annotations that are directly related to k8gb are now created in ingress.

When I change an annotation in ingress, the annotation is not copied to the GSLB

If I change an annotation that is related to k8gb in ingress, the GSLB as ource of truth returns the annotation

When I change an annotation in ingress that is not related to k8gb, reconciliation is not triggered and the annotation remains in ingress and is ignored by k8gb

When I create a GSLB from an ingress, the annotations are not copied to the GSLB.

Signed-off-by: Michal Kuritka <kuritka@gmail.com>
Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, I performed the e2e testing validating annotation propagation behaviour especially focusing on

If I change an annotation that is related to k8gb in ingress, the GSLB as source of truth returns the annotation to it's state

When I change an annotation in ingress that is not related to k8gb, reconciliation is not triggered and the annotation remains in ingress and is ignored by k8gb.

k -n test-gslb get ing test-gslb-failover -o yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    k8gb.io/primary-geotag: eu # this is getting reverted according to Gslb spec if changed manually on Ingress
    k8gb.io/strategy: failover
    annotation: test # this is staying intact

@kuritka kuritka merged commit dca347d into master Jul 29, 2024
18 checks passed
@kuritka kuritka deleted the fix-annotation-4 branch July 29, 2024 08:41
abaguas added a commit to abaguas/k8gb that referenced this pull request Jul 30, 2024
The idea was to still trigger reconciliation cycles if resources changes by checking if there was a `generation` update.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
> generation: a sequence number representing a specific generation of the desired state. Set by the system and monotonically increasing, per-resource. May be compared, such as for RAW and WAW consistency.

However, the change caused a degradation in `Endpoints` resources. These resources don't have generation because they don't have a status. As a result, a reconciliation was only triggered on creation and deletion, but not on subset update.
This degradated also the behavior of the k8gb controller. The controller became too slow monitoring the health of applications since `Endpoints` updates no longer triggered a reconcile of the GSLB resource. This lead to slow failovers and failing e2e tests.

The solution proposed in this PR is to always trigger the `endpointMapHandler` function when an `Endpoint` resource changes. This is the same behavior as before k8gb-io#1652.

Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
abaguas added a commit to abaguas/k8gb that referenced this pull request Jul 30, 2024
The idea was to still trigger reconciliation cycles if resources changes by checking if there was a `generation` update.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
> generation: a sequence number representing a specific generation of the desired state. Set by the system and monotonically increasing, per-resource. May be compared, such as for RAW and WAW consistency.

However, the change caused a degradation in `Endpoints` resources. These resources don't have generation because they don't have a status. As a result, a reconciliation was only triggered on creation and deletion, but not on subset update.
This degradated also the behavior of the k8gb controller. The controller became too slow monitoring the health of applications since `Endpoints` updates no longer triggered a reconcile of the GSLB resource. This lead to slow failovers and failing e2e tests.

The solution proposed in this PR is to always trigger the `endpointMapHandler` function when an `Endpoint` resource changes. This is the same behavior as before k8gb-io#1652.

Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
abaguas added a commit to abaguas/k8gb that referenced this pull request Jul 30, 2024
The idea was to still trigger reconciliation cycles if resources changes by checking if there was a `generation` update.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
> generation: a sequence number representing a specific generation of the desired state. Set by the system and monotonically increasing, per-resource. May be compared, such as for RAW and WAW consistency.

However, the change caused a degradation in `Endpoints` resources. These resources don't have generation because they don't have a status. As a result, a reconciliation was only triggered on creation and deletion, but not on subset update.
This degradated also the behavior of the k8gb controller. The controller became too slow monitoring the health of applications since `Endpoints` updates no longer triggered a reconcile of the GSLB resource. This lead to slow failovers and failing e2e tests.

The solution proposed in this PR is to always trigger the `endpointMapHandler` function when an `Endpoint` resource changes. This is the same behavior as before k8gb-io#1652.

Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
abaguas added a commit to abaguas/k8gb that referenced this pull request Jul 30, 2024
The idea was to still trigger reconciliation cycles if resources changes by checking if there was a `generation` update.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
> generation: a sequence number representing a specific generation of the desired state. Set by the system and monotonically increasing, per-resource. May be compared, such as for RAW and WAW consistency.

However, the change caused a degradation in `Endpoints` resources. These resources don't have generation because they don't have a status. As a result, a reconciliation was only triggered on creation and deletion, but not on subset update.
This degradated also the behavior of the k8gb controller. The controller became too slow monitoring the health of applications since `Endpoints` updates no longer triggered a reconcile of the GSLB resource. This lead to slow failovers and failing e2e tests.

The solution proposed in this PR is to always trigger the `endpointMapHandler` function when an `Endpoint` resource changes. This is the same behavior as before k8gb-io#1652.

Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
abaguas added a commit to abaguas/k8gb that referenced this pull request Jul 31, 2024
The idea was to still trigger reconciliation cycles if resources changes by checking if there was a `generation` update.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
> generation: a sequence number representing a specific generation of the desired state. Set by the system and monotonically increasing, per-resource. May be compared, such as for RAW and WAW consistency.

However, the change caused a degradation in `Endpoints` resources. These resources don't have generation because they don't have a status. As a result, a reconciliation was only triggered on creation and deletion, but not on subset update.
This degradated also the behavior of the k8gb controller. The controller became too slow monitoring the health of applications since `Endpoints` updates no longer triggered a reconcile of the GSLB resource. This lead to slow failovers and failing e2e tests.

The solution proposed in this PR is to always trigger the `endpointMapHandler` function when an `Endpoint` resource changes. This is the same behavior as before k8gb-io#1652.

Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
abaguas added a commit to abaguas/k8gb that referenced this pull request Jul 31, 2024
The idea was to still trigger reconciliation cycles if resources changes by checking if there was a `generation` update.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
> generation: a sequence number representing a specific generation of the desired state. Set by the system and monotonically increasing, per-resource. May be compared, such as for RAW and WAW consistency.

However, the change caused a degradation in `Endpoints` resources. These resources don't have generation because they don't have a status. As a result, a reconciliation was only triggered on creation and deletion, but not on subset update.
This degradated also the behavior of the k8gb controller. The controller became too slow monitoring the health of applications since `Endpoints` updates no longer triggered a reconcile of the GSLB resource. This lead to slow failovers and failing e2e tests.

The solution proposed in this PR is to always trigger the `endpointMapHandler` function when an `Endpoint` resource changes. This is the same behavior as before k8gb-io#1652.

Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
abaguas added a commit to abaguas/k8gb that referenced this pull request Jul 31, 2024
The idea was to still trigger reconciliation cycles if resources changes by checking if there was a `generation` update.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
> generation: a sequence number representing a specific generation of the desired state. Set by the system and monotonically increasing, per-resource. May be compared, such as for RAW and WAW consistency.

However, the change caused a degradation in `Endpoints` resources. These resources don't have generation because they don't have a status. As a result, a reconciliation was only triggered on creation and deletion, but not on subset update.
This degradated also the behavior of the k8gb controller. The controller became too slow monitoring the health of applications since `Endpoints` updates no longer triggered a reconcile of the GSLB resource. This lead to slow failovers and failing e2e tests.

The solution proposed in this PR is to always trigger the `endpointMapHandler` function when an `Endpoint` resource changes. This is the same behavior as before k8gb-io#1652.

Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
abaguas added a commit to abaguas/k8gb that referenced this pull request Jul 31, 2024
The idea was to still trigger reconciliation cycles if resources changes by checking if there was a `generation` update.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
> generation: a sequence number representing a specific generation of the desired state. Set by the system and monotonically increasing, per-resource. May be compared, such as for RAW and WAW consistency.

However, the change caused a degradation in `Endpoints` resources. These resources don't have generation because they don't have a status. As a result, a reconciliation was only triggered on creation and deletion, but not on subset update.
This degradated also the behavior of the k8gb controller. The controller became too slow monitoring the health of applications since `Endpoints` updates no longer triggered a reconcile of the GSLB resource. This lead to slow failovers and failing e2e tests.

The solution proposed in this PR is to always trigger the `endpointMapHandler` function when an `Endpoint` resource changes. This is the same behavior as before k8gb-io#1652.

Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
abaguas added a commit to abaguas/k8gb that referenced this pull request Jul 31, 2024
The idea was to still trigger reconciliation cycles if resources changes by checking if there was a `generation` update.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
> generation: a sequence number representing a specific generation of the desired state. Set by the system and monotonically increasing, per-resource. May be compared, such as for RAW and WAW consistency.

However, the change caused a degradation in `Endpoints` resources. These resources don't have generation because they don't have a status. As a result, a reconciliation was only triggered on creation and deletion, but not on subset update.
This degradated also the behavior of the k8gb controller. The controller became too slow monitoring the health of applications since `Endpoints` updates no longer triggered a reconcile of the GSLB resource. This lead to slow failovers and failing e2e tests.

The solution proposed in this PR is to always trigger the `endpointMapHandler` function when an `Endpoint` resource changes. This is the same behavior as before k8gb-io#1652.

Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
ytsarev pushed a commit that referenced this pull request Jul 31, 2024
The idea was to still trigger reconciliation cycles if resources changes by checking if there was a `generation` update.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata
> generation: a sequence number representing a specific generation of the desired state. Set by the system and monotonically increasing, per-resource. May be compared, such as for RAW and WAW consistency.

However, the change caused a degradation in `Endpoints` resources. These resources don't have generation because they don't have a status. As a result, a reconciliation was only triggered on creation and deletion, but not on subset update.
This degradated also the behavior of the k8gb controller. The controller became too slow monitoring the health of applications since `Endpoints` updates no longer triggered a reconcile of the GSLB resource. This lead to slow failovers and failing e2e tests.

The solution proposed in this PR is to always trigger the `endpointMapHandler` function when an `Endpoint` resource changes. This is the same behavior as before #1652.

Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] GSLB is not updated when Ingress has change
3 participants