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

Allow cert-manager to be provisioned externally #11354

Merged
merged 1 commit into from
Apr 30, 2021

Conversation

codablock
Copy link
Contributor

This PR allows provisioning of cert-manager externally. It actually leads to a no-op, but makes checks (IsCertManagerEnabled) succeed so that other dependent addons are deployable.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 29, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @codablock. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/api labels Apr 29, 2021
if fi.BoolValue(spec.Enabled) && fi.BoolValue(spec.External) {
allErrs = append(allErrs, field.Forbidden(fldPath, "Cert manager must be either enabled or external but not both"))
}
if fi.BoolValue(spec.External) && fi.StringValue(spec.Image) != "" {
Copy link
Member

Choose a reason for hiding this comment

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

This seems a bit overkill. I think we can just document that when external is set, any other flag is ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the last 2 checks.

@@ -930,6 +930,10 @@ type CertManagerConfig struct {
// Default: false
Enabled *bool `json:"enabled,omitempty"`

// External Tell kops that cert manager is deployed externally.
// Default: false
External *bool `json:"external,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Let me check if this naming is consistent with other structs where we allow this.

Copy link
Member

Choose a reason for hiding this comment

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

I think some other time we discussed about "Managed".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean setting "managed" to false?

Copy link
Member

Choose a reason for hiding this comment

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

Example:

Managed *bool `json:"managed,omitempty"`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the PR to do it the same way

@olemarkus
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 29, 2021
@codablock codablock force-pushed the external-cert-manager branch 2 times, most recently from 7d7e13f to 4ad50f0 Compare April 30, 2021 10:25
either remove this installation prior to enabling this addon, or mark cert-manger as not being managed by kOps (see below).
As long as you are using v1 versions of the cert-manager resources, it is safe to remove existing installs and replace it with this addon**

The following cert-manager configuration allows provisioning cert-manager externally and allows all dependent plugins
Copy link
Member

Choose a reason for hiding this comment

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

Can you add the version macro?
{{ kops_feature_table(kops_added_default='1.21', k8s_min='1.16') }}

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 was not sure where to add this, I hope I got it right

Copy link
Member

Choose a reason for hiding this comment

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

Usually we just add a subheading and place the macro under.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added another commit. I'm still unsure if this is how you expect it, if not, can you show me how you expect it?

Copy link
Member

Choose a reason for hiding this comment

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

Looks perfect

Copy link
Member

@olemarkus olemarkus left a comment

Choose a reason for hiding this comment

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

Can you squash? then this is ready to go.

either remove this installation prior to enabling this addon, or mark cert-manger as not being managed by kOps (see below).
As long as you are using v1 versions of the cert-manager resources, it is safe to remove existing installs and replace it with this addon**

The following cert-manager configuration allows provisioning cert-manager externally and allows all dependent plugins
Copy link
Member

Choose a reason for hiding this comment

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

Looks perfect

@codablock
Copy link
Contributor Author

Squashed

Copy link
Member

@olemarkus olemarkus left a comment

Choose a reason for hiding this comment

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

Much obliged

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 30, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: olemarkus

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 30, 2021
@k8s-ci-robot k8s-ci-robot merged commit 3704ffd into kubernetes:master Apr 30, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Apr 30, 2021
@codablock codablock deleted the external-cert-manager branch May 1, 2021 11:38
@kellycampbell
Copy link
Contributor

Could this be cherry-picked back to 1.20? We're running into an error trying to upgrade from 1.19 to 1.20 due to metricsServer being enabled, but now certManager requirement is checked. We already have cert manager in the cluster and want to take more time to make sure all our certs are going to port over if we switch to the add-on. (I'm working around this for now by disabling metricsServer since this on a dev cluster.)

@olemarkus
Copy link
Member

For metrics-server you can set insecure: true, which will disable the cert manager check.

I don't think we'll be doing a 1.20 release before 1.21 anyway.

k8s-ci-robot added a commit that referenced this pull request May 21, 2021
…-upstream-release-1.20

Automated cherry pick of #11354: Allow cert-manager to be provisioned externally
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 area/documentation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants