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

Defaultcontroller #843

Merged
merged 8 commits into from
Mar 7, 2019
Merged

Conversation

akashrv
Copy link
Contributor

@akashrv akashrv commented Mar 2, 2019

Fixes #779

Proposed Changes

  • Created a default channel controller. This controller will watch every Channel and set its ProvisionerInstalled condition to false if there is no provisioner that watches the channel
  • This condition will be set to true by individual controllers when they start watching the Channel
  • There were concerns about multiple controllers trying to update the status of the same object. However this is not a concern with the current implementation and it seems there are multiple cases in kubernetes where this is done.
    The API server Update API support optimistic concurrency based on resource version. When using controller client to update, if the object on server side changes after reading the object and before updating it in the controller, then the update api will fail with CONFLICT error. This is handled by re-queueing the request for reconcile.
    I have verified this behavior with current code on a GKE cluster.

Release Note

A new channel-default-controller will monitor every channel. It will check if ClusterChannelProvisioner is installed and that the channel-provisioner-specific controller monitors the channel.
If provisioner is not installed or corrupt and no controller monitors this channel,  then the ProvisionerInstalled condition in status will be set to False and the channel will be marked as not ready.
If the provisoner is installed and monitoring the channel then the ProvisionerInstalled condition in status will be set to True

and update its status in case the channel is not being watched by any controller
This could happen if the end user creates a channel but doesn't install the
provisioner.
Issue#779: knative#779
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 2, 2019
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 2, 2019
@akashrv
Copy link
Contributor Author

akashrv commented Mar 2, 2019

/assign @n3wscott

@akashrv
Copy link
Contributor Author

akashrv commented Mar 2, 2019

/assign @grantr

pkg/reconciler/v1alpha1/channel/channel.go Outdated Show resolved Hide resolved
pkg/reconciler/v1alpha1/channel/channel.go Outdated Show resolved Hide resolved
pkg/reconciler/v1alpha1/channel/channel.go Outdated Show resolved Hide resolved
pkg/reconciler/v1alpha1/channel/channel.go Outdated Show resolved Hide resolved
pkg/reconciler/v1alpha1/channel/channel.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1alpha1/channel_types.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1alpha1/channel_types.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1alpha1/channel_types.go Show resolved Hide resolved
pkg/apis/eventing/v1alpha1/channel_types.go Outdated Show resolved Hide resolved
@vaikas
Copy link
Contributor

vaikas commented Mar 4, 2019

I'd actually update the Release Notes seciton, since it has user visible changes. Also, we should make sure to update documentation with this information and probably update the debugging also. Not as part of this PR, but we should probably create an issue to track or put out a PR to update those.

Copy link
Contributor

@n3wscott n3wscott left a comment

Choose a reason for hiding this comment

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

I think there is a clarification that is required around our expectations of the Ready condition and the default provisioner controller. I would not expect it to set Ready at all.

pkg/apis/eventing/v1alpha1/channel_types.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1alpha1/channel_types_test.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1alpha1/channel_types.go Show resolved Hide resolved
pkg/reconciler/v1alpha1/channel/channel.go Outdated Show resolved Hide resolved
pkg/reconciler/v1alpha1/channel/channel.go Outdated Show resolved Hide resolved
pkg/apis/eventing/v1alpha1/channel_types.go Show resolved Hide resolved
pkg/reconciler/v1alpha1/channel/channel.go Outdated Show resolved Hide resolved
@n3wscott
Copy link
Contributor

n3wscott commented Mar 5, 2019

There is also a question of if this controller should update this status on the normal re-reconcile period if it finds there to be no provisioner. It would sure be interesting to get that set on the channel that worked and then the provisioner went away and now my stuff is broken?

@akashrv
Copy link
Contributor Author

akashrv commented Mar 5, 2019

I think there is a clarification that is required around our expectations of the Ready condition and the default provisioner controller. I would not expect it to set Ready at all.

I don't agree with not setting the Ready condition.
Ready/Happy condition is the final condition that tells the user whether the object is ready from control plane perspective. The channel may or may not be ready from a data plane perspective or due to some other resources. The dependent conditions tell the specific reason(s). Also as a user when I query the channel object using kubectl without -o, then it returns the Name, Ready, and Reason. In the case (which is the most likely case) that a Channel is installed but the provisioner was never installed and if I run kubectl get channels/chan then it will return Name:Chan, READY:False, REASON: Provisioner not found.
However Ready will not be set to True till all the dependent conditions are set to True.

I think this is the correct user experience that is expected. Thoughts?

Copy link
Contributor

@n3wscott n3wscott left a comment

Choose a reason for hiding this comment

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

I can live with this version 😄 I think there could be a todo added or issue created to follow-up on if we should fetch the provisioner and see if it is having a bad day or not and then propagate it's status up.

/lgtm

pkg/apis/eventing/v1alpha1/channel_types.go Outdated Show resolved Hide resolved
pkg/reconciler/v1alpha1/channel/channel_test.go Outdated Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 6, 2019
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Mar 6, 2019
@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/eventing/v1alpha1/channel_types.go 100.0% 91.7% -8.3
pkg/reconciler/v1alpha1/channel/channel.go Do not exist 65.6%

@n3wscott
Copy link
Contributor

n3wscott commented Mar 7, 2019

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 7, 2019
@vaikas
Copy link
Contributor

vaikas commented Mar 7, 2019

/lgtm
/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akashrv, n3wscott, vaikas-google

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:

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 7, 2019
@knative-prow-robot knative-prow-robot merged commit 24bcdf8 into knative:master Mar 7, 2019
matzew added a commit to matzew/eventing that referenced this pull request Sep 25, 2020
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants