Skip to content

Commit 59fd9a0

Browse files
authored
Add skip permissions option to ApiServerSource (#6288)
* Add skip permissions option to ApiServerSource Signed-off-by: Hector Martinez <[email protected]> * Rename annotation Signed-off-by: Hector Martinez <[email protected]> * Move page to reference.md Signed-off-by: Hector Martinez <[email protected]> --------- Signed-off-by: Hector Martinez <[email protected]>
1 parent 4b84e8d commit 59fd9a0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/eventing/sources/apiserversource/reference.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ An ApiServerSource definition supports the following fields:
1515
| [`apiVersion`][kubernetes-overview] | Specifies the API version, for example `sources.knative.dev/v1`. | Required |
1616
| [`kind`][kubernetes-overview] | Identifies this resource object as an ApiServerSource object. | Required |
1717
| [`metadata`][kubernetes-overview] | Specifies metadata that uniquely identifies the ApiServerSource object. For example, a `name`. | Required |
18+
| [`metadata.annotations`][#features] | Specifies metadata that enables certain features. See the related section. | Optional |
1819
| [`spec`][kubernetes-overview] | Specifies the configuration information for this ApiServerSource object. | Required |
1920
| [`spec.resources`](#resources-parameter) | The resources that the source tracks so it can send related lifecycle events from the Kubernetes ApiServer. Includes an optional label selector to help filter. | Required |
2021
| `spec.mode` | EventMode controls the format of the event. Set to `Reference` to send a `dataref` event type for the resource being watched. Only a reference to the resource is included in the event payload. Set to `Resource` to have the full resource lifecycle event in the payload. Defaults to `Reference`. | Optional |
@@ -315,6 +316,35 @@ spec:
315316
{ "extensions": { "extra": "this is an extra attribute", "additional": "42" } }
316317
```
317318

319+
### Features
320+
321+
The ApiServerSource uses annotations to the enable certain features.
322+
323+
#### Skipping Permissions Check
324+
325+
This feature disables the RBAC permissions check done before creating
326+
the Deployment. By default three SubjectAccessReview requests are
327+
created per combination of resource and namespace tracked.
328+
329+
When enabled, this feature removes the creation of SubjectAccessReview,
330+
reducing the pressure to the Kubernetes API when a large number of
331+
resources or namespaces are tracked by the ApiServerSource. In this
332+
case the ApiServerSource Deployment does not retry watch connections.
333+
334+
To enable it, set it to `"true"`:
335+
336+
```yaml
337+
apiVersion: sources.knative.dev/v1
338+
kind: ApiServerSource
339+
metadata:
340+
name: <apiserversource>
341+
namespace: <namespace>
342+
annotations:
343+
features.knative.dev/apiserversource-skip-permissions-check: "true"
344+
spec:
345+
...
346+
```
347+
318348
[kubernetes-overview]:
319349
https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields
320350
[kubernetes-kinds]:

0 commit comments

Comments
 (0)