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

USHIFT-278: Remove KAS kubeconfig #909

Merged
merged 2 commits into from
Sep 1, 2022

Conversation

stlaz
Copy link
Contributor

@stlaz stlaz commented Aug 31, 2022

The kube-apiserver kubeconfig is likely unused. This PR removes this file with privileged credentials.

The kubeconfig appears to have only been used to generate a REST client for KAS "/readyz" check. Let's see if we can easily replace that by just supplying an anonymous client instead for this check.

@stlaz stlaz changed the title Remove KAS kubeconfig USHIFT-278: Remove KAS kubeconfig Aug 31, 2022
@dhellmann
Copy link
Contributor

The "likely unused" part of the description, along with a lack of confidence in our CI coverage, combined make me concerned about merging this patch without understanding how to test it. Is there something I can do to poke at a running instance to see if the change is working properly?

@benluddy
Copy link
Contributor

benluddy commented Aug 31, 2022

I don't see anything that reads the kubeconfig path during initialization. We would expect the controllers inside kube-apiserver to break if they were using this instead of the loopback client config.

@stlaz
Copy link
Contributor Author

stlaz commented Sep 1, 2022

What Ben says - I found it odd that the kube-apiserver would need a kubeconfig but I did not want to rule anything out.

Turns out it's only ever used for the /readyz checking, and so this PR is safe to merge

if err != nil {
return false, err
}
if err := rest.SetKubernetesDefaults(restConfig); err != nil {
return false, err
}
restConfig.NegotiatedSerializer = serializer.NewCodecFactory(runtime.NewScheme())
restConfig.CAFile = s.servingCertPath
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this is just a startup test and we are specifically interested in checking this very server, I believe a simple trust such as we've got here is adequate

Copy link
Contributor

@pacevedom pacevedom left a comment

Choose a reason for hiding this comment

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

/lgtm

@pacevedom
Copy link
Contributor

/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 1, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 1, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pacevedom, stlaz

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 1, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 1, 2022

@stlaz: 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-merge-robot openshift-merge-robot merged commit 006753b into openshift:main Sep 1, 2022
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants