Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ IMAGE := $(REGISTRY)/$(PROJECT)
SRCDIRS := ./cmd ./internal ./apis
LOCAL_BOOTSTRAP_CONFIG = localenvoyconfig.yaml
SECURE_LOCAL_BOOTSTRAP_CONFIG = securelocalenvoyconfig.yaml
ENVOY_IMAGE = docker.io/envoyproxy/envoy:v1.19.1
ENVOY_IMAGE = docker.io/envoyproxy/envoy:v1.20.1
GATEWAY_API_VERSION = $(shell grep "sigs.k8s.io/gateway-api" go.mod | awk '{print $$2}')

# Used to supply a local Envoy docker container an IP to connect to that is running
Expand Down
1 change: 1 addition & 0 deletions changelogs/unreleased/4075-sunjayBhatia-small.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bump Envoy to v1.20.1. See [release notes](https://www.envoyproxy.io/docs/envoy/v1.20.1/version_history/current).
2 changes: 1 addition & 1 deletion examples/contour/03-envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
- --log-level info
command:
- envoy
image: docker.io/envoyproxy/envoy:v1.19.1
image: docker.io/envoyproxy/envoy:v1.20.1
imagePullPolicy: IfNotPresent
name: envoy
env:
Expand Down
2 changes: 1 addition & 1 deletion examples/render/contour-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5133,7 +5133,7 @@ spec:
- --log-level info
command:
- envoy
image: docker.io/envoyproxy/envoy:v1.19.1
image: docker.io/envoyproxy/envoy:v1.20.1
imagePullPolicy: IfNotPresent
name: envoy
env:
Expand Down
2 changes: 1 addition & 1 deletion examples/render/contour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5130,7 +5130,7 @@ spec:
- --log-level info
command:
- envoy
image: docker.io/envoyproxy/envoy:v1.19.1
image: docker.io/envoyproxy/envoy:v1.20.1
imagePullPolicy: IfNotPresent
name: envoy
env:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0
github.com/bombsimon/logrusr v1.0.0
github.com/davecgh/go-spew v1.1.1
github.com/envoyproxy/go-control-plane v0.9.10-0.20210806072310-abdc764d71d2
github.com/envoyproxy/go-control-plane v0.9.10-0.20211006050637-f76d23b38f14
github.com/go-logr/logr v0.4.0
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.6
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ github.com/cloudflare/cloudflare-go v0.20.0/go.mod h1:sPWL/lIC6biLEdyGZwBQ1rGQKF
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed h1:OZmjad4L3H8ncOIR8rnb5MREYqG8ixi5+WbeUsquF0c=
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe h1:QJDJubh0OEcpeGjC7/8uF9tt4e39U/Ya1uyK+itnNPQ=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08/go.mod h1:pCxVEbcm3AMg7ejXyorUXi6HQCzOIBf7zEDVPtw0/U4=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo=
Expand Down Expand Up @@ -265,8 +265,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210806072310-abdc764d71d2 h1:/iuhlbooXa+EfHt42+/MMeiVb2B16sSfqF+vHEyByqk=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210806072310-abdc764d71d2/go.mod h1:+baROYa9cKpDyN21rZlsSq5zgBrZOrMTNu78Lm3fFJQ=
github.com/envoyproxy/go-control-plane v0.9.10-0.20211006050637-f76d23b38f14 h1:+i20cKEgdzKq9kPay5sCQFs54hCTXCO+sCAMH5HQIDc=
github.com/envoyproxy/go-control-plane v0.9.10-0.20211006050637-f76d23b38f14/go.mod h1:kO0EGgHDqkmaTB0bvNfdXEVQsUOD+poi+ry4urQS1qc=
github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ=
Expand Down
16 changes: 7 additions & 9 deletions internal/xds/v3/snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
envoy_types "github.com/envoyproxy/go-control-plane/pkg/cache/types"
envoy_cache_v3 "github.com/envoyproxy/go-control-plane/pkg/cache/v3"
envoy_log "github.com/envoyproxy/go-control-plane/pkg/log"
envoy_resource_v3 "github.com/envoyproxy/go-control-plane/pkg/resource/v3"
"github.com/projectcontour/contour/internal/xds"
"github.com/projectcontour/contour/internal/xdscache"
)
Expand All @@ -35,18 +36,15 @@ type snapshotter struct {
envoy_cache_v3.SnapshotCache
}

func (s *snapshotter) Generate(version string, resources map[envoy_types.ResponseType][]envoy_types.Resource) error {
func (s *snapshotter) Generate(version string, resources map[envoy_resource_v3.Type][]envoy_types.Resource) error {
// Create a snapshot with all xDS resources.
snapshot := envoy_cache_v3.NewSnapshot(
snapshot, err := envoy_cache_v3.NewSnapshot(
version,
resources[envoy_types.Endpoint],
resources[envoy_types.Cluster],
resources[envoy_types.Route],
resources[envoy_types.Listener],
nil,
resources[envoy_types.Secret],
nil,
resources,
)
if err != nil {
return err
}

return s.SetSnapshot(context.TODO(), Hash.String(), snapshot)
}
Expand Down
36 changes: 13 additions & 23 deletions internal/xdscache/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ import (
"sync"

envoy_types "github.com/envoyproxy/go-control-plane/pkg/cache/types"
resource "github.com/envoyproxy/go-control-plane/pkg/resource/v3"
envoy_resource_v3 "github.com/envoyproxy/go-control-plane/pkg/resource/v3"
"github.com/projectcontour/contour/internal/dag"
"github.com/sirupsen/logrus"
)

type Snapshotter interface {
Generate(version string, resources map[envoy_types.ResponseType][]envoy_types.Resource) error
Generate(version string, resources map[envoy_resource_v3.Type][]envoy_types.Resource) error
}

// SnapshotHandler implements the xDS snapshot cache
// by responding to the OnChange() event causing a new
// snapshot to be created.
type SnapshotHandler struct {
// resources holds the cache of xDS contents.
resources map[envoy_types.ResponseType]ResourceCache
resources map[envoy_resource_v3.Type]ResourceCache

// snapshotVersion holds the current version of the snapshot.
snapshotVersion int64
Expand Down Expand Up @@ -77,12 +77,13 @@ func (s *SnapshotHandler) generateNewSnapshot() {
// Generate new snapshot version.
version := s.newSnapshotVersion()

resources := map[envoy_types.ResponseType][]envoy_types.Resource{
envoy_types.Endpoint: asResources(s.resources[envoy_types.Endpoint].Contents()),
envoy_types.Cluster: asResources(s.resources[envoy_types.Cluster].Contents()),
envoy_types.Route: asResources(s.resources[envoy_types.Route].Contents()),
envoy_types.Listener: asResources(s.resources[envoy_types.Listener].Contents()),
envoy_types.Secret: asResources(s.resources[envoy_types.Secret].Contents()),
// Convert caches to envoy xDS Resources.
resources := map[envoy_resource_v3.Type][]envoy_types.Resource{
envoy_resource_v3.EndpointType: asResources(s.resources[envoy_resource_v3.EndpointType].Contents()),
envoy_resource_v3.ClusterType: asResources(s.resources[envoy_resource_v3.ClusterType].Contents()),
envoy_resource_v3.RouteType: asResources(s.resources[envoy_resource_v3.RouteType].Contents()),
envoy_resource_v3.ListenerType: asResources(s.resources[envoy_resource_v3.ListenerType].Contents()),
envoy_resource_v3.SecretType: asResources(s.resources[envoy_resource_v3.SecretType].Contents()),
}

s.snapLock.Lock()
Expand Down Expand Up @@ -129,22 +130,11 @@ func asResources(messages interface{}) []envoy_types.Resource {

// parseResources converts an []ResourceCache to a map[envoy_types.ResponseType]ResourceCache
// for faster indexing when creating new snapshots.
func parseResources(resources []ResourceCache) map[envoy_types.ResponseType]ResourceCache {
resourceMap := make(map[envoy_types.ResponseType]ResourceCache, len(resources))
func parseResources(resources []ResourceCache) map[envoy_resource_v3.Type]ResourceCache {
resourceMap := make(map[envoy_resource_v3.Type]ResourceCache, len(resources))

for _, r := range resources {
switch r.TypeURL() {
case resource.ClusterType:
resourceMap[envoy_types.Cluster] = r
case resource.RouteType:
resourceMap[envoy_types.Route] = r
case resource.ListenerType:
resourceMap[envoy_types.Listener] = r
case resource.SecretType:
resourceMap[envoy_types.Secret] = r
case resource.EndpointType:
resourceMap[envoy_types.Endpoint] = r
}
resourceMap[r.TypeURL()] = r
}
return resourceMap
}
3 changes: 2 additions & 1 deletion site/content/resources/compatibility-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ These combinations of versions are specifically tested in CI and supported by th

| Contour Version | Envoy Version | Kubernetes Versions | Operator Version | Gateway API Version |
| --------------- | :------------------- | ------------------- | ---------------- | --------------------|
| main | [1.19.1][13] | 1.22, 1.21, 1.20 | [main][50] | v1alpha2 |
| main | [1.20.1][14] | 1.22, 1.21, 1.20 | [main][50] | v1alpha2 |
| 1.19.1 | [1.19.1][13] | 1.22, 1.21, 1.20 | [1.19.1][65] | v1alpha1 |
| 1.19.0 | [1.19.1][13] | 1.22, 1.21, 1.20 | [1.19.0][64] | v1alpha1 |
| 1.18.3 | [1.19.1][13] | 1.21, 1.20, 1.19 | [1.18.3][66] | v1alpha1 |
Expand Down Expand Up @@ -107,6 +107,7 @@ __Note:__ This list of extensions was last verified to be complete with Envoy v1
[11]: https://www.envoyproxy.io/docs/envoy/v1.17.4/version_history/current
[12]: https://www.envoyproxy.io/docs/envoy/v1.18.4/version_history/current
[13]: https://www.envoyproxy.io/docs/envoy/v1.19.1/version_history/current
[14]: https://www.envoyproxy.io/docs/envoy/v1.20.1/version_history/current

[50]: https://github.com/projectcontour/contour-operator
[51]: https://github.com/projectcontour/contour-operator/releases/tag/v1.11.0
Expand Down
2 changes: 1 addition & 1 deletion versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ versions:
- version: main
supported: "false"
dependencies:
envoy: "1.19.1"
envoy: "1.20.1"
kubernetes:
- "1.22"
- "1.21"
Expand Down