Adding Source Spec.#1856
Conversation
|
/cc @spencer-p |
|
@n3wscott: GitHub didn't allow me to request PR reviews from the following users: spencer-p. Note that only knative members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Harwayne
left a comment
There was a problem hiding this comment.
Wasn't there supposed to be something about the K_SINK env var?
| aggregationRule: | ||
| clusterRoleSelectors: | ||
| - matchLabels: | ||
| duck.knative.dev/source: "true" |
There was a problem hiding this comment.
Should this be duck.knative.dev/sourceObserver? In case we ever need a distinct ClusterRole in the future. Or just to differentiate from the label that is on sources themselves.
There was a problem hiding this comment.
This is how I have been thinking about it: the duck is a source; the role is source observer.
|
RE:
This is only for Knative Source pod-specable runtimes. This will be a followup. |
Co-Authored-By: Adam Harwayne <harwayne@google.com>
Co-Authored-By: Adam Harwayne <harwayne@google.com>
Co-Authored-By: Adam Harwayne <harwayne@google.com>
Co-Authored-By: Adam Harwayne <harwayne@google.com>
Co-Authored-By: Adam Harwayne <harwayne@google.com>
Justin2997
left a comment
There was a problem hiding this comment.
Good work :) I will try to move the RabbitMQ event source to this structure.
| duck.knative.dev/source: "true" # <-- required to be a source. | ||
| ``` | ||
|
|
||
| CRDs SHOULD be added to the `sources` category: |
There was a problem hiding this comment.
I suppose that the to yaml should make one file, this section is confusing to me.
There was a problem hiding this comment.
I actutally do appreciate the breakdown of the different sections. This is a spec - not a tutorial.
Co-Authored-By: Adam Harwayne <harwayne@google.com>
|
|
||
| A Source: | ||
|
|
||
| - Represent an off or on-cluster system, service or application. |
There was a problem hiding this comment.
I am not sure if the source itself does represent that system, service or app.
I usually tell people that with a source, you are able to connect to a 3rd party system, service or app - living on the cluster or somewhere outside.
There was a problem hiding this comment.
you are right, it should be Represents the request for events from...
| In practice, sources are an abstract concept that allow us to create declarative | ||
| configurations through the usage of Custom Resource Definitions (CRDs) extending | ||
| Kubernetes. Those CRDs are instantiated by creating an instance of the resource. | ||
| It is up to the implementation of the source author to understand the best way |
| - example.com | ||
| resources: | ||
| - foos | ||
| - foos/status |
There was a problem hiding this comment.
does an observer need to see the finalizers?
vaikas
left a comment
There was a problem hiding this comment.
Thanks for doing this! Some comments...
|
+1 on V1
On Thu 12. Sep 2019 at 00:32, Ville Aikas ***@***.***> wrote:
***@***.**** commented on this pull request.
Thanks for doing this! Some comments...
------------------------------
In docs/spec/sources.md
<#1856 (comment)>:
> +rules:
+ - apiGroups:
+ - example.com
+ resources:
+ - foos
+ - foos/status
+ verbs:
+ - get
+ - list
+ - watch
+```
+
+## Source Resource Shape
+
+The minimum definition of the Kubernetes resource shape is defined in the
+[Source](https://godoc.org/github.com/knative/pkg/apis/duck/v1beta1#Source)
Let's bump these to v1?
------------------------------
In docs/spec/sources.md
<#1856 (comment)>:
> +```go
+type SourceSpec struct {
+ // Sink is a reference to an object that will resolve to a domain name or a
+ // URI directly to use as the sink.
+ Sink apisv1alpha1.Destination `json:"sink,omitempty"`
+
+ // CloudEventOverrides defines overrides to control the output format and
+ // modifications of the event sent to the sink.
+ // +optional
+ CloudEventOverrides *CloudEventOverrides `json:"ceOverrides,omitempty"`
+}
+```
+
+For a full definition of `Sink` and `CloudEventsOverrides`, please see
+[Destination](https://godoc.org/knative.dev/pkg/apis/v1alpha1#Destination), and
+[CloudEventOverrides](https://godoc.org/github.com/knative/pkg/apis/duck/v1beta1#CloudEventOverrides).
and here to v1?
------------------------------
In docs/spec/sources.md
<#1856 (comment)>:
> + // inherits duck/v1beta1 Status, which currently provides:
+ // * ObservedGeneration - the 'Generation' of the Service that was last
+ // processed by the controller.
+ // * Conditions - the latest available observations of a resource's current
+ // state.
+ Status `json:",inline"`
+
+ // SinkURI is the current active sink URI that has been configured for the
+ // Source.
+ // +optional
+ SinkURI *apis.URL `json:"sinkUri,omitempty"`
+}
+```
+
+For a full definition of `Status` and `SinkURI`, please see
+[Status](https://godoc.org/github.com/knative/pkg/apis/duck/v1beta1#Status), and
aaaand here?
------------------------------
In docs/spec/sources.md
<#1856 (comment)>:
> +
+<!-- TODO(n3wscott,nacho): document the registry reqirements.
+
+### Event Type Registry
+
+To be included in the event type registry:
+
+```yaml
+todo
+```
+-->
+
+## Source RBAC
+
+Knative leverages an aggregated RBAC role to allow for controllers to check the
+status of source type resources.
Might be worth it to mention a use case or two as examples? Motivation
section if you will :)
------------------------------
In docs/spec/sources.md
<#1856 (comment)>:
> +
+- Represents an off or on-cluster system, service or application that produces
+ events to be consumed by a sink.
+- Produces or imports CloudEvents.
+- Sends CloudEvents to the configured **sink**.
+
+In practice, sources are an abstract concept that allow us to create declarative
+configurations through the usage of Custom Resource Definitions (CRDs) extending
+Kubernetes. Those CRDs are instantiated by creating an instance of the resource.
+It is up to the implementation of the source author to understand the best way
+to realize the source application. This could be as 1:1 deployments inside of
+Kubernetes per resource, as a single multi-tenant application, or even an
+off-cluster implementation; or all combinations in-between.
+
+There are some guidelines on implementing sources to allow cluster operators and
+tools to dynamically discover and understand source installations.
This section sets up the following ones quite nicely. I'd expand on this
just a little more only because source installation is only one part, the
other part is instantiating a source (CRD vs. CR) in which case you want to
convey additional information (in the Status of the resource as described
below). So, we might try to expand on this explanation a bit.
------------------------------
In docs/spec/sources.md
<#1856 (comment)>:
> +- Sends CloudEvents to the configured **sink**.
+
+In practice, sources are an abstract concept that allow us to create declarative
+configurations through the usage of Custom Resource Definitions (CRDs) extending
+Kubernetes. Those CRDs are instantiated by creating an instance of the resource.
+It is up to the implementation of the source author to understand the best way
+to realize the source application. This could be as 1:1 deployments inside of
+Kubernetes per resource, as a single multi-tenant application, or even an
+off-cluster implementation; or all combinations in-between.
+
+There are some guidelines on implementing sources to allow cluster operators and
+tools to dynamically discover and understand source installations.
+
+## Source CRDs
+
+CRDs that are to be understood as a `source` MUST be labeled:
Let's expand a bit on this. It would be maybe be useful to include the
motivation here, for example, so support the Source in the listing (for
example kubectl get ... command). So in addition to MUST be labeled, why
would be helpful. Understood is just a bit of a vague term here.
------------------------------
In docs/spec/sources.md
<#1856 (comment)>:
> +apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+ labels:
+ duck.knative.dev/source: "true" # <-- required to be a source.
+```
+
+CRDs SHOULD be added to the `sources` category:
+
+```yaml
+spec:
+ names:
+ categories:
+ - sources
+```
+
We should also talk about the validation aspects and encourage proper
Description for the fields and so forth also?
------------------------------
In docs/spec/sources.md
<#1856 (comment)>:
> +## Source CRDs
+
+CRDs that are to be understood as a `source` MUST be labeled:
+
+```yaml
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+ labels:
+ duck.knative.dev/source: "true" # <-- required to be a source.
+```
+
+CRDs SHOULD be added to the `sources` category:
+
+```yaml
+spec:
We should mention consistent use of the Conditions and in particular the
one Ready condition that we have defined in the apis.ConditionReady and
probably add that as a recommended additional Printer Column for
consistency?
------------------------------
In docs/spec/sources.md
<#1856 (comment)>:
> +For a full definition of `Sink` and `CloudEventsOverrides`, please see
+[Destination](https://godoc.org/knative.dev/pkg/apis/v1alpha1#Destination), and
+[CloudEventOverrides](https://godoc.org/github.com/knative/pkg/apis/duck/v1beta1#CloudEventOverrides).
+
+### duck.Status
+
+The `status` field is expected to have the following minimum shape:
+
+```go
+type SourceStatus struct {
+ // inherits duck/v1beta1 Status, which currently provides:
+ // * ObservedGeneration - the 'Generation' of the Service that was last
+ // processed by the controller.
+ // * Conditions - the latest available observations of a resource's current
+ // state.
+ Status `json:",inline"`
We should probably mention here about the apis.ConditionSet and each
Source IMHO should have the apis.ConditionReady as the one way to look at
the readiness of the Source.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1856?email_source=notifications&email_token=AABGPTTORLUJYJNCQBXLCVTQJFWX5A5CNFSM4IVKTF4KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCEOIQPY#pullrequestreview-287082559>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABGPTTC4QE3AUVNZUGFIOLQJFWX5ANCNFSM4IVKTF4A>
.
--
Sent from Gmail Mobile
|
|
perhaps this is relevant ? I noticed that the |
|
/approve |
|
While working on the Kn Eventing proposal, I remarked that this proposal supports a field Does this make sense to add it as an (optional ?) field into this source specification ? |
|
On Tue 1. Oct 2019 at 09:50, Roland Huß ***@***.***> wrote:
While working on the Kn Eventing proposal
<https://docs.google.com/document/d/1B8VK-5nuxt3D-i1Up3onmUbzcztQXE0GRgf1lfx49P8/edit#>,
I remarked that this proposal supports a field .spec.eventTypes
<https://docs.google.com/document/d/1B8VK-5nuxt3D-i1Up3onmUbzcztQXE0GRgf1lfx49P8/edit#bookmark=id.lwk2rcdndj4>
for all sources, which might be worth to consider to be included into this
spec. This should be an array of event types for which an instance of this
source CRD is configured to emit.
Does this make sense to add it as an (optional ?) field into this source
specification ?
<https://github.com/sixolet>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1856?email_source=notifications&email_token=AABGPTVLO7JQTSQXKIXC4WDQML6NJA5CNFSM4IVKTF4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAAKXMI#issuecomment-536914865>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABGPTWOYI6Z4CZQM2QUBFDQML6NJANCNFSM4IVKTF4A>
.
--
Sent from Gmail Mobile
|
evankanderson
left a comment
There was a problem hiding this comment.
A bunch of minor typographical suggestions; I don't think any make substantive design changes.
| - [Channel specification](channel.md) and | ||
| [older channel (0.6.0) spec](channel_060.md) | ||
|
|
||
| <!-- TODO(n3wscott): * [Error conditions and reporting](errors.md) --> |
There was a problem hiding this comment.
You might just reference https://knative.dev/docs/serving/spec/knative-api-specification-1.0/#error-signalling for the general error pattern, rather than needing to write your own.
|
@n3wscott could we try to get this merged this week? It's blocking a few things and would be nice to unblock asap. Looks like most changes in the latest review are fairly cosmetic, so I'm hoping it will go quickly. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: evankanderson, n3wscott, vaikas-google The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Patch the upstream config file to repair or reenable old behavior Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Adding check for (legacy) annotations Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Running 'make RELEASE=v1.6 generate-release' Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Related to #1554
Proposed Changes
Release Note