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

Add implementer's guide #2454

Merged
merged 6 commits into from Oct 10, 2023

Conversation

youngnick
Copy link
Contributor

/kind documentation

What this PR does / why we need it:

This adds an implementer's guide for Gateway API. The new guide is also now part of the specification, so MUST, SHOULD, and MAY there are treated the same as in the godoc or rendered Specification page.

Does this PR introduce a user-facing change?:

A guide for Gateway API implementers is now included in the specification.

Signed-off-by: Nick Young <nick@isovalent.com>
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/documentation Categorizes issue or PR as related to documentation. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 5, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 5, 2023
@youngnick youngnick changed the title Add impelementer's guide Add implementer's guide Oct 5, 2023
@@ -1,4 +1,4 @@
# Implementation guidelines
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I started this PR reviewing this page, but it turned out that these guidelines are actually for us, the project contributors and maintainers, not for implementers. So "Design guidelines" felt more appropriate.

Signed-off-by: Nick Young <nick@isovalent.com>
@Joffref
Copy link

Joffref commented Oct 5, 2023

Hey @youngnick, fantastic idea. One thing that might be interesting to see in this document is a recent Slack question about filters and policies. Seeing more context, including differences and the implementer PoV, would be nice.

Copy link
Contributor

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

Nice!


Because of our backwards compatibility guarantees, it's also safe for a controller
to flip the install channel between "standard" and "experimental", although
implementations MUST NOT do this without consulting the implementation owner.
Copy link
Contributor

Choose a reason for hiding this comment

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

Who is the "implementation owner"? In my reading, if I substitute phrases, this says "although
Istio MUST NOT do this without consulting the Istio maintainers" which seems odd? Or is it the user?

Anyhow, one risk with flipping the channel is another controller flipping it back endlessly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out, I was intending to say "implementations shouldn't do this without asking a human first" - I've updated, PTAL.


Implementations MAY require the installation to be done manually; if so, the
installation instructions SHOULD include commands to check if there are any other
CRDs installed already and verify that the installation will not be a downgrade.
Copy link
Contributor

Choose a reason for hiding this comment

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

As a followup maybe we should provide a common command to do this.

Istio, for instance, has an example of a suboptimal approach: https://istio.io/latest/docs/tasks/traffic-management/ingress/gateway-api/#setup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, this is a great followup. I'll create an issue a bit later for it.

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks for all the work on this @youngnick!

site-src/guides/implementers-guide.md Outdated Show resolved Hide resolved

[versioning]: /concepts/versioning

### Changes to the Gateway API CRDs are backwards compatible
Copy link
Member

Choose a reason for hiding this comment

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

One of my concerns here is that this could get out of sync with our versioning guide or vice versa, since a lot of this section is overlapping. Wherever possible, I'd like to have a single source of truth in our docs for a topic so we don't end up with accidentally conflicting docs in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand, but I think that having a summary of the key parts is really important for implementers. I'm not sure how to trim this to tell people about the backward compatibility guarantees in any shorter way.

site-src/guides/implementers-guide.md Outdated Show resolved Hide resolved
Comment on lines 139 to 140
- that the CRD definitions are only installed if they are a higher bundle version
than any existing Gateway API CRDs
Copy link
Member

Choose a reason for hiding this comment

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

Even this may not be safe in the case of experimental channel. I think if we say that this can be done, we also need to clearly state the risks of breaking other implementations.

Comment on lines 157 to 158
Because of our backwards compatibility guarantees, it's also safe for a controller
to flip the install channel between "standard" and "experimental", although
Copy link
Member

Choose a reason for hiding this comment

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

This is only safe in one direction: standard -> experimental. Once you've gone that direction, I think it's impossible to safely transition back to standard channel.

Comment on lines 220 to 221
In all of these cases, there are some relatively-common Condition types that have
similar meanings:
Copy link
Member

Choose a reason for hiding this comment

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

I'm worried that the definitions we have here will become out of sync with the definitions we have in the spec, do we need to define these in both places?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see these changing any time soon, so I'm not worried about this.

The following section goes through each Gateway API object, indicates expected
behaviors, and which conformance profiles that object is included in.

#### GatewayClass
Copy link
Member

Choose a reason for hiding this comment

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

How do we decide what belongs in here vs https://gateway-api.sigs.k8s.io/api-types/gatewayclass/ vs API Spec? I'm worried that we're going to end up with subtle differences in each individual source if we're not very careful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've tried to keep this very general, with only the main status being captured here. I don't see us changing the status handling or controllerName behavior - we can't once we go GA.

Maybe the guideline here is that we can only mention stable or core fields?

site-src/guides/implementers-guide.md Outdated Show resolved Hide resolved
site-src/guides/implementers-guide.md Outdated Show resolved Hide resolved
@@ -0,0 +1,367 @@
# Gateway API Implementer's Guide
Copy link
Member

Choose a reason for hiding this comment

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

Nit: This location doesn't feel quite right. So far all our guides are targeted at users of the API, and this one is decidedly different than those other ones. Maybe this belongs under the "Reference" tab instead?

@youngnick
Copy link
Contributor Author

Hey @youngnick, fantastic idea. One thing that might be interesting to see in this document is a recent Slack question about filters and policies. Seeing more context, including differences and the implementer PoV, would be nice.

That's a great idea, I'll make a note to come back and add that in a later PR.

Signed-off-by: Nick Young <nick@isovalent.com>
Signed-off-by: Nick Young <nick@isovalent.com>
@shaneutt shaneutt added this to the v1.0.0 milestone Oct 9, 2023
Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @youngnick!

/approve

site-src/references/implementers-guide.md Outdated Show resolved Hide resolved

#### HTTPRoute

HTTPRoutes route HTTP traffic that is _unencrypted_ and available for inspection.
Copy link
Member

@robscott robscott Oct 9, 2023

Choose a reason for hiding this comment

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

I think this may be a bit confusing when combined with BackendTLSPolicy. My understanding is that HTTPRoute can/should be combined with BackendTLSPolicy, but in that (and other) cases, traffic to the backend would be encrypted. I think it might be more accurate to say that this applies to HTTP(S) traffic that is terminated at the Gateway, but not TLS Passthrough traffic. I'm actually not sure how to word this, just need to be careful that we're not being unnecessarily restrictive here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated this wording, PTAL.

Signed-off-by: Nick Young <nick@isovalent.com>
Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

A couple very tiny non-blocking nits, but this LGTM.

site-src/references/implementers-guide.md Outdated Show resolved Hide resolved
Comment on lines +163 to +164
Because of all these caveats, we DO NOT recommend doing automatic CRD management
at this time.
Copy link
Member

Choose a reason for hiding this comment

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

This feels like something that should be closer to the top of the section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reworded this pretty substantially, PTAL.

Signed-off-by: Nick Young <nick@isovalent.com>
Copy link
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

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

Great to have something for this now, thanks @youngnick!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: howardjohn, robscott, shaneutt, youngnick

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 [robscott,shaneutt,youngnick]

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

@robscott
Copy link
Member

Thanks @youngnick!

/lgtm
/retest

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 10, 2023
@k8s-ci-robot k8s-ci-robot merged commit e3a60d3 into kubernetes-sigs:main Oct 10, 2023
8 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants