这是indexloc提供的服务,不要输入任何密码
Skip to content

Add reconciler logic for DomainMapping AutoTLS #10467

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

Merged
merged 11 commits into from
Jan 5, 2021

Conversation

tcnghia
Copy link
Contributor

@tcnghia tcnghia commented Jan 3, 2021

Part of #10247

Proposed Changes

  • Inject in a CertificateInformer
  • Add reconcile logic to handle ACME challenge and Secret propagation into Ingress

Release Note

Add AutoTLS support for DomainMapping

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 3, 2021
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Jan 3, 2021
@knative-prow-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 3, 2021
@knative-prow-robot knative-prow-robot added area/API API objects and controllers approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 3, 2021
@tcnghia tcnghia force-pushed the dm-tls-controller branch from 1cc4246 to 5059cc8 Compare January 3, 2021 03:11
@codecov
Copy link

codecov bot commented Jan 3, 2021

Codecov Report

Merging #10467 (1aa845b) into master (915172b) will increase coverage by 0.05%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10467      +/-   ##
==========================================
+ Coverage   88.02%   88.07%   +0.05%     
==========================================
  Files         187      187              
  Lines        8808     8849      +41     
==========================================
+ Hits         7753     7794      +41     
- Misses        814      816       +2     
+ Partials      241      239       -2     
Impacted Files Coverage Δ
pkg/reconciler/domainmapping/controller.go 0.00% <0.00%> (ø)
pkg/reconciler/domainmapping/reconciler.go 92.92% <100.00%> (+3.58%) ⬆️
pkg/autoscaler/statforwarder/leases.go 76.97% <0.00%> (-1.44%) ⬇️
pkg/reconciler/configuration/configuration.go 88.28% <0.00%> (+3.90%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 915172b...1aa845b. Read the comment docs.

@tcnghia tcnghia force-pushed the dm-tls-controller branch 2 times, most recently from 2af2bd4 to 1508951 Compare January 3, 2021 03:32
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 3, 2021
@tcnghia tcnghia force-pushed the dm-tls-controller branch from 1508951 to 114be33 Compare January 3, 2021 03:34
@tcnghia tcnghia force-pushed the dm-tls-controller branch from 114be33 to c674cdf Compare January 3, 2021 04:38
@tcnghia tcnghia marked this pull request as ready for review January 3, 2021 07:44
@knative-prow-robot knative-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 Jan 3, 2021
@tcnghia
Copy link
Contributor Author

tcnghia commented Jan 3, 2021

/test pull-knative-serving-istio-stable-no-mesh-tls

1 similar comment
@tcnghia
Copy link
Contributor Author

tcnghia commented Jan 3, 2021

/test pull-knative-serving-istio-stable-no-mesh-tls

Comment on lines 143 to 149
annotationValue := dm.Annotations[networking.DisableAutoTLSAnnotationKey]
disabledByAnnotation, err := strconv.ParseBool(annotationValue)
if annotationValue != "" && err != nil {
// validation should've caught an invalid value here.
// if we have one anyways, assume not disabled and log a warning.
logger.Warnf("Invalid annotation value for %q. Value: %q",
networking.DisableAutoTLSAnnotationKey, annotationValue)
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks like a method on DM itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll follow up.

// Check that our Reconciler implements CertificateAccessor
var _ networkaccessor.CertificateAccessor = (*Reconciler)(nil)

// GetNetworkingClient implements networking.CertificateAccessor
Copy link
Contributor

Choose a reason for hiding this comment

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

this is unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see a call to GetNetworkingClient there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, it's passed down... not sure we should do pass reconciler down. Rather we should pass down the networking client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can follow up with a change to fix route and domainmapping reconciler both.

return r.netclient
}

// GetCertificateLister implements networking.CertificateAccessor
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tcnghia
Copy link
Contributor Author

tcnghia commented Jan 3, 2021

/assign @vagababov @YoussB

@tcnghia
Copy link
Contributor Author

tcnghia commented Jan 3, 2021

/assign @julz

@tcnghia
Copy link
Contributor Author

tcnghia commented Jan 5, 2021

/test pull-knative-serving-istio-stable-no-mesh

@tcnghia
Copy link
Contributor Author

tcnghia commented Jan 5, 2021

/hold

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 5, 2021
@tcnghia
Copy link
Contributor Author

tcnghia commented Jan 5, 2021

/unhold
(tested using latest version of net-http01)

@julz @vagababov I've addressed most of your feedbacks, except for a few that I will follow up.

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 5, 2021
Copy link
Member

@julz julz left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold so @vagababov can have a look and in case you want to do the little suggested refactor (but Im fine if you prefer this way or want to do it separately).

@knative-prow-robot knative-prow-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Jan 5, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: julz, tcnghia

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

@tcnghia tcnghia force-pushed the dm-tls-controller branch from 265eab7 to 6220801 Compare January 5, 2021 16:56
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 5, 2021
Co-authored-by: Victor Agababov <vagababov@gmail.com>
@vagababov
Copy link
Contributor

/lgtm
/unhold

@knative-prow-robot knative-prow-robot added lgtm Indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jan 5, 2021
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 5, 2021
"knative.dev/serving/pkg/apis/serving/v1alpha1"
domainmappingreconciler "knative.dev/serving/pkg/client/injection/reconciler/serving/v1alpha1/domainmapping"
"knative.dev/serving/pkg/reconciler/domainmapping/config"
"knative.dev/serving/pkg/reconciler/domainmapping/resources"
routeresources "knative.dev/serving/pkg/reconciler/route/resources"
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this somewhere common?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll follow up with that as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got an issue with a DomainMapping:

party       knative.party                                Unknown   NewObservedGenFailure

Looking at the logs of the kcert:

  Warning  InternalError  3m23s (x17 over 8m51s)  certificate-controller  Service "knative.party" is invalid: metadata.name: Invalid value: "knative.party": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')```

Copy link
Member

Choose a reason for hiding this comment

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

I believe you need to update net-http01, let's discuss in slack

Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 5, 2021
@knative-prow-robot knative-prow-robot merged commit 160a16a into knative:master Jan 5, 2021
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. area/API API objects and controllers cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants