Skip to content

Refactor the Configuration controller to use level-based reconciliation.#1202

Merged
google-prow-robot merged 1 commit intoknative:masterfrom
mattmoor:get-thru-informer
Jun 14, 2018
Merged

Refactor the Configuration controller to use level-based reconciliation.#1202
google-prow-robot merged 1 commit intoknative:masterfrom
mattmoor:get-thru-informer

Conversation

@mattmoor
Copy link
Copy Markdown
Member

Based on the guidance from today's working group meeting, this starts to move our controllers towards more conventional reconciliation. Previously, we did work in the callbacks from informers directly. With this, we still listen to these secondary events, but when they occur instead of taking immediate action, we instead queue a reconciliation of any primary resources with which they are associated.

In simpler terms, instead of having the Configuration controller take direct action when Revision events occur we instead queue a reconciliation of the Controller that created it. This core reconciliation loop is now responsible for 100% of the logic so there are changes there as well to accommodate this shift.

Progress towards: #823

@google-prow-robot google-prow-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 14, 2018
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/. Say /test pull-knative-serving-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/apis/serving/v1alpha1/configuration_types.go 97.7% 97.7% 0.1
pkg/apis/serving/v1alpha1/configuration_types_test.go 97.7% 97.7% 0.1
pkg/controller/configuration/configuration.go 77.7% 75.8% -1.9
pkg/controller/configuration/configuration_test.go 77.7% 75.8% -1.9
pkg/controller/route/route.go 78.0% 77.9% -0.1
pkg/controller/revision/revision.go 80.4% 80.6% 0.1
pkg/controller/revision/revision_test.go 80.4% 80.6% 0.1

*TestCoverage feature is being tested, do not rely on any info here yet

@mattmoor
Copy link
Copy Markdown
Member Author

This is WIP because the baseline change (#1198) needs to land first.

Comment thread pkg/controller/controller.go Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@smarterclayton I hand rolled this based on spelunking and guesswork. If there are useful utilities for this I'd appreciate any pointers.

@mattmoor mattmoor force-pushed the get-thru-informer branch from 7822953 to caac408 Compare June 14, 2018 04:37
@google-prow-robot google-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 14, 2018
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/. Say /test pull-knative-serving-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/apis/serving/v1alpha1/configuration_types.go 97.7% 97.7% 0.1
pkg/apis/serving/v1alpha1/configuration_types_test.go 97.7% 97.7% 0.1
pkg/controller/configuration/configuration.go 78.3% 75.8% -2.5
pkg/controller/configuration/configuration_test.go 78.3% 75.8% -2.5

*TestCoverage feature is being tested, do not rely on any info here yet

@mattmoor mattmoor force-pushed the get-thru-informer branch from caac408 to 5f0293e Compare June 14, 2018 04:41
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/. Say /test pull-knative-serving-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/apis/serving/v1alpha1/configuration_types.go 97.7% 97.7% 0.1
pkg/apis/serving/v1alpha1/configuration_types_test.go 97.7% 97.7% 0.1
pkg/controller/configuration/configuration.go 78.3% 75.8% -2.5
pkg/controller/configuration/configuration_test.go 78.3% 75.8% -2.5

*TestCoverage feature is being tested, do not rely on any info here yet

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we construct this from one of the api directories instead of hard coding?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: The no longer
Configuration no longer...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/looking up Revision/failed to Get Revision/
? Not a big deal but seems more readable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

Comment thread pkg/controller/controller.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's what I copied this from. Since I want the Obj that is embedded as well (to determine its controller below) I inlines and adapted that same delete-handling logic.

I definitely want something better to use here. I think that my bias would be to actually rip out a lot of the complexity of this function (which we don't need yet) unless there is something better to use.

Based on the guidance from Clayton and others at today's working group meeting, this starts to move our controllers towards more conventional reconciliation.  Previously, we did work in the callbacks from informers directly.  With this, we still listen to these secondary events, but when they occur instead of taking immediate action, we instead queue a reconciliation of any primary resources with which they are associated.

In simpler terms, instead of having the Configuration controller take direct action when Revision events occur we instead queue a reconciliation of the Controller that created it.  This core reconciliation loop is now responsible for 100% of the logic so there are changes there as well to accommodate this shift.
@mattmoor mattmoor force-pushed the get-thru-informer branch from 5f0293e to 8b3a616 Compare June 14, 2018 12:01
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/. Say /test pull-knative-serving-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/apis/serving/v1alpha1/configuration_types.go 97.7% 97.7% 0.1
pkg/apis/serving/v1alpha1/configuration_types_test.go 97.7% 97.7% 0.1
pkg/controller/configuration/configuration.go 78.3% 78.9% 0.7
pkg/controller/configuration/configuration_test.go 78.3% 78.9% 0.7

*TestCoverage feature is being tested, do not rely on any info here yet

@mattmoor mattmoor changed the title [WIP] Refactor the Configuration controller to use level-based reconciliation. Refactor the Configuration controller to use level-based reconciliation. Jun 14, 2018
@google-prow-robot google-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 14, 2018
@mattmoor
Copy link
Copy Markdown
Member Author

/assign @vaikas-google
/assign @grantr

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Jun 14, 2018

/lgtm
/approve

@google-prow-robot google-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 14, 2018
@google-prow-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

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

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/. Say /test pull-knative-serving-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/apis/serving/v1alpha1/configuration_types.go 97.7% 97.7% 0.1
pkg/apis/serving/v1alpha1/configuration_types_test.go 97.7% 97.7% 0.1
pkg/controller/configuration/configuration.go 78.3% 74.7% -3.5
pkg/controller/configuration/configuration_test.go 78.3% 74.7% -3.5

*TestCoverage feature is being tested, do not rely on any info here yet

@google-prow-robot google-prow-robot merged commit 56c7671 into knative:master Jun 14, 2018
@mattmoor mattmoor deleted the get-thru-informer branch June 14, 2018 15:49
google-prow-robot pushed a commit that referenced this pull request Jun 14, 2018
This moves the service controller to the more level-based model started in #1202.  This also makes the service controller start to listen to Route and Configuration events to trigger reconciliation, so that we can reflect a basic overall readiness condition based on the combination of these two sub-resources readiness conditions (I don't expect this will be the final model, but is a start).

Fixes: #1134
Copy link
Copy Markdown
Contributor

@grantr grantr left a comment

Choose a reason for hiding this comment

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

LGTM. Nice improvement, thanks!

nak3 added a commit to nak3/serving that referenced this pull request Aug 5, 2022
…ase/artifacts` (knative#1202)

* Add secret to 1.4 CI yaml

* auto generated
mgencur pushed a commit to mgencur/serving-1 that referenced this pull request Sep 6, 2022
…ase/artifacts` (knative#1202)

* Add secret to 1.5 CI yaml

* auto generated
skonto pushed a commit to skonto/serving that referenced this pull request Sep 21, 2022
…ically (knative#1236)

* [RELEASE-v1.5] Add manifest patch for internal-tls to `openshift/release/artifacts` (knative#1202)

* Add secret to 1.5 CI yaml

* auto generated

* Support config to deploy internal certificates automatically (knative#13005)

* Add certificate reconciler for internal certs

* Fix cert path

* Temporary use local networking repo

* Support internal-encryption configuration

* Use const for cert name

* Fix lint

* rm blank line

* Drop unused variable

* Use one line style

* Use one line code

* Update net-kourier nightly

bumping knative.dev/net-kourier d758682...b9b1e8b:
  > b9b1e8b Use `internal-encryption` to deploy internal certificates automatically (# 855)
  > 427434c bump kind and k8s versions in kind-e2e tests (# 859)

Signed-off-by: Knative Automation <automation@knative.team>

* Verify SecretPKKey as well

* Do not drop activator always in the path

* Comment about ctrl-ca suffix

Co-authored-by: Knative Automation <automation@knative.team>

* Update deps

* Enable internal-tls on ocp-tls (knative#1203)

* Enable internal-tls on OCP 4.8

* Use tls to match JOB name

* Add a target to enable internal-tls in Makefile (knative#1224)

* Add a target to enable internal-tls in Makefile

* Update CI template for internal-tls enabled

* Tests for encryption with Kourier local gateway (knative#13263)

* Generate Secrets

* Commit generated cert-secret.yaml

* httpproxy enables tls client

* httpproxy uses https when CA_CERT specified

* Pass CA_CERT and SERVER_NAME env variables properly to tests

* Avoid using cluster-local certificates for external services

* Enable tls tests for cluster-local Kourier gateway

* Need to create test resources including the test namespace first
before installing Knative so that applying
test/config/tls/cert-secret.yaml succeeds

* TMP: Enable tls in the standard e2e make target - test purposes

* Use knative-serving-ingress ns for deploying server-certs

* Deploy certificates at test phase

* Separate test and install of installing certs

* Wait for knative-serving-ingress to exist

* Revert "TMP: Enable tls in the standard e2e make target - test purposes"

This reverts commit 5bb3549.

Co-authored-by: Kenjiro Nakayama <nakayamakenjiro@gmail.com>
Co-authored-by: Knative Automation <automation@knative.team>
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. 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.

5 participants