Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Bump Gateway API version to v0.5.0-rc1 #315

Merged
merged 35 commits into from
Jul 11, 2022

Conversation

carlisia
Copy link
Member

@carlisia carlisia commented Jun 28, 2022

Closes #306.
Closes #292.

  • Upgraded Gateway API import paths + deps to v0.5.0-rc1
  • Updated CRDs, config, instructions + point to local CRDs
  • ParentRef -> ParentReference
  • ConditionRouteAccepted -> RouteConditionAccepted
  • Refactored out test configuration for different vendors into a common setup file (setup-and-deploy.sh)
  • improved README and DEVELOPMENT documentation

Incoming in a separate PR(s):

@knative-prow
Copy link

knative-prow bot commented Jun 28, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 28, 2022
@carlisia
Copy link
Member Author

/assign @nak3

README.md Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@carlisia
Copy link
Member Author

/retest

@codecov
Copy link

codecov bot commented Jun 28, 2022

Codecov Report

Merging #315 (714fff0) into main (a15b90b) will not change coverage.
The diff coverage is 63.93%.

@@           Coverage Diff           @@
##             main     #315   +/-   ##
=======================================
  Coverage   12.91%   12.91%           
=======================================
  Files          20       20           
  Lines        2958     2958           
=======================================
  Hits          382      382           
  Misses       2554     2554           
  Partials       22       22           
Impacted Files Coverage Δ
pkg/reconciler/ingress/ingress.go 72.00% <0.00%> (ø)
test/conformance/gateway-api/basic.go 0.00% <0.00%> (ø)
test/conformance/gateway-api/grpc.go 0.00% <0.00%> (ø)
test/conformance/gateway-api/headers.go 0.00% <0.00%> (ø)
test/conformance/gateway-api/hosts.go 0.00% <0.00%> (ø)
test/conformance/gateway-api/path.go 0.00% <0.00%> (ø)
test/conformance/gateway-api/percentage.go 0.00% <0.00%> (ø)
test/conformance/gateway-api/rule.go 0.00% <0.00%> (ø)
test/conformance/gateway-api/run.go 0.00% <ø> (ø)
test/conformance/gateway-api/timeout.go 0.00% <0.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a15b90b...714fff0. Read the comment docs.

Copy link
Contributor

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

FWIW, the 100-, 200-, etc prefixes on files in /config are pretty standard elsewhere in Knative (which makes it easier to put in more config files), but I don't have a strong feeling about 01-, 03- and 04- instead.

There are a couple places where I think you ended up replacing /config with /third_party/gateway-api which you didn't mean to, but this otherwise looks as reasonable as can be expected given the changes between 0.4.0 and 0.5.0-rc1.

Thanks!

README.md Outdated Show resolved Hide resolved
hack/update-codegen.sh Outdated Show resolved Hide resolved
test/e2e-common.sh Outdated Show resolved Hide resolved
@dprotaso
Copy link
Contributor

Latest gateway-api @ HEAD has the fix (kubernetes-sigs/gateway-api#1239) to unblock injection/code generation - doing a go get sigs.k8s.io/gateway-api@main should pull in the changes

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 29, 2022
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 29, 2022
@carlisia
Copy link
Member Author

I'm fixing the e2e test scripts so they (hopefully) each contain what's needed for starting the corresponding controller (and waiting for it to be ready), and no more.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 1, 2022
@evankanderson
Copy link
Contributor

Let me know when this goes in. I think you wanted this before #316, so I'm going to hold that one since it's still open.

@carlisia
Copy link
Member Author

carlisia commented Jul 2, 2022

Argh, I am sorry that I only saw this now. Wanted to reorg the e2e tests in a separate PR but realized it needs to be done in a way that is compatible with how serving loads tests and artifacts, and so both sides need to be changed.

I will spruce up a couple minor things and have this PR ready tomorrow morning.

carlisia and others added 10 commits July 2, 2022 16:29
Our injection generated code was not being generated correctly anyway.
Pulling from main for now which now contains the correct `ReferencePolicyList.Items.[]ReferencePolicy` spec.
- Reverted:
    - third_party/gateway-api/ -> config/
- Refactored out test configuration for different vendor into a common setup file
- Improved docs for installation (README) (closes knative-extensions#292) and for development/testing (DEVELOPMENT).
@carlisia
Copy link
Member Author

carlisia commented Jul 7, 2022

I know what's causing these failures, will have a fix soon.

@carlisia
Copy link
Member Author

carlisia commented Jul 7, 2022

  • ✅ conformance tests
    • there's 1 failing but it's the same failure in main: e2e tests (v1.23.6)
    • Error meeting response expectations: got unexpected status: 503, expected map[200:{}]
    • considering parity with main a good threshold bar for this PR :) (unless the fix is obvious)
  • ✅ e2e tests
  • integration-tests_net-gateway-api_main

fix for the above coming next..

@carlisia
Copy link
Member Author

carlisia commented Jul 8, 2022

Tests are passing now.

@evankanderson
Copy link
Contributor

(Adding this to the queue of reviews I need to do tonight)

Copy link
Contributor

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

Looks fairly good -- I think only one or two of these are actionable.

/approve

(Will /lgtm if you decide that you want to handle followups as "quick win" subsequent changes.)

- name: Prepare test namespaces
run: |
kubectl apply -f test/config/

- name: Upload Test Images
run: |
# Build and Publish our test images to the docker daemon.
./test/upload-test-images.sh

- name: Run e2e Tests
- name: Run Conformance Tests
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed in person, separating the test refactor and the go.mod changes and upgrade fallout probably would make for two easier-to-review PRs that wouldn't get blocked on each other working.

More of an "advice for next time and bystanders" than a direction for this PR.

Comment on lines +12 to +13

tmp
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this an artifact of your development patterns, or do we now write files to a local tmp?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not mine. This tmp dir gets created during the code generation. Because it was taking so long/freezing on my machine and I had to kill that process many times, I noticed that depending on how far in the process the dir wouldn't have been cleaned up.

I could have added that to my global gitignore but figured it will be useful in the case when interrupting the codegen before it runs to the end.

This doc explains how to setup a development environment so you can get started
[contributing](https://www.knative.dev/contributing/) to Knative
`net-gateway-api`. Also take a look at:
contributing to Knative `net-gateway-api`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why cut the link to the other contributing docs?

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved it to a bullet the very next line, next to another link of similar kind.


### Checkout your fork
## Notes
If you use the konk script to setup your cluster, your cluster will be named `knative`. However, most of the scripts expect it to be the default `kind` name. Set the kind cluster name env `export KIND_CLUSTER_NAME=knative` to point to `knative` cluster. KO requires a registry which if you are developing locally you could use `export KO_DOCKER_REPO=kind.local` to use the local one on kind. Please see official [KO documentation](https://github.com/google/ko#local-publishing-options) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

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

Link to the konk script?

Copy link
Contributor

Choose a reason for hiding this comment

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

If you're using a non-standard Kind cluster name with KO_DOCKER_REPO=kind.local, the KIND_CLUSTER_NAME also needs to be set, which isn't clear from these directions. Is KIND_CLUSTER_NAME used by other scripts or tools in this repo?

Comment on lines +17 to +21
1. A running cluster
2. [Knative serving installed](README.md#install-knative-serving)
3. [`ko`](https://github.com/google/ko) (for development and testing)
4. [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/) (for managing development environments)
5. [`bash`](https://www.gnu.org/software/bash/) v4 or later. On macOS the default bash is too old, you can use [Homebrew](https://brew.sh) to install a later version.
Copy link
Contributor

Choose a reason for hiding this comment

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

Golang?

Comment on lines +66 to +70
# TODO(carlisia): remove the below two lines in a future release.
# Reason: although the `gateway.networking.k8s.io_referencepolicies.yaml` file is included in the `v0.5.0-rc1` version, it is not referenced in the corresponding kustomize file. I'm assuming this will remain the same for the actual release.
# The file reference is included in the kustomize file in the `main` branch. With that, if these lines are not removed, there would be a duplicate of this resource.
echo "---" >> "${REPO_ROOT_DIR}/config/100-gateway-api.yaml"
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/${GATEWAY_API_VERSION}/config/crd/experimental/gateway.networking.k8s.io_referencepolicies.yaml" >> "${REPO_ROOT_DIR}/config/100-gateway-api.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, unless I am misunderstanding the question.

I think you are remembering the conversation about this fix: fix ReferencePolicyList.Items type by dprotaso · Pull Request #1239 · kubernetes-sigs/gateway-api. This fix is in main and will be included in the final v0.5.0 (I confirmed it).

I adjusted the go mod dep to include what is in main so at least the generated code (on our end) and the deps now match.

gatewayRef := gatewayv1alpa2.ParentRef{
Namespace: namespacePtr(gatewayv1alpa2.Namespace(namespacedNameGateway.Namespace)),
Name: gatewayv1alpa2.ObjectName(namespacedNameGateway.Name),
gatewayRef := gatewayv1alpha2.ParentReference{
Copy link
Contributor

Choose a reason for hiding this comment

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

Reviewing note: Combining the typo fix with the s/ParentRef/ParentReference/ makes it harder to scan n' approve the file -- there are at least two different red/green patterns to look for.

Comment on lines +48 to +52
function cluster_info() {
CONTROL_NAMESPACE=knative-serving
IPS=( $(kubectl get nodes -lkubernetes.io/hostname!=kind-control-plane -ojsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}') )
CLUSTER_SUFFIX=${CLUSTER_SUFFIX:-cluster.local}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

cluster_info here feels very similar to export_cluster_info in e2e-common.sh. Combine?

Copy link
Contributor

Choose a reason for hiding this comment

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

(Feel free to make this a TODO if it feels too fragile to do right now)

Comment on lines +85 to +112
function kind_e2e_istio() {
export GATEWAY_OVERRIDE=""
export GATEWAY_NAMESPACE_OVERRIDE=""

cluster_info

go test -race -count=1 -short -timeout=20m -tags=e2e ./test/conformance \
--enable-alpha --enable-beta \
--skip-tests="${ISTIO_UNSUPPORTED_E2E_TESTS}" \
--ingressendpoint="${IPS[0]}" \
--ingressClass=gateway-api.ingress.networking.knative.dev \
--cluster-suffix="$CLUSTER_SUFFIX"

# Give the controller time to sync with the rest of the system components.
sleep 30

echo ">> Scale up controller for HA tests"
kubectl -n "${CONTROL_NAMESPACE}" scale deployment net-gateway-api-controller --replicas=2

go test -count=1 -timeout=15m -failfast -parallel=1 -tags=e2e ./test/ha -spoofinterval="10ms" \
--enable-alpha --enable-beta \
--ingressendpoint="${IPS[0]}" \
--ingressClass=gateway-api.ingress.networking.knative.dev \
--cluster-suffix="${CLUSTER_SUFFIX}"

echo ">> Scale down after HA tests"
kubectl -n "${CONTROL_NAMESPACE}" scale deployment net-gateway-api-controller --replicas=1
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This feel similar-but-not-identical to both kind_e2e_contour and e2e_istio. Might be worth a TODO to deduplicate more in a future PR.


success
Copy link
Contributor

Choose a reason for hiding this comment

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

We used to call success at the end of this script, and now we don't.

It looks like that function prints a success banner, but then also dumps some metrics from the kubernetes apiserver.

@knative-prow
Copy link

knative-prow bot commented Jul 9, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carlisia, evankanderson

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [carlisia,evankanderson]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@carlisia
Copy link
Member Author

I could compile your comments into a todo list and have a followup PR today. I'm concerned of holding up this PR even longer. Am open to adding anything that is a must include in this PR, just having a hard time distinguishing if anything is. At any rate, thank you so much for the throughout review.

@evankanderson
Copy link
Contributor

/lgtm

Notes from slack:

I think the comments on DEVELOPMENT.md, such as this one were the ones I was most concerned about fixing, since they might make it harder for someone else to join in.

I’m also wondering about putting 100-gateway-api.yaml into our release, but it looks like that may be long-standing, so I’d TODO it.

Can you also open an issue for [the addition of ReferencePolicies CRD](https://github.com/knative-sandbox/net-gateway-api/pull/315#discussion_r917226606) to the 100-gateway-api.yamlwhich is marked as temporary inupdate-codegen.sh`?

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jul 11, 2022
@knative-prow knative-prow bot merged commit c82e90c into knative-extensions:main Jul 11, 2022
@carlisia carlisia deleted the c-v0.5.0-rc1-deps branch July 11, 2022 21:56
evankanderson pushed a commit to evankanderson/net-ingressv2 that referenced this pull request Jul 11, 2022
knative-prow bot pushed a commit that referenced this pull request Jul 12, 2022
* Add support for TLS (conformance test passes)

* Fix codegen update and run

* Fix reconcile on no changes; add reconciliation tests

* Update with Dave's feedback.

* Fix lint warnings.

* Add Finalizer to cleanup Gateway Listeners

Added some (defaulted) fields to HTTPRoute to avoid controller looping.

* Fix lint complaint.

* Fix test breakage after merge post-#315

* Update referencepolicy->referencegrant in roles as well

* Switch back to ReferencePolicy from ReferenceGrant, because Istio doesn't support ReferenceGrant yet, and there's no converter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bump Gateway API version to v0.5.0-rc1 Improve installation documentation
5 participants