Introduce an upstream-hash-by annotation to support consistent hashing by nginx variable or text
This commit is contained in:
parent
7ffa0ae265
commit
d607cf6dd7
13 changed files with 166 additions and 0 deletions
|
|
@ -707,6 +707,7 @@ func (ic *GenericController) createUpstreams(data []*extensions.Ingress, du *ing
|
|||
secUpstream := ic.annotations.SecureUpstream(ing)
|
||||
hz := ic.annotations.HealthCheck(ing)
|
||||
serviceUpstream := ic.annotations.ServiceUpstream(ing)
|
||||
upstreamHashBy := ic.annotations.UpstreamHashBy(ing)
|
||||
|
||||
var defBackend string
|
||||
if ing.Spec.Backend != nil {
|
||||
|
|
@ -767,6 +768,10 @@ func (ic *GenericController) createUpstreams(data []*extensions.Ingress, du *ing
|
|||
upstreams[name].SecureCACert = secUpstream.CACert
|
||||
}
|
||||
|
||||
if upstreams[name].UpstreamHashBy == "" {
|
||||
upstreams[name].UpstreamHashBy = upstreamHashBy
|
||||
}
|
||||
|
||||
svcKey := fmt.Sprintf("%v/%v", ing.GetNamespace(), path.Backend.ServiceName)
|
||||
|
||||
// Add the service cluster endpoint as the upstream instead of individual endpoints
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue