-
Notifications
You must be signed in to change notification settings - Fork 269
Adds proxy https readinessEndpoints support #289
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
Adds proxy https readinessEndpoints support #289
Conversation
|
last 2 commits (the ones that add the probes) lgtm |
4ffd8e8 to
c0dff8d
Compare
c0dff8d to
00e45e8
Compare
00e45e8 to
9a01682
Compare
3007873 to
6b52e70
Compare
knobunc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
6b52e70 to
caa304d
Compare
| func (r *ReconcileProxyConfig) validateTrustedCA(trustedCA string) ([]*x509.Certificate, []byte, []byte, error) { | ||
| if len(trustedCA) == 0 { | ||
| trustedCA = names.TRUSTED_CA_BUNDLE_CONFIGMAP | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this logic (and the comment above) are still incorrect, per my earlier comment.
If "trustedCA" is empty that means "proxyconfig.trustedca.name" is empty (in other words, the admin has not pointed us to a configmap of user provided CAs).
If that is the case:
- there's no point in validating anything
- we should be returning the system trust bundle (ie the trust bundle included in our image). Not the openshift-config-managed CM bundle.
There is never a reason to validate the openshift-config-managed CM bundle, as this is controller is itself responsible for producing that CM, so it better be valid for us to have produced it. Furthermore the purpose of the validation we are doing here is to ensure that the CA bundle can be used to talk to the proxy. That needs to happen before we copy any bundles into openshift-config-managed, because once it's in openshift-config-managed, it's going to get injected into the various consumer CMs. So validating openshift-config-managed isn't useful (it's too late).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If "trustedCA" is empty that means "proxyconfig.trustedca.name" is empty (in other words, the admin has not pointed us to a configmap of user provided CAs).
@bparees understood. I'm calling validateTrustedCA() instead of making multiple func calls to get the trusted-ca-bundle configmap, parse the data key into a []byte and then parse the []byte into a []*x509.Certificate that is used as a parameter for the validateReadinessEndpoint() func. Some of the funcs can be improved and renamed to remove the validation prefix, but I would prefer doing that in a follow-on PR at this point.
we should be returning the system trust bundle (ie the trust bundle included in our image). Not the openshift-config-managed CM bundle.
trusted-ca-bundle configmap contains the system trust bundle whether or not trustedCA is set. Even if I used the local system trust bundle, I would have to make multiple calls to read the local trust bundle file, parse the file into a []byte and then parse the []byte into a []*x509.Certificate that is used as a parameter for the validateReadinessEndpoint() func. validateTrustedCA() already does this, so I prefer to use the func for the time being and I can improve how the funcs are composed in a future PR.
I have updated the call to validateTrustedCA() to use "trusted-ca-bundle" and removed:
- if len(trustedCA) == 0 {
- trustedCA = names.TRUSTED_CA_BUNDLE_CONFIGMAP
- }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this logic needs to validate that the set of CAs we are going to publish into trusted-ca-bundle, are sufficient to talk to the proxy in question.
So we cannot use the current set off CAs in trusted-ca-bundle to do that, we need to produce the new bundle (ie "just the system CAs" or "system CAs plus the new user provided CAs") and use that bundle to perform the validation(readiness checks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to produce the new bundle (ie "just the system CAs" or "system CAs plus the new user provided CAs") and use that bundle to perform the validation(readiness checks)
@bparees I pushed a new commit that accomplishes this workflow. See this testing doc for details. When proxy.spec.trustedCA is updated, openshift-config-managed/trusted-ca-bundle configmap is updated before proxy config validation (i.e. running readinessEndpoints probes). openshift-config-managed/trusted-ca-bundle will contain the combined user/system bundle if proxy.spec.trustedCA is updated to a configmap with a different user-proivded bundle. openshift-config-managed/trusted-ca-bundle will contain only the system bundle if proxy.spec.trustedCA is empty. The controller will use this bundle for validating the httpsProxy using readinessEndpoints that contain a https scheme. If the https proxy's identity cert has been signed by a ca outside the system trust bundle and proxy.spec.trustedCA is empty, the readiness probe will fail.
caa304d to
da7a44f
Compare
3a15440 to
efcdf2d
Compare
|
/test e2e-aws-ovn-kubernetes |
efcdf2d to
8fd3311
Compare
|
@danehans: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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. I understand the commands that are listed here. |
8fd3311 to
ab80742
Compare
|
/lgtm future refactor should:
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bparees, danehans, knobunc 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 |
Adds support for for TLS-based probes for validating a
httpsProxyusing one or morereadinessEndpointsthat contain ahttpsscheme.Requires #271
/assign @squeed @bparees
PTAL at this block and this block. All other changes are due to the #271 dependency.