Announcing Contour v1.12.0

Steve Kriss
Steve Kriss
February 02, 2021

Contour continues to add new features to help you better manage ingress operations in a cluster. Our latest feature release, Contour 1.12.0, adds support for local rate limiting on HTTPProxy virtual hosts and routes, dynamic request headers, and header hash load balancing.

Local Rate Limiting

Rate limiting is a means of protecting backend services against unwanted traffic. This can be useful for a variety of different scenarios:

  • Protecting against denial-of-service (DoS) attacks by malicious actors
  • Protecting against DoS incidents due to bugs in client applications/services
  • Enforcing usage quotas for different classes of clients, e.g. free vs. paid tiers
  • Controlling resource consumption/cost

Envoy supports two different types of rate limiting: local and global. In local rate limiting, a rate limit is applied to traffic by each individual Envoy process/pod, without sharing information across multiple instances of Envoy. In global rate limiting, all Envoy instances communicate with an external Rate Limit Service (RLS) via gRPC to make rate limit decisions.

Contour 1.12.0 adds support for Envoy’s local rate limiting. This enables Contour users to protect their backend services by defining simple limits for how much traffic each Envoy process/pod should proxy to them. Local rate limits can be defined for an entire virtual host, or for individual routes. Here’s an example of an HTTPProxy that allows 100 requests per second from each Envoy pod to reach a backend service:

apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: ratelimited-route
spec:
  virtualhost:
    fqdn: ratelimit.projectcontour.io
  routes:
  - conditions:
    - prefix: /ratelimited-service
    services:
    - name: s1
      port: 80
    rateLimitPolicy:
      local:
        requests: 100
        unit: second

Requests above the 100-per-second limit will receive a 429 (Too Many Requests) response by default. The response code can also be customized.

For more information, see:

For users with more advanced rate-limiting needs, Contour will also be adding global rate limiting support in an upcoming release.

Dynamic Request Headers

Contour 1.12 also adds support for including dynamic values in configured request and response headers. Almost all variables supported by Envoy are allowed. This feature can be used to set headers containing information such as the host name of where the Envoy pod is running, the TLS version, etc.

For more information, including a full list of supported variables, see the Contour documentation.

A big thanks to @erwbgy for designing and implementing this feature!

Header Hash Load Balancing

Contour 1.12 now supports the RequestHash load balancing strategy, which enables load balancing based on request headers. An upstream Endpoint is selected based on the hash of an HTTP request header. Requests that contain a consistent value in a request header will be routed to the same upstream Endpoint.

For more information, including an example HTTPProxy definition, see the Contour documentation.

Community Thanks!

We’re immensely grateful for all the community contributions that help make Contour even better! For version 1.12, special thanks go out to the following contributors:


Join the Contour Community!

  • Join the Contour Community Meetings
    • For Australia time zones:
      • Every first and third Tuesday at 6:30 PM Eastern Time / 3:30 PM Pacific Time / Wednesday at 9:30 AM Australian Eastern Time.
    • For Americas time zones:
      • Every second and fourth Tuesday at 1 PM Eastern Time / 10 AM Pacific Time
    • Join the mailing list to get an automated invitation to the meeting. This is a low-volume list that is only used for release announcements.
  • Get updates on Twitter (@projectcontour)
  • Chat with us in #contour on the Kubernetes Slack
  • Collaborate with us on GitHub
Related Content
Announcing Contour v1.13.0
Announcing Contour v1.12.0
Ready to try Contour?

Read our getting started documentation.