Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Fix regressions from the initial pass of the upstream-hash-by annotation #6

Merged
merged 2 commits into from
Oct 4, 2017

Conversation

methodmissing
Copy link

@methodmissing methodmissing commented Oct 3, 2017

References this fallout from #5:

E1003 11:49:02.768548       8 controller.go:428] unexpected failure restarting the backend: 
template: nginx.tmpl:267:23: executing "nginx.tmpl" at <$upstream.UpstreamHa...>: can't evaluate field UpstreamHashBy in type *ingress.Backend

I had to introduce special case handling for the upstream-hash-by annotation on backend creation as most of the annotations are scoped to the Location type and injected by means of the mergeLocationAnnotations utility helper.

🎩 :

host:test user$ kubectl describe ing -n something-staging
Name:            something-web
Namespace:        something-staging
Address:        X.X.X.X
Default backend:    default-http-backend:80 (Y.Y.Y.Y:8080)
TLS:
  star-something terminates something-staging.something.com
Rules:
  Host                    Path    Backends
  ----                    ----    --------
  something-staging.something.com    
                             something-web:80 (<none>)
Annotations:
  auth-realm:        blah bblah
  auth-secret:        something-basic-auth
  auth-type:        basic
  upstream-hash-by:    $request_uri <<<<<<<<<<<<<<<<<<<<<<<<<<<
    upstream something-staging-something-web-80 {
        # Load balance algorithm; empty for round robin, which is the default
        least_conn;

        hash $request_uri consistent; <<<<<<<<<<<<<<<<<<<<
        server Y.Y.Y.Y:8000 max_fails=0 fail_timeout=0;
    }

Also reasoning regarding the version:

Previous version 0.9.0-beta.12-shopify basically represents a new upstream version already available so I think this would work better: 0.9.0-beta.11-shopify-<latest-feature-added>
then the version lines up with the last upstream version we're tracking
and hint @ the shopify fork and also the last feature added
eg. 0.9.0-beta.11-shopify-upstream-hash-by

@ibawt @n1koo @mkobetic @karanthukral

@methodmissing methodmissing force-pushed the upstream-hash-by-regressions branch 6 times, most recently from 59e1bdb to 09b1664 Compare October 4, 2017 14:51
@karanthukral
Copy link

LGTM!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants