Skip to content

Commit 6e8a2bf

Browse files
committed
Moving open questions to unresolved blocks and adding links to prev
discussion
1 parent 767c0f7 commit 6e8a2bf

File tree

1 file changed

+103
-68
lines changed

1 file changed

+103
-68
lines changed

keps/sig-auth/3766-referencegrant/README.md

Lines changed: 103 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@
3434
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
3535
- [Version Skew Strategy](#version-skew-strategy)
3636
- [Open Questions](#open-questions)
37-
- [Do We Need Status?](#do-we-need-status)
3837
- [Do We Need Verbs?](#do-we-need-verbs)
3938
- [Do We Need Any or Wildcard Selectors?](#do-we-need-any-or-wildcard-selectors)
4039
- [Do We Need Label Selectors?](#do-we-need-label-selectors)
41-
- [Are "To" and "From" the right field names?](#are-to-and-from-the-right-field-names)
4240
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
4341
- [Feature Enablement and Rollback](#feature-enablement-and-rollback)
4442
- [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning)
@@ -166,6 +164,20 @@ Anyone creating or updating a ReferenceGrant MUST have read access to the resour
166164
they are providing access to. If that authorization check fails, the update or
167165
create action will also fail.
168166

167+
<<[UNRESOLVED Do we need checks beyond read access? ]>>
168+
Previous Discussion: https://github.com/kubernetes/enhancements/pull/3767#discussion_r1084528657
169+
170+
Comment that started that thread:
171+
172+
does anything ensure the user creating the ReferenceGrant has permissions (read?
173+
write?) on the object they are granting access to? Translating the existing
174+
ReferenceGrant into an authz check means translating from Kind to Resource
175+
176+
since this is extending "half of a handshake", it seems important to ensure the
177+
actor extending the handshake actually has permission to do so
178+
179+
<<[/UNRESOLVED]>>
180+
169181
#### `Resource` vs `Kind`
170182

171183
When creating a metaresource (that is, a resource that targets other resources)
@@ -219,12 +231,13 @@ spec:
219231
resource: gateways
220232
namespace: foo
221233
to:
222-
- resource: secrets
234+
- group: ""
235+
resource: secrets
223236

224237
```
225238

226-
The new version communicates the scope more clearly because `resource` is
227-
unambiguous and corresponds to exactly one URL path on the API Server.
239+
The new version communicates the scope more clearly because `group`+`resource`
240+
is unambiguous and corresponds to exactly one set of objects on the API Server.
228241

229242
This change also leaves room for an enhancement. Whether we have an in-tree or
230243
CRD implementation, we can rely on the exact matching that the plural resource
@@ -291,7 +304,8 @@ spec:
291304
resource: gateways
292305
namespace: gateway-api-example-ns1
293306
to:
294-
- resource: secrets
307+
- group: ""
308+
resource: secrets
295309
```
296310
297311
For Gateway TLS references, if this ReferenceGrant is deleted (revoking,
@@ -337,7 +351,8 @@ spec:
337351
resource: httproutes
338352
namespace: baz
339353
to:
340-
- resource: services
354+
- group: ""
355+
resource: services
341356
```
342357

343358
For HTTPRoute objects referencing a backend in another namespace, if the
@@ -472,6 +487,31 @@ type ReferenceGrantSpec struct {
472487
To []ReferenceGrantTo `json:"to"`
473488
}
474489

490+
```
491+
<<[UNRESOLVED Are "To" and "From" the right field names? ]>>
492+
Previous Discussion: https://github.com/kubernetes/enhancements/pull/3767#discussion_r1084671720
493+
494+
Comments from @thockin:
495+
496+
I would not argue for subject/object - that's confusing, and I love to take
497+
analogies too far.
498+
499+
NetPol uses To/From but only for actual communications, and that still has been
500+
critiqued as perhaps "too cute".
501+
502+
Subject/From isn't too bad, but not as symmetric. Subject/Referrer is correct
503+
but decidedly uncute. Subject/Origin?
504+
505+
I hold opinions from an API review POV, but I'd like sig-auth to own the
506+
decision :)
507+
508+
For reference, there was an [earlier
509+
discussion](https://groups.google.com/g/kubernetes-api-reviewers/c/ldmrXXQC4G4)
510+
on the kubernetes-api-reviewers mailing list that's also relevant to this.
511+
<<[/UNRESOLVED]>>
512+
513+
```go
514+
475515
// ReferenceGrantFrom describes trusted namespaces and kinds.
476516
type ReferenceGrantFrom struct {
477517
// Group is the group of the referent.
@@ -520,6 +560,50 @@ moving ReferenceGrant to the new API group, just notes to save discussion time.
520560
multiple controllers consume the same ReferenceGrant?
521561
* Status design is still pending, but it's currently expected that controllers
522562
will indicate status on the _referring_ resources, not on ReferenceGrant itself.
563+
<<[UNRESOLVED do we need status? ]>>
564+
Original Thread: https://github.com/kubernetes/enhancements/pull/3767#discussion_r1084670421
565+
566+
We want to be able to represent the following, in descending order of
567+
importance:
568+
569+
1. Communicate that the ReferenceGrant is actively being used
570+
2. Communicate which controllers are using this ReferenceGrant
571+
3. Communicate how many times it's been used with sufficient granularity that I
572+
can see the effects of my changes (if I remove this reference, am I removing
573+
a dependency on this ReferenceGrant?)
574+
575+
We could introduce a status structure that allowed each implementing controller
576+
to write 1 entry:
577+
578+
```yaml
579+
status:
580+
referencesAllowed:
581+
- controllerName: gateway.example.com
582+
numReferences: 1
583+
```
584+
585+
@thockin responded with:
586+
587+
If we think that the cardinality of controllers is low, we can put it in status.
588+
The downsides are:
589+
590+
1. Could frequently require retries because of optimistic concurrency failures
591+
(I'm trying to increment my count, but so is everyone else)
592+
1. If we're wrong about cardinality, there's not an easy way out
593+
1. Lots of writes to a resource that will be watched fairly often (every
594+
controller which needs refs will watch all refgrants)
595+
1. We need .status.
596+
1. If we instead put that into a ReferenceGrantUse resource (just a tuple of
597+
controller-name and count), then we only have optimistic concurrency
598+
problems with ourselves, we have ~infinite cardinality, nobody will be
599+
watching them, and RefGrant doesn't need .status.
600+
601+
Downsides:
602+
603+
1. It's another new resource
604+
1. It's a new pattern, untested in other places.
605+
606+
<<[/UNRESOLVED]>>
523607
* Clarify that the expected operating model for implementations expects them to
524608
have broad, read access to both ReferenceGrant and the specific `To` Kinds they
525609
support, and then self-limit to only _use_ the relevant ones.
@@ -610,55 +694,16 @@ the old Gateway API resources as part of a seamless migration. We expect that
610694
many implementations will provide this recommendation to users, and we may even
611695
provide tooling to simplify this process.
612696

697+
<<[UNRESOLVED open questions that don't clearly fit elsewhere ]>>
613698
## Open Questions
614699

615700
This KEP was merged in a provisional state with a number of open questions
616701
remaining. This section highlights the questions we have not resolved yet.
617702

618-
### Do We Need Status?
619-
620-
We want to be able to represent the following, in descending order of
621-
importance:
622-
623-
1. Communicate that the ReferenceGrant is actively being used
624-
2. Communicate which controllers are using this ReferenceGrant
625-
3. Communicate how many times it's been used with sufficient granularity that I
626-
can see the effects of my changes (if I remove this reference, am I removing
627-
a dependency on this ReferenceGrant?)
628-
629-
We could introduce a status structure that allowed each implementing controller
630-
to write 1 entry:
631-
632-
```yaml
633-
status:
634-
referencesAllowed:
635-
- controllerName: gateway.example.com
636-
numReferences: 1
637-
```
638-
639-
@thockin responded with:
640-
641-
If we think that the cardinality of controllers is low, we can put it in status.
642-
The downsides are:
643-
644-
1. Could frequently require retries because of optimistic concurrency failures
645-
(I'm trying to increment my count, but so is everyone else)
646-
1. If we're wrong about cardinality, there's not an easy way out
647-
1. Lots of writes to a resource that will be watched fairly often (every
648-
controller which needs refs will watch all refgrants)
649-
1. We need .status.
650-
1. If we instead put that into a ReferenceGrantUse resource (just a tuple of
651-
controller-name and count), then we only have optimistic concurrency
652-
problems with ourselves, we have ~infinite cardinality, nobody will be
653-
watching them, and RefGrant doesn't need .status.
654-
655-
Downsides:
656-
657-
1. It's another new resource
658-
1. It's a new pattern, untested in other places.
659-
660703
### Do We Need Verbs?
661704

705+
Previous Discussion: https://github.com/kubernetes/enhancements/pull/3767#discussion_r1084509958
706+
662707
We could add a `verbs` field to enable users to specify the kind of referential
663708
access they want to grant. For example, we could define "read", "route", and
664709
"backup" as well-known verbs to start. We could also allow implementations to
@@ -669,6 +714,10 @@ elsewhere in the resource, see the next item for more.
669714

670715
### Do We Need Any or Wildcard Selectors?
671716

717+
Previous Discussions:
718+
* https://github.com/kubernetes/enhancements/pull/3767#discussion_r1086020464
719+
* https://github.com/kubernetes/enhancements/pull/3767#discussion_r1086012665
720+
672721
We already allow "Name" to be optional in `To`, effectively resulting in
673722
wildcard behavior. Should we expand that to allow any of the following?
674723

@@ -683,6 +732,10 @@ a moot point.
683732

684733
### Do We Need Label Selectors?
685734

735+
Previous Discussions:
736+
* https://github.com/kubernetes/enhancements/pull/3767#discussion_r1084492070
737+
* https://github.com/kubernetes/enhancements/pull/3767#discussion_r1084674648
738+
686739
As a natural next step, instead of simply allowing all, we could use
687740
label selectors to enable:
688741

@@ -730,25 +783,7 @@ type NamespaceResource struct {
730783
Resource string
731784
}
732785
```
733-
734-
### Are "To" and "From" the right field names?
735-
Comments from @thockin:
736-
737-
I would not argue for subject/object - that's confusing, and I love to take
738-
analogies too far.
739-
740-
NetPol uses To/From but only for actual communications, and that still has been
741-
critiqued as perhaps "too cute".
742-
743-
Subject/From isn't too bad, but not as symmetric. Subject/Referrer is correct
744-
but decidedly uncute. Subject/Origin?
745-
746-
I hold opinions from an API review POV, but I'd like sig-auth to own the
747-
decision :)
748-
749-
For reference, there was an [earlier
750-
discussion](https://groups.google.com/g/kubernetes-api-reviewers/c/ldmrXXQC4G4)
751-
on the kubernetes-api-reviewers mailing list that's also relevant to this.
786+
<<[/UNRESOLVED]>>
752787

753788

754789
## Production Readiness Review Questionnaire

0 commit comments

Comments
 (0)