Skip to content

ocpbugs-8882: configure an additional clientca for the openshiftapi s… #66833

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

Closed
wants to merge 1 commit into from

Conversation

nalhadef
Copy link
Contributor

@nalhadef nalhadef commented Oct 24, 2023

ocpbugs-8882: Configure an additional clientCA for the OpenShift API server

4.11+

Issue:
https://issues.redhat.com/browse/OCPBUGS-8882

Link to docs preview (December 21, 2023):
https://66833--ocpdocs-pr.netlify.app/openshift-enterprise/latest/security/certificates/api-server

QE review:

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 24, 2023
@openshift-ci-robot
Copy link

@nalhadef: This pull request references ocpbugs-8882 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.15.0" version, but no target version was set.

In response to this:

…erver

ocpbugs-8882: Configure an additional clientCA for the OpenShift API server

4.11+

Issue:
https://issues.redhat.com/browse/OCPBUGS-8882

Link to docs preview:

QE review:

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.

@openshift-ci openshift-ci bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 24, 2023
@ocpdocs-previewbot
Copy link

ocpdocs-previewbot commented Oct 24, 2023

🤖 Tue Jan 09 19:13:44 - Prow CI generated the docs preview: https://66833--ocpdocs-pr.netlify.app

@openshift-ci openshift-ci bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 25, 2023
@nalhadef nalhadef force-pushed the ocpbugs-8882 branch 2 times, most recently from c4f78a5 to 28b0e16 Compare October 25, 2023 15:51
Copy link
Contributor

@jeana-redhat jeana-redhat left a comment

Choose a reason for hiding this comment

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

A couple general comments on this one for you 👍

@nalhadef
Copy link
Contributor Author

@jeana-redhat, I'll talk with the reporter about this. The bug was to add this material. If he's happy with it being an introduction, I'm happy to do it. Thanks.

----

. Test the new clientCA certificate with a certificate signed from the new clientCA.
. If the test is successful, you can remove the installer-generated clientCA.
Copy link
Contributor

Choose a reason for hiding this comment

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

You are not explaining how to remove the installer-generated client CA yet you ask to remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd remove this reference from this section but add a new section that explains the removal, after this section, and that suggests that you should first add the new CA as per the section above before replacing.

Pietro may provide a better view on how it should exactly look like

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the info, Pablo. Could you or Pietro send me the details on how to remove the installer-generated client CA?

Copy link

Choose a reason for hiding this comment

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

@nalhadef here is a bit confusing, this KCS explains the procedure: https://access.redhat.com/solutions/6054981

To give you more context:

  • the installer-generate kubeconfig contains a client TLS certificate signed by a CA
  • the CA signing the kubeconfig is stored into the configmap named admin-kubeconfig-client-ca into the openshift-config namespace
  • in order to invalidate the installer-generated kubeconfig you have to replace the CA (thus the content of the configmap)
  • replacing the CA can be dangerous because if you are using the installer-generated kubeconfig and the content of the CM is somehow invalid you can be locked out from the API
  • for that reason in the KCS I suggest to:
    • first add an additional CA
    • generate a new kubeconfig using the new CA
    • replace the original CA replacing the configmap.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Incorporated KCS article content

@palonsoro
Copy link
Contributor

I made two in-line comments. Please check them or let me know if you cannot see them

@nalhadef
Copy link
Contributor Author

Began incorporating content about removing installer-generated certificate.

@openshift-ci openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 13, 2023
@nalhadef
Copy link
Contributor Author

nalhadef commented Nov 13, 2023

@palonsoro and @pbertera hi, Pablo and Pietro.

I've incorporated the KCS article content into the documentation. Please let me know if it works for you.
https://66833--docspreview.netlify.app/openshift-enterprise/latest/security/certificates/api-server

Thanks!

@palonsoro
Copy link
Contributor

@nalhadef process looks good to me, but QE should do a specific end-to-end test.

Success criteria:

  • Cluster must be accessible with a kubeconfig that has a client certificate signed by the new CA.
  • Cluster must not be accessible with the original installation kubeconfig.

If any help is needed during QE testing, feel free to reach out, but we need thorough QE testing for this.

@nalhadef
Copy link
Contributor Author

nalhadef commented Nov 15, 2023 via email

@nalhadef
Copy link
Contributor Author

@xingxingxia Xia, I think you might be the QE for this features. Please do a QE test and, if accurate please add a LGTM label. Thanks!!

@xingxingxia
Copy link
Contributor

@nalhadef , this falls in API Server QE team who has the test case , so I'm reassigning https://issues.redhat.com/browse/OCPBUGS-8882 to Ke Wang's team for review.

@nalhadef
Copy link
Contributor Author

nalhadef commented Dec 5, 2023

Hello, Ke Wang. Can you please assign a member of your team to review and hopefully assign a LGTM to this PR. It's associated with OCPBUS-8882. Thanks.

@wangke19
Copy link

wangke19 commented Dec 8, 2023

@nalhadef here is one doc https://access.redhat.com/solutions/6054981 for this section Configure an additional clientCA for the OpenShift API server, you can refer to it. But I don't think we provide more detail for this, I don't know if we can share the solutions to the public docs.


An existing kubeconfig is replaced by adding a new kubeconfig and configuring the existing kubeconfig to be invalid. The existing kubeconfig remains in place, but is not used due to its invalidating configuration. The existing, now invalid, kubeconfig cannot be removed.

Optionally, you can replace the installer-generated kubeconfig. This process is also referred to as configuring the installer-generated kubceconfig to be invalid.
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤖 [error] RedHat.TermsErrors: Use 'installation program' rather than 'the installer'. For more information, see RedHat.TermsErrors.


An existing kubeconfig is replaced by adding a new kubeconfig and configuring the existing kubeconfig to be invalid. The existing kubeconfig remains in place, but is not used due to its invalidating configuration. The existing, now invalid, kubeconfig cannot be removed.

Optionally, you can replace the installer-generated kubeconfig. This process is also referred to as configuring the installer-generated kubceconfig to be invalid.
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤖 [error] RedHat.TermsErrors: Use 'installation program' rather than 'the installer'. For more information, see RedHat.TermsErrors.


.Procedure

To replace the installer-generated kubeconfig, remove the installer-generated clientCA from the API server:
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤖 [error] RedHat.TermsErrors: Use 'installation program' rather than 'the installer'. For more information, see RedHat.TermsErrors.


.Procedure

To replace the installer-generated kubeconfig, remove the installer-generated clientCA from the API server:
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤖 [error] RedHat.TermsErrors: Use 'installation program' rather than 'the installer'. For more information, see RedHat.TermsErrors.


To replace the installer-generated kubeconfig, remove the installer-generated clientCA from the API server:

. Use the following command to import an additional CA certificate in a configmap in the `openshift-config`` namespace. The CA file must be in PEM format.
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤖 [error] RedHat.CaseSensitiveTerms: Use 'config map' rather than 'configmap'. For more information, see RedHat.CaseSensitiveTerms.

----

. Test the new clientCA certificate with a certificate signed from the new clientCA.
. If the test is successful, you can remove the installer-generated clientCA.
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤖 [error] RedHat.TermsErrors: Use 'installation program' rather than 'the installer'. For more information, see RedHat.TermsErrors.

:_content-type: PROCEDURE
[id="replace-the-certificate-authority_{context}"]

= Invalidating the installer-generated kubeconfig before replacing it with a newly generated CA certificate
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤖 [error] RedHat.TermsErrors: Use 'installation program' rather than 'the installer'. For more information, see RedHat.TermsErrors.


= Invalidating the installer-generated kubeconfig before replacing it with a newly generated CA certificate

The installer-generated kubeconfig cannot be removed, but it can be invalidated and replaced with a newly generated CA certificate.
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤖 [error] RedHat.TermsErrors: Use 'installation program' rather than 'The installer'. For more information, see RedHat.TermsErrors.


The installer-generated kubeconfig cannot be removed, but it can be invalidated and replaced with a newly generated CA certificate.

You can replace the installer-generated kubeconfig. You might do this if any of the following conditions exist:
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤖 [error] RedHat.TermsErrors: Use 'installation program' rather than 'the installer'. For more information, see RedHat.TermsErrors.

[role="_additional-resources"]
== Additional resources

* link:https://access.redhat.com/solutions/6054981[Replacing the certificate authority for the installer system:admin kubeconfig]
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤖 [error] RedHat.TermsErrors: Use 'installation program' rather than 'the installer'. For more information, see RedHat.TermsErrors.

Copy link

openshift-ci bot commented Apr 12, 2024

@nalhadef: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 25, 2024
@palonsoro
Copy link
Contributor

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 25, 2024
@bergerhoffer
Copy link
Contributor

The branch/enterprise-4.18 label has been added to this PR.

This is because your PR targets the main branch and is labeled for enterprise-4.17. And any PR going into main must also target the latest version branch (enterprise-4.18).

If the update in your PR does NOT apply to version 4.18 onward, please re-target this PR to go directly into the appropriate version branch or branches (enterprise-4.x) instead of main.

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 14, 2025
@palonsoro
Copy link
Contributor

/remove-lifecycle stale

@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 14, 2025
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2025
@openshift-merge-robot
Copy link

PR needs rebase.

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-sigs/prow repository.

@bergerhoffer
Copy link
Contributor

The branch/enterprise-4.19 label has been added to this PR.

This is because your PR targets the main branch and is labeled for enterprise-4.18. And any PR going into main must also target the latest version branch (enterprise-4.19).

If the update in your PR does NOT apply to version 4.19 onward, please re-target this PR to go directly into the appropriate version branch or branches (enterprise-4.x) instead of main.

@bergerhoffer
Copy link
Contributor

Closing in favor of #89427

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch/enterprise-4.12 branch/enterprise-4.13 branch/enterprise-4.14 branch/enterprise-4.15 branch/enterprise-4.16 branch/enterprise-4.17 branch/enterprise-4.18 branch/enterprise-4.19 jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. peer-review-done Signifies that the peer review team has reviewed this PR 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.

None yet