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(gloo): Update reconciler to detect change in gloo upstream spec #1617

Conversation

sopida-chotwanwirach
Copy link
Contributor

Problem:
The reconciler is not detecting changes in gloo upstream spec. When the slow start config is added or updated in gloo upstream, the same config is not propagated to existing flagger upstreams.

Reproducing Step:

  • create gloo upstream
apiVersion: gloo.solo.io/v1
kind: Upstream
metadata:
  name: config-upstream
  namespace: gloo-system
  • create canary that has upstream reference to gloo
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
  name: podinfo
  namespace: test
spec:
  upstreamRef:
    apiVersion: gloo.solo.io/v1
    kind: Upstream
    name: config-upstream
    namespace: gloo-system
  provider: gloo
  • add/modify slow start config in gloo upstream
apiVersion: gloo.solo.io/v1
kind: Upstream
metadata:
  name: config-upstream
  namespace: gloo-system
spec:
  loadBalancerConfig:
    roundRobin:
      slowStartConfig:
        slowStartWindow: 2m
        minWeightPercent: 5
  • flagger upstreams (primary and canary) will not pick up the updated slow start config

In PR:

  • update reconciler to detect diff in load balancer config for gloo vs flagger upstreams
  • when a change is detected, update flagger upstream load balancer with the latest config
  • add integration test to verify the fix

@sopida-chotwanwirach sopida-chotwanwirach force-pushed the gloo-reconcile-upstream-spec-change branch from 42bff9b to f646d02 Compare March 14, 2024 01:10
pkg/router/gloo.go Outdated Show resolved Hide resolved
Signed-off-by: sopida-chotwanwirach <sopida.chotwanwirach@offerup.com>
@sopida-chotwanwirach sopida-chotwanwirach force-pushed the gloo-reconcile-upstream-spec-change branch from f646d02 to e153b8a Compare March 14, 2024 21:34
Signed-off-by: sopida-chotwanwirach <sopida.chotwanwirach@offerup.com>
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 30.43478% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 56.51%. Comparing base (b778013) to head (e3a529e).
Report is 5 commits behind head on main.

Files Patch % Lines
pkg/router/gloo.go 30.43% 14 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1617      +/-   ##
==========================================
- Coverage   56.60%   56.51%   -0.09%     
==========================================
  Files          85       85              
  Lines        8549     8571      +22     
==========================================
+ Hits         4839     4844       +5     
- Misses       3038     3053      +15     
- Partials      672      674       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @sopida-chotwanwirach 🥇

@stefanprodan stefanprodan merged commit a437af0 into fluxcd:main Mar 25, 2024
17 checks passed
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.

5 participants