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

1.12 Running in-cluster e2es no longer respects service account RBAC rules. #69234

Closed
timothysc opened this issue Sep 28, 2018 · 17 comments · Fixed by #69273
Closed

1.12 Running in-cluster e2es no longer respects service account RBAC rules. #69234

timothysc opened this issue Sep 28, 2018 · 17 comments · Fixed by #69273
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. sig/testing Categorizes an issue or PR as relevant to SIG Testing.

Comments

@timothysc
Copy link
Member

Is this a BUG REPORT:
Sonobuoy runs the kubernetes e2e's differently then test-infra. It constructs an in-cluster config vs. being handed a kubeconfig from the infra.

In 1.12 something has broken this behavior, I'm still digging into the details.

What happened:
Run tests from within the cluster error occurs -
https://paste.fedoraproject.org/paste/D559nyX6SlGhA3tLPtWt5A

What you expected to happen:
Works fine, just like it had in 1.11

How to reproduce it (as minimally and precisely as possible):
Run tests from within the cluster given proper RBAC rules.

Anything else we need to know?:
Discovered when updating sonobuoy for 1.12.

/sig testing
/kind bug
/cc @kubernetes/sig-cluster-lifecycle @dims @BenTheElder @kubernetes/cncf-conformance-wg

@timothysc timothysc added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Sep 28, 2018
@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. kind/bug Categorizes issue or PR as related to a bug. labels Sep 28, 2018
@dims
Copy link
Member

dims commented Sep 28, 2018

One data point, the in-cluster-client-configuration example seems to work (but was missing RBAC step):
#69232

@neolit123
Copy link
Member

is there a known time when it last worked?

@timothysc
Copy link
Member Author

timothysc commented Sep 28, 2018

is there a known time when it last worked?

1.11 worked fine

One data point, the in-cluster-client-configuration example seems to work (but was missing RBAC step):
#69232

Sonobuoy's legacy in-cluster config works as well.

The e2e test suite relies on a single utility wrapper that seems to not be tested.
https://github.com/kubernetes/kubernetes/blob/master/test/e2e/framework/util.go#L2051

I'm still digging through the e2e setup, I haven't touched it since 1.9-ish timeframe.

@neolit123
Copy link
Member

1.11 worked fine

needs a binary search bisect between 1.11 and 1.12. :\

@akutz
Copy link
Member

akutz commented Sep 28, 2018

I'm definitely interested in this as VMware runs e2e tests in cluster. We're still handing the tests a kubeconfig from the outside, but the plan is to move to the same model as used by Sonobuoy.

@darxkies
Copy link

The token field in /tmp/kubeconfig-xxx is missing. BearerToken in client-go is apparently empty. Probably caused by this: #67359

@darxkies
Copy link

FYI, the following command can trick sonobuoy/e2e 0.12 into running the tests but beware it is a hack:

kubectl create clusterrolebinding cluster-system-anonymous --clusterrole=cluster-admin --user=system:anonymous

@dims
Copy link
Member

dims commented Sep 28, 2018

@timothysc i don't have proof, but looking through swathes of stuff, this one stood out - #66684 wanna try a local test in your environment with that removed?

@neolit123
Copy link
Member

@liztio shared a possible solution in the sig-cluster-life chat, @timothysc can confirm if that was a fix for the same thing or perhaps something else.

@dims
Copy link
Member

dims commented Sep 30, 2018

i'll take back my comment about #66684. trying to recreate the scenario i was able to print out the tmp file with the in-cluster config info.

1.11 - https://paste.fedoraproject.org/paste/8vHwWGJhgzrUkSlccBmVMg/raw
1.12 - https://paste.fedoraproject.org/paste/83My3KRhnny8kvSV9CWslQ/raw

Looks like the token information is missing in 1.12 exactly as @darxkies mentioned. So i support the darxkies's theory that #67359 is causing it.

@timothysc
Copy link
Member Author

Thanks @darxkies I verified that #69272 does fix.

@dims
Copy link
Member

dims commented Oct 1, 2018

/reopen

@k8s-ci-robot
Copy link
Contributor

@dims: Reopening 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.

@k8s-ci-robot k8s-ci-robot reopened this Oct 1, 2018
@stealthybox
Copy link
Member

@timothysc @chuckha What should we do with Sonobuoy now that this is merged and cherry-picked?
Do we need to wait for 1.12.1 to drop before we can use that test suite?
Will we use that test suite for 1.12.0 clusters?

@timothysc
Copy link
Member Author

Closing, I've been verifying with release-1.12 and with latest patches is works now.

@liggitt
Copy link
Member

liggitt commented Oct 8, 2018

/close
per #69234 (comment)

@k8s-ci-robot
Copy link
Contributor

@liggitt: Closing this issue.

In response to this:

/close
per #69234 (comment)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. sig/testing Categorizes an issue or PR as relevant to SIG Testing.
Projects
None yet
8 participants