From 0b6736058054d9b639295e2ef9afab4ec7dd2e5c Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Wed, 25 Oct 2023 16:49:23 -0700 Subject: [PATCH] LoadBalancer in BackendTrafficPolicy (#2063) * LoadBalancer in BackendTrafficPolicy Fixes: https://github.com/envoyproxy/gateway/issues/1105 Signed-off-by: Arko Dasgupta * tests Signed-off-by: Arko Dasgupta --------- Signed-off-by: Arko Dasgupta Signed-off-by: zirain --- api/v1alpha1/backendtrafficpolicy_types.go | 6 + api/v1alpha1/envoygateway_helpers.go | 6 +- api/v1alpha1/loadbalancer_types.go | 55 ++++ api/v1alpha1/zz_generated.deepcopy.go | 40 +++ ....envoyproxy.io_backendtrafficpolicies.yaml | 30 ++ internal/gatewayapi/backendtrafficpolicy.go | 51 +++- ...endtrafficpolicy-with-loadbalancer.in.yaml | 93 ++++++ ...ndtrafficpolicy-with-loadbalancer.out.yaml | 288 ++++++++++++++++++ site/content/en/latest/api/extension_types.md | 52 ++++ 9 files changed, 615 insertions(+), 6 deletions(-) create mode 100644 api/v1alpha1/loadbalancer_types.go create mode 100644 internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml create mode 100755 internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml diff --git a/api/v1alpha1/backendtrafficpolicy_types.go b/api/v1alpha1/backendtrafficpolicy_types.go index e89d062bf56e..f01bb401d028 100644 --- a/api/v1alpha1/backendtrafficpolicy_types.go +++ b/api/v1alpha1/backendtrafficpolicy_types.go @@ -48,7 +48,13 @@ type BackendTrafficPolicySpec struct { // RateLimit allows the user to limit the number of incoming requests // to a predefined value based on attributes within the traffic flow. + // +optional RateLimit *RateLimitFilterSpec `json:"rateLimit,omitempty"` + + // LoadBalancer policy to apply when routing traffic from the gateway to + // the backend endpoints + // +optional + LoadBalancer *LoadBalancer `json:"loadBalancer,omitempty"` } // BackendTrafficPolicyStatus defines the state of BackendTrafficPolicy diff --git a/api/v1alpha1/envoygateway_helpers.go b/api/v1alpha1/envoygateway_helpers.go index e9e369f4e74f..e0352ba69691 100644 --- a/api/v1alpha1/envoygateway_helpers.go +++ b/api/v1alpha1/envoygateway_helpers.go @@ -92,7 +92,7 @@ func DefaultEnvoyGatewayLogging() *EnvoyGatewayLogging { } } -// GetEnvoyGatewayAdmin returns the EnvoyGatewayAdmin of EnvoyGateway or a default EnvoyGatewayAdmin if unspecified. +// GetEnvoyGatewayTelemetry returns the EnvoyGatewayTelemetry of EnvoyGateway or a default EnvoyGatewayTelemetry if unspecified. func (e *EnvoyGateway) GetEnvoyGatewayTelemetry() *EnvoyGatewayTelemetry { if e.Telemetry != nil { if e.Telemetry.Metrics.Prometheus == nil { @@ -109,8 +109,8 @@ func (e *EnvoyGateway) GetEnvoyGatewayTelemetry() *EnvoyGatewayTelemetry { return e.Telemetry } -// IfDisablePrometheus returns if disable prometheus. -func (e *EnvoyGateway) IfDisablePrometheus() bool { +// DisablePrometheus returns if disable prometheus. +func (e *EnvoyGateway) DisablePrometheus() bool { return e.GetEnvoyGatewayTelemetry().Metrics.Prometheus.Disable } diff --git a/api/v1alpha1/loadbalancer_types.go b/api/v1alpha1/loadbalancer_types.go new file mode 100644 index 000000000000..d512b6902c78 --- /dev/null +++ b/api/v1alpha1/loadbalancer_types.go @@ -0,0 +1,55 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +package v1alpha1 + +// LoadBalancer defines the load balancer policy to be applied. +// +union +type LoadBalancer struct { + // Type decides the type of Load Balancer policy. + // Valid RateLimitType values are + // "ConsistentHash", + // "LeastRequest", + // "Random", + // "RoundRobin", + // + // +unionDiscriminator + Type LoadBalancerType `json:"type"` + // ConsistentHash defines the configuration when the load balancer type is + // set to ConsistentHash + // + // +optional + ConsistentHash *ConsistentHash `json:"consistentHash,omitempty"` +} + +// LoadBalancerType specifies the types of LoadBalancer. +// +kubebuilder:validation:Enum=ConsistentHash;LeastRequest;Random;RoundRobin +type LoadBalancerType string + +const ( + // ConsistentHashLoadBalancerType load balancer policy. + ConsistentHashLoadBalancerType LoadBalancerType = "ConsistentHash" + // LeastRequestLoadBalancerType load balancer policy. + LeastRequestLoadBalancerType LoadBalancerType = "LeastRequest" + // RandomLoadBalancerType load balancer policy. + RandomLoadBalancerType LoadBalancerType = "Random" + // RoundRobinLoadBalancerType load balancer policy. + RoundRobinLoadBalancerType LoadBalancerType = "RoundRobin" +) + +// ConsistentHash defines the configuration related to the consistent hash +// load balancer policy +type ConsistentHash struct { + Type ConsistentHashType `json:"type"` +} + +// ConsistentHashType defines the type of input to hash on. +// +kubebuilder:validation:Enum=SourceIP +type ConsistentHashType string + +const ( + // SourceIPConsistentHashType hashes based on the source IP address. + SourceIPConsistentHashType ConsistentHashType = "SourceIP" +) diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 3fb30ec60061..0854f1f8fe51 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -165,6 +165,11 @@ func (in *BackendTrafficPolicySpec) DeepCopyInto(out *BackendTrafficPolicySpec) *out = new(RateLimitFilterSpec) (*in).DeepCopyInto(*out) } + if in.LoadBalancer != nil { + in, out := &in.LoadBalancer, &out.LoadBalancer + *out = new(LoadBalancer) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicySpec. @@ -358,6 +363,21 @@ func (in *ClientTrafficPolicyStatus) DeepCopy() *ClientTrafficPolicyStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsistentHash) DeepCopyInto(out *ConsistentHash) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsistentHash. +func (in *ConsistentHash) DeepCopy() *ConsistentHash { + if in == nil { + return nil + } + out := new(ConsistentHash) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CustomTag) DeepCopyInto(out *CustomTag) { *out = *in @@ -1540,6 +1560,26 @@ func (in *LiteralCustomTag) DeepCopy() *LiteralCustomTag { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) { + *out = *in + if in.ConsistentHash != nil { + in, out := &in.ConsistentHash, &out.ConsistentHash + *out = new(ConsistentHash) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancer. +func (in *LoadBalancer) DeepCopy() *LoadBalancer { + if in == nil { + return nil + } + out := new(LoadBalancer) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Match) DeepCopyInto(out *Match) { *out = *in diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml index 98fa2a635480..ea1d2d6a420e 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -44,6 +44,36 @@ spec: spec: description: spec defines the desired state of BackendTrafficPolicy. properties: + loadBalancer: + description: LoadBalancer policy to apply when routing traffic from + the gateway to the backend endpoints + properties: + consistentHash: + description: ConsistentHash defines the configuration when the + load balancer type is set to ConsistentHash + properties: + type: + description: ConsistentHashType defines the type of input + to hash on. + enum: + - SourceIP + type: string + required: + - type + type: object + type: + description: Type decides the type of Load Balancer policy. Valid + RateLimitType values are "ConsistentHash", "LeastRequest", "Random", + "RoundRobin", + enum: + - ConsistentHash + - LeastRequest + - Random + - RoundRobin + type: string + required: + - type + type: object rateLimit: description: RateLimit allows the user to limit the number of incoming requests to a predefined value based on attributes within the traffic diff --git a/internal/gatewayapi/backendtrafficpolicy.go b/internal/gatewayapi/backendtrafficpolicy.go index cca1b80d1b67..496191472279 100644 --- a/internal/gatewayapi/backendtrafficpolicy.go +++ b/internal/gatewayapi/backendtrafficpolicy.go @@ -238,11 +238,18 @@ func resolveBTPolicyRouteTargetRef(policy *egv1a1.BackendTrafficPolicy, routes m } func (t *Translator) translateBackendTrafficPolicyForRoute(policy *egv1a1.BackendTrafficPolicy, route RouteContext, xdsIR XdsIRMap) { + var ( + rl *ir.RateLimit + lb *ir.LoadBalancer + ) + // Build IR - var rl *ir.RateLimit if policy.Spec.RateLimit != nil { rl = t.buildRateLimit(policy) } + if policy.Spec.LoadBalancer != nil { + lb = t.buildLoadBalancer(policy) + } // Apply IR to all relevant routes prefix := irRoutePrefix(route) @@ -252,6 +259,7 @@ func (t *Translator) translateBackendTrafficPolicyForRoute(policy *egv1a1.Backen // Apply if there is a match if strings.HasPrefix(r.Name, prefix) { r.RateLimit = rl + r.LoadBalancer = lb } } } @@ -260,12 +268,18 @@ func (t *Translator) translateBackendTrafficPolicyForRoute(policy *egv1a1.Backen } func (t *Translator) translateBackendTrafficPolicyForGateway(policy *egv1a1.BackendTrafficPolicy, gateway *GatewayContext, xdsIR XdsIRMap) { + var ( + rl *ir.RateLimit + lb *ir.LoadBalancer + ) + // Build IR - var rl *ir.RateLimit if policy.Spec.RateLimit != nil { rl = t.buildRateLimit(policy) } - + if policy.Spec.LoadBalancer != nil { + lb = t.buildLoadBalancer(policy) + } // Apply IR to all the routes within the specific Gateway // If the feature is already set, then skip it, since it must be have // set by a policy attaching to the route @@ -279,6 +293,9 @@ func (t *Translator) translateBackendTrafficPolicyForGateway(policy *egv1a1.Back if r.RateLimit == nil { r.RateLimit = rl } + if r.LoadBalancer == nil { + r.LoadBalancer = lb + } } } @@ -392,3 +409,31 @@ func (t *Translator) buildRateLimit(policy *egv1a1.BackendTrafficPolicy) *ir.Rat return rateLimit } + +func (t *Translator) buildLoadBalancer(policy *egv1a1.BackendTrafficPolicy) *ir.LoadBalancer { + var lb *ir.LoadBalancer + switch policy.Spec.LoadBalancer.Type { + case egv1a1.ConsistentHashLoadBalancerType: + lb = &ir.LoadBalancer{ + ConsistentHash: &ir.ConsistentHash{}, + } + if policy.Spec.LoadBalancer.ConsistentHash != nil && + policy.Spec.LoadBalancer.ConsistentHash.Type == egv1a1.SourceIPConsistentHashType { + lb.ConsistentHash.SourceIP = ptr.To(true) + } + case egv1a1.LeastRequestLoadBalancerType: + lb = &ir.LoadBalancer{ + LeastRequest: &ir.LeastRequest{}, + } + case egv1a1.RandomLoadBalancerType: + lb = &ir.LoadBalancer{ + Random: &ir.Random{}, + } + case egv1a1.RoundRobinLoadBalancerType: + lb = &ir.LoadBalancer{ + RoundRobin: &ir.RoundRobin{}, + } + } + + return lb +} diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml new file mode 100644 index 000000000000..00f3895d30a9 --- /dev/null +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.in.yaml @@ -0,0 +1,93 @@ +gateways: +- apiVersion: gateway.networking.k8s.io/v1 + kind: Gateway + metadata: + namespace: envoy-gateway + name: gateway-1 + spec: + gatewayClassName: envoy-gateway-class + listeners: + - name: http + protocol: HTTP + port: 80 + allowedRoutes: + namespaces: + from: All +- apiVersion: gateway.networking.k8s.io/v1 + kind: Gateway + metadata: + namespace: envoy-gateway + name: gateway-2 + spec: + gatewayClassName: envoy-gateway-class + listeners: + - name: http + protocol: HTTP + port: 80 + allowedRoutes: + namespaces: + from: All +grpcRoutes: +- apiVersion: gateway.networking.k8s.io/v1alpha2 + kind: GRPCRoute + metadata: + namespace: default + name: grpcroute-1 + spec: + parentRefs: + - namespace: envoy-gateway + name: gateway-1 + sectionName: http + rules: + - backendRefs: + - name: service-1 + port: 8080 +httpRoutes: +- apiVersion: gateway.networking.k8s.io/v1 + kind: HTTPRoute + metadata: + namespace: default + name: httproute-1 + spec: + hostnames: + - gateway.envoyproxy.io + parentRefs: + - namespace: envoy-gateway + name: gateway-2 + sectionName: http + rules: + - matches: + - path: + value: "/" + backendRefs: + - name: service-1 + port: 8080 +backendTrafficPolicies: +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: BackendTrafficPolicy + metadata: + namespace: envoy-gateway + name: policy-for-gateway + spec: + targetRef: + group: gateway.networking.k8s.io + kind: Gateway + name: gateway-1 + namespace: envoy-gateway + loadBalancer: + type: Random +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: BackendTrafficPolicy + metadata: + namespace: default + name: policy-for-route + spec: + targetRef: + group: gateway.networking.k8s.io + kind: HTTPRoute + name: httproute-1 + namespace: default + loadBalancer: + type: ConsistentHash + consistentHash: + type: SourceIP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml new file mode 100755 index 000000000000..b2572c9d2ff6 --- /dev/null +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml @@ -0,0 +1,288 @@ +backendTrafficPolicies: +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: BackendTrafficPolicy + metadata: + creationTimestamp: null + name: policy-for-route + namespace: default + spec: + loadBalancer: + consistentHash: + type: SourceIP + type: ConsistentHash + targetRef: + group: gateway.networking.k8s.io + kind: HTTPRoute + name: httproute-1 + namespace: default + status: + conditions: + - lastTransitionTime: null + message: BackendTrafficPolicy has been accepted. + reason: Accepted + status: "True" + type: Accepted +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: BackendTrafficPolicy + metadata: + creationTimestamp: null + name: policy-for-gateway + namespace: envoy-gateway + spec: + loadBalancer: + type: Random + targetRef: + group: gateway.networking.k8s.io + kind: Gateway + name: gateway-1 + namespace: envoy-gateway + status: + conditions: + - lastTransitionTime: null + message: BackendTrafficPolicy has been accepted. + reason: Accepted + status: "True" + type: Accepted +gateways: +- apiVersion: gateway.networking.k8s.io/v1 + kind: Gateway + metadata: + creationTimestamp: null + name: gateway-1 + namespace: envoy-gateway + spec: + gatewayClassName: envoy-gateway-class + infrastructure: {} + listeners: + - allowedRoutes: + namespaces: + from: All + name: http + port: 80 + protocol: HTTP + status: + listeners: + - attachedRoutes: 1 + conditions: + - lastTransitionTime: null + message: Sending translated listener configuration to the data plane + reason: Programmed + status: "True" + type: Programmed + - lastTransitionTime: null + message: Listener has been successfully translated + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: Listener references have been resolved + reason: ResolvedRefs + status: "True" + type: ResolvedRefs + name: http + supportedKinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute + - group: gateway.networking.k8s.io + kind: GRPCRoute +- apiVersion: gateway.networking.k8s.io/v1 + kind: Gateway + metadata: + creationTimestamp: null + name: gateway-2 + namespace: envoy-gateway + spec: + gatewayClassName: envoy-gateway-class + infrastructure: {} + listeners: + - allowedRoutes: + namespaces: + from: All + name: http + port: 80 + protocol: HTTP + status: + listeners: + - attachedRoutes: 1 + conditions: + - lastTransitionTime: null + message: Sending translated listener configuration to the data plane + reason: Programmed + status: "True" + type: Programmed + - lastTransitionTime: null + message: Listener has been successfully translated + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: Listener references have been resolved + reason: ResolvedRefs + status: "True" + type: ResolvedRefs + name: http + supportedKinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute + - group: gateway.networking.k8s.io + kind: GRPCRoute +grpcRoutes: +- apiVersion: gateway.networking.k8s.io/v1alpha2 + kind: GRPCRoute + metadata: + creationTimestamp: null + name: grpcroute-1 + namespace: default + spec: + parentRefs: + - name: gateway-1 + namespace: envoy-gateway + sectionName: http + rules: + - backendRefs: + - name: service-1 + port: 8080 + status: + parents: + - conditions: + - lastTransitionTime: null + message: Route is accepted + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: Resolved all the Object references for the Route + reason: ResolvedRefs + status: "True" + type: ResolvedRefs + controllerName: gateway.envoyproxy.io/gatewayclass-controller + parentRef: + name: gateway-1 + namespace: envoy-gateway + sectionName: http +httpRoutes: +- apiVersion: gateway.networking.k8s.io/v1 + kind: HTTPRoute + metadata: + creationTimestamp: null + name: httproute-1 + namespace: default + spec: + hostnames: + - gateway.envoyproxy.io + parentRefs: + - name: gateway-2 + namespace: envoy-gateway + sectionName: http + rules: + - backendRefs: + - name: service-1 + port: 8080 + matches: + - path: + value: / + status: + parents: + - conditions: + - lastTransitionTime: null + message: Route is accepted + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: Resolved all the Object references for the Route + reason: ResolvedRefs + status: "True" + type: ResolvedRefs + controllerName: gateway.envoyproxy.io/gatewayclass-controller + parentRef: + name: gateway-2 + namespace: envoy-gateway + sectionName: http +infraIR: + envoy-gateway/gateway-1: + proxy: + listeners: + - address: "" + ports: + - containerPort: 10080 + name: http + protocol: HTTP + servicePort: 80 + metadata: + labels: + gateway.envoyproxy.io/owning-gateway-name: gateway-1 + gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway + name: envoy-gateway/gateway-1 + envoy-gateway/gateway-2: + proxy: + listeners: + - address: "" + ports: + - containerPort: 10080 + name: http + protocol: HTTP + servicePort: 80 + metadata: + labels: + gateway.envoyproxy.io/owning-gateway-name: gateway-2 + gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway + name: envoy-gateway/gateway-2 +xdsIR: + envoy-gateway/gateway-1: + accessLog: + text: + - path: /dev/stdout + http: + - address: 0.0.0.0 + hostnames: + - '*' + isHTTP2: true + name: envoy-gateway/gateway-1/http + port: 10080 + routes: + - backendWeights: + invalid: 0 + valid: 0 + destination: + name: grpcroute/default/grpcroute-1/rule/0 + settings: + - endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + hostname: '*' + loadBalancer: + random: {} + name: grpcroute/default/grpcroute-1/rule/0/match/-1/* + envoy-gateway/gateway-2: + accessLog: + text: + - path: /dev/stdout + http: + - address: 0.0.0.0 + hostnames: + - '*' + isHTTP2: false + name: envoy-gateway/gateway-2/http + port: 10080 + routes: + - backendWeights: + invalid: 0 + valid: 0 + destination: + name: httproute/default/httproute-1/rule/0 + settings: + - endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + hostname: gateway.envoyproxy.io + loadBalancer: + consistentHash: + sourceIP: true + name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io + pathMatch: + distinct: false + name: "" + prefix: / diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index ccc579e9da56..5e680fc52baf 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -117,6 +117,7 @@ _Appears in:_ | --- | --- | | `targetRef` _[PolicyTargetReferenceWithSectionName](#policytargetreferencewithsectionname)_ | targetRef is the name of the resource this policy is being attached to. This Policy and the TargetRef MUST be in the same namespace for this Policy to have effect and be applied to the Gateway. | | `rateLimit` _[RateLimitFilterSpec](#ratelimitfilterspec)_ | RateLimit allows the user to limit the number of incoming requests to a predefined value based on attributes within the traffic flow. | +| `loadBalancer` _[LoadBalancer](#loadbalancer)_ | LoadBalancer policy to apply when routing traffic from the gateway to the backend endpoints | @@ -215,6 +216,31 @@ _Appears in:_ +#### ConsistentHash + + + +ConsistentHash defines the configuration related to the consistent hash load balancer policy + +_Appears in:_ +- [LoadBalancer](#loadbalancer) + +| Field | Description | +| --- | --- | +| `type` _[ConsistentHashType](#consistenthashtype)_ | | + + +#### ConsistentHashType + +_Underlying type:_ `string` + +ConsistentHashType defines the type of input to hash on. + +_Appears in:_ +- [ConsistentHash](#consistenthash) + + + #### CustomTag @@ -1024,6 +1050,32 @@ _Appears in:_ | `value` _string_ | Value defines the hard-coded value to add to each span. | +#### LoadBalancer + + + +LoadBalancer defines the load balancer policy to be applied. + +_Appears in:_ +- [BackendTrafficPolicySpec](#backendtrafficpolicyspec) + +| Field | Description | +| --- | --- | +| `type` _[LoadBalancerType](#loadbalancertype)_ | Type decides the type of Load Balancer policy. Valid RateLimitType values are "ConsistentHash", "LeastRequest", "Random", "RoundRobin", | +| `consistentHash` _[ConsistentHash](#consistenthash)_ | ConsistentHash defines the configuration when the load balancer type is set to ConsistentHash | + + +#### LoadBalancerType + +_Underlying type:_ `string` + +LoadBalancerType specifies the types of LoadBalancer. + +_Appears in:_ +- [LoadBalancer](#loadbalancer) + + + #### LogLevel _Underlying type:_ `string`