Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

gateway-api: update to v0.5.0 and v1beta1 resources #224

Merged
merged 17 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b4eafec
deps: bump gateway-api to sigs.k8s.io/gateway-api@v0.5.0-rc1
mikemorris Jun 13, 2022
086387d
gateway-api: update ParentRef -> ParentReference
nathancoleman May 13, 2022
19578a0
k8s: update Handler->ProbeHandler for compat with v0.23+
mikemorris Jun 7, 2022
5caf5c8
k8s/reconciler: deref for l.listener.TLS.CertificateRefs no longer ne…
mikemorris Jun 7, 2022
62e08a3
k8s/logger: reimplement k8s logger as LogSink
mikemorris Jun 7, 2022
171e10e
gateway-api: update CertificateRefs to []SecretObjectReference from p…
mikemorris Jun 7, 2022
25c3fbc
e2e: update readCRDs signature to return []*api.CustomResourceDefinition
mikemorris Jun 1, 2022
511ab58
gateway-api: update ReferencePolicy -> ReferenceGrant
mikemorris Jun 13, 2022
d5c2691
changelog: add entry for gateway-api@v0.5.0
mikemorris Jun 13, 2022
63e14f6
config/crd: install Gateway API experimental channel CRDs
mikemorris Jun 15, 2022
daa9b02
dev/run: install CRDs from config/crd
mikemorris Jun 17, 2022
1c5e804
e2e/kubernetes: install Consul API Gateway CRDs alongside Gateway API…
mikemorris Jun 16, 2022
18c457f
e2e: import both Gateway API v1alpha2 and v1beta1, split usage
mikemorris Jun 15, 2022
6bbb804
k8s: move Gateway API usage to v1beta1 or explicitly v1alpha2 for Rou…
mikemorris Jun 16, 2022
6fee687
config/crd: install deprecated ReferencePolicies CRD explicitly
mikemorris Jun 20, 2022
09fede1
ci: clone consul-k8s repo and install Consul Helm chart from custom b…
mikemorris Jun 21, 2022
04935cd
Apply suggestions from code review
mikemorris Jul 1, 2022
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
6 changes: 6 additions & 0 deletions .changelog/224.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:feature
gateway-api: update to the [v0.5.0-rc1](https://github.com/kubernetes-sigs/gateway-api/releases/tag/v0.5.0-rc1) release with v1beta1 resource support
```
```release-note:deprecation
gateway-api: ReferencePolicy is deprecated and will be removed in a future release. The functionally identical ReferenceGrant should be used instead.
```
mikemorris marked this conversation as resolved.
Show resolved Hide resolved
15 changes: 11 additions & 4 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
api-gateway-image: "hashicorppreview/consul-api-gateway:0.4-dev"
consul-image: "hashicorp/consul:1.11"
envoy-image: "envoyproxy/envoy:v1.20-latest"
consul-k8s-version: "0.45.0"
mikemorris marked this conversation as resolved.
Show resolved Hide resolved
consul-k8s-version: "charts/capigw-controller-clusterrole-referencegrants"
- name: "consul@v1.12 + consul-k8s@v0.45.0"
api-gateway-image: "hashicorppreview/consul-api-gateway:0.4-dev"
consul-image: "hashicorp/consul:1.12"
envoy-image: "envoyproxy/envoy:v1.22-latest"
consul-k8s-version: "0.45.0"
consul-k8s-version: "charts/capigw-controller-clusterrole-referencegrants"
fail-fast: true
name: "${{ matrix.cluster-type }} - ${{ matrix.config.name }}"
concurrency:
Expand All @@ -47,12 +47,20 @@ jobs:
# Clone repos side-by-side:
# GITHUB_WORKSPACE/
# consul-api-gateway/
# consul-k8s/
# gateway-api/
- name: Checkout consul-api-gateway
uses: actions/checkout@v2
with:
path: "consul-api-gateway"

- name: Clone consul-k8s
uses: actions/checkout@v2
with:
repository: "hashicorp/consul-k8s"
ref: ${{ matrix.config.consul-k8s-version }}
path: "consul-k8s"

- name: Clone gateway-api
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -88,8 +96,7 @@ jobs:
- name: Install Consul
working-directory: "consul-api-gateway/internal/testing/conformance"
run: |
helm repo add hashicorp https://helm.releases.hashicorp.com
helm install --values ./consul-config.yaml consul hashicorp/consul --version "${{ matrix.config.consul-k8s-version }}" --set global.image=${{ matrix.config.consul-image }} --set global.imageEnvoy=${{ matrix.config.envoy-image }} --set apiGateway.image=${{ matrix.config.api-gateway-image }} --create-namespace --namespace=consul
helm install --values ./consul-config.yaml consul $GITHUB_WORKSPACE/consul-k8s/charts/consul --set global.image=${{ matrix.config.consul-image }} --set global.imageEnvoy=${{ matrix.config.envoy-image }} --set apiGateway.image=${{ matrix.config.api-gateway-image }} --create-namespace --namespace=consul
kubectl wait --for=condition=Ready --timeout=120s --namespace=consul pods --all

- name: Patch testing resources
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/conformance_with_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,33 @@ jobs:
api-gateway-image: "consul-api-gateway:local-build"
consul-image: "hashicorp/consul:1.11"
envoy-image: "envoyproxy/envoy:v1.20-latest"
consul-k8s-version: "0.45.0"
consul-k8s-version: "charts/capigw-controller-clusterrole-referencegrants"
- name: "consul@v1.12 + consul-k8s@v0.45.0"
api-gateway-image: "consul-api-gateway:local-build"
consul-image: "hashicorp/consul:1.12"
envoy-image: "envoyproxy/envoy:v1.22-latest"
consul-k8s-version: "0.45.0"
consul-k8s-version: "charts/capigw-controller-clusterrole-referencegrants"
fail-fast: true
name: "${{ matrix.config.name }}"

steps:
# Clone repos side-by-side:
# GITHUB_WORKSPACE/
# consul-api-gateway/
# consul-k8s/
# gateway-api/
- name: Checkout consul-api-gateway
uses: actions/checkout@v2
with:
path: "consul-api-gateway"

- name: Clone consul-k8s
uses: actions/checkout@v2
with:
repository: "hashicorp/consul-k8s"
ref: ${{ matrix.config.consul-k8s-version }}
path: "consul-k8s"

- name: Clone gateway-api
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -101,8 +109,7 @@ jobs:
- name: Install Consul
working-directory: "consul-api-gateway/internal/testing/conformance"
run: |
helm repo add hashicorp https://helm.releases.hashicorp.com
helm install --values ./consul-config.yaml consul hashicorp/consul --version "${{ matrix.config.consul-k8s-version }}" --set global.image=${{ matrix.config.consul-image }} --set global.imageEnvoy=${{ matrix.config.envoy-image }} --set apiGateway.image=${{ matrix.config.api-gateway-image }} --create-namespace --namespace=consul
helm install --values ./consul-config.yaml consul $GITHUB_WORKSPACE/consul-k8s/charts/consul --set global.image=${{ matrix.config.consul-image }} --set global.imageEnvoy=${{ matrix.config.envoy-image }} --set apiGateway.image=${{ matrix.config.api-gateway-image }} --create-namespace --namespace=consul
kubectl wait --for=condition=Ready --timeout=60s --namespace=consul pods --all

- name: Patch testing resources
Expand Down
5 changes: 3 additions & 2 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- github.com/kubernetes-sigs/gateway-api/config/crd?ref=v0.4.1
- github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v0.5.0-rc1
- https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v0.5.0-rc1/config/crd/experimental/gateway.networking.k8s.io_referencepolicies.yaml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to be installed explicitly because kustomize seems to omit the ReferencePolicies CRD by default due to it being marked deprecated: true. Remote resource install refs kubernetes-sigs/kustomize#970 (comment)

- bases/api-gateway.consul.hashicorp.com_gatewayclassconfigs.yaml
- bases/api-gateway.consul.hashicorp.com_meshservices.yaml
- bases/api-gateway.consul.hashicorp.com_meshservices.yaml
8 changes: 8 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ rules:
- get
- patch
- update
- apiGroups:
- gateway.networking.k8s.io
resources:
- referencegrants
verbs:
- get
- list
- watch
- apiGroups:
- gateway.networking.k8s.io
resources:
Expand Down
5 changes: 3 additions & 2 deletions dev/docs/supported-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ Supported features are marked with a grey checkbox
- [x] *ResolvedRefs* indicates that we were able to resolve all route references to things like Kubernetes/Consul services
- [x] *ServiceNotFound* weren't able to find the referenced Kubernetes service
- [x] *ConsulServiceNotFound* weren't able to find the referenced Consul mesh service
- [x] *RefNotPermitted* weren't able to route across namespaces due to a missing ReferencePolicy
- [x] *RefNotPermitted* weren't able to route across namespaces due to a missing ReferenceGrant

- [x] TCPRoute - we are limited by Consul's ability to only route to a single TCP-based upstream, so TCP-based Gateway listeners only support a single TCPRoute with a single rule with a single backend; otherwise, either the TCPRoute is considered invalid or the Gateway status is set as having conflicting routes.
- [ ] TLSRoute - TODO
- [x] UDPRoute *not supported*
- [x] ReferencePolicy - Routes currently require ReferencePolicies for all BackendRefs, and do not support partial acceptance if any BackendRefs are unpermitted
- [x] ReferenceGrant - Routes currently require ReferenceGrant for all BackendRefs, and do not support partial acceptance if any BackendRefs are unpermitted
- [x] From
- [x] HTTPRoute
- [x] TCPRoute
Expand All @@ -140,3 +140,4 @@ Supported features are marked with a grey checkbox
- [x] To
- [x] Service
- [x] Secret
- [x] ReferencePolicy - Supported for backwards compatibility, will be removed in a future release
10 changes: 2 additions & 8 deletions dev/run
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ createCluster() {
}

installGatewayCRDs() {
echo "Installing Gateway CRDs"
kubectl apply -k "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v0.4.1" 2>&1 > /dev/null
echo "Installing Gateway API and Consul API Gateway CRDs"
kubectl apply -k config/crd
mikemorris marked this conversation as resolved.
Show resolved Hide resolved
}

createServiceAccountForRBAC() {
Expand Down Expand Up @@ -70,11 +70,6 @@ setupAuthMethod() {
echo $CONSUL_HTTP_TOKEN > token
}

installAPIGatewayCRDs() {
kubectl apply -f config/crd/bases/api-gateway.consul.hashicorp.com_gatewayclassconfigs.yaml
kubectl apply -f config/crd/bases/api-gateway.consul.hashicorp.com_meshservices.yaml
}

buildAPIGateway() {
echo "Cross-compiling consul-api-gateway for Linux"
GOOS=linux go build 2>&1 > /dev/null
Expand Down Expand Up @@ -108,7 +103,6 @@ main() {
setupAuthMethod
fi
if [[ "${load}" == "TRUE" ]]; then
installAPIGatewayCRDs
buildAPIGateway
buildDocker
loadDockerImage
Expand Down
68 changes: 36 additions & 32 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ require (
github.com/envoyproxy/go-control-plane v0.9.10-0.20211015211602-cfdef0997689
github.com/getkin/kin-openapi v0.97.0
github.com/go-chi/chi/v5 v5.0.7
github.com/go-logr/logr v0.4.0
github.com/go-logr/logr v1.2.0
github.com/golang/mock v1.6.0
github.com/google/uuid v1.2.0
github.com/hashicorp/consul/api v1.12.1-0.20220111183205-dcf1cd485363
github.com/hashicorp/consul/sdk v0.8.0
github.com/hashicorp/go-hclog v0.16.2
github.com/hashicorp/go-multierror v1.1.0
github.com/mitchellh/cli v1.1.2
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/client_golang v1.12.1
github.com/stretchr/testify v1.7.2
github.com/vladimirvivien/gexe v0.1.1
golang.org/x/exp v0.0.0-20220518171630-0b5c67f07fdf
golang.org/x/net v0.0.0-20210825183410-e898025ed96a
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
google.golang.org/grpc v1.40.0
k8s.io/api v0.22.1
k8s.io/apiextensions-apiserver v0.21.3
k8s.io/apimachinery v0.22.1
k8s.io/client-go v0.22.1
k8s.io/klog/v2 v2.10.0
sigs.k8s.io/controller-runtime v0.9.6
k8s.io/api v0.24.1
k8s.io/apiextensions-apiserver v0.24.1
k8s.io/apimachinery v0.24.1
k8s.io/client-go v0.24.1
k8s.io/klog/v2 v2.60.1
sigs.k8s.io/controller-runtime v0.12.1
sigs.k8s.io/e2e-framework v0.0.3
sigs.k8s.io/gateway-api v0.4.1
sigs.k8s.io/gateway-api v0.5.0-rc1
)

require (
Expand All @@ -40,11 +40,13 @@ require (
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/Microsoft/go-winio v0.4.17 // indirect
github.com/Microsoft/hcsshim v0.9.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/census-instrumentation/opencensus-proto v0.2.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe // indirect
github.com/containerd/cgroups v1.0.1 // indirect
github.com/containerd/containerd v1.5.7 // indirect
Expand All @@ -53,18 +55,20 @@ require (
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
github.com/envoyproxy/protoc-gen-validate v0.1.0 // indirect
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fatih/color v1.12.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
Expand All @@ -77,7 +81,7 @@ require (
github.com/imdario/mergo v0.3.12 // indirect
github.com/invopop/yaml v0.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
Expand All @@ -91,36 +95,36 @@ require (
github.com/moby/sys/mountinfo v0.4.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/onsi/gomega v1.15.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/opencontainers/runc v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.opencensus.io v0.23.0 // indirect
go.uber.org/zap v1.19.0 // indirect
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602 // indirect
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/protobuf v1.26.0 // indirect
google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/component-base v0.21.3 // indirect
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e // indirect
k8s.io/utils v0.0.0-20210820185131-d34e5cb4466e // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
k8s.io/component-base v0.24.1 // indirect
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading