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

'envtest' should support test scenarios with Authn/Authz configurations (should expose secure endpoint info of kube-apiserver) #983

Closed
everpeace opened this issue Jun 6, 2020 · 13 comments
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Milestone

Comments

@everpeace
Copy link

everpeace commented Jun 6, 2020

What is the problem

When we configured some authentication modules by envtest.Environment.KubeAPIServerFlags like below:

// just an example using basic auth module
te := &envtest.Environment{
  KubeAPIServerFlags: append(
    envtest.DefaultKubeAPIServerFlags, "--basic-auth-file=my-file", "--authorization-mode=RBAC",
  ),
}
cfg, _ := te.Start()

envtest.Config points to the insecure endpoint of kube-apiserver. As an official document says, we can't use this endpoint to test some scenarios containing authn/authz configurations. Moreover, envtest doesn't expose any TLS configurations of envtest's kube-apiserver.

Thus, users don't have any method to connect the secure endpoint of envtest's kube-apiserver.

Why does this need??

When controllers/webhooks interact with SubjectAccessReview or SelfSubjectAccessReview, user's wanted to test some scenarios containing authz(mainly RBAC) configurations.

Solution

internal.testing.integration.APIServer can expose TLSClientConfig containing its ca certificate that is setup in starting APIServer by TinyCA. Perhaps, we would envtest.Environment.SecureConfig for user's convenience.

@everpeace everpeace changed the title 'envtest' should support test scenarios with Authn/Authz configurations 'envtest' should support test scenarios with Authn/Authz configurations (should expose secure endpoint info of kube-apiserver) Jun 9, 2020
@vincepri
Copy link
Member

/milestone v0.6.x

@k8s-ci-robot k8s-ci-robot added this to the v0.6.x milestone Jul 22, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

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

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 20, 2020
@everpeace
Copy link
Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 22, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

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

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 20, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

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

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot 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 19, 2021
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

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.

@everpeace
Copy link
Author

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Mar 22, 2021
@everpeace
Copy link
Author

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Mar 22, 2021
@k8s-ci-robot
Copy link
Contributor

@everpeace: Reopened this issue.

In response to this:

/reopen

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.

@everpeace
Copy link
Author

#1486 will fix this issue.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

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

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 20, 2021
@everpeace
Copy link
Author

I'm closing this because it has been resolved by #1486

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
4 participants