Contour is a powerful and modern ingress controller designed to manage external access to services within Kubernetes clusters. It leverages the Envoy proxy, renowned for its performance and extensibility, to provide high availability, scalability, and speed for incoming traffic. Contour excels in handling complex routing scenarios and seamlessly integrates with various cloud-native ecosystems.
While Contour's primary configuration is through Kubernetes manifests, here's a simplified example of an IngressRoute definition:
```yaml apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata:
name: my-appspec:
parentRefs: - name: my-gateway hostnames: - "www.example.com" rules: - matches: - path: / headers: - name: x-version values: ["v1"] forwardTo: - serviceName: my-app-v1 port: 80 - matches: - path: / headers: - name: x-version values: ["v2"] forwardTo: - serviceName: my-app-v2 port: 80```
This configuration defines an HTTPRoute for the hostname “[www.example.com](https://www.example.com),” routing requests to different services (`my-app-v1` or `my-app-v2`) based on the value of the `x-version` header.