-
Notifications
You must be signed in to change notification settings - Fork 827
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
tests: Adds e2e-test-auth-img project #1929
Conversation
ef90d41
to
c63b2a4
Compare
c63b2a4
to
31ab047
Compare
31ab047
to
b54948d
Compare
@claudiubelu Please add a comment in the |
b54948d
to
f941a0e
Compare
Ty! |
/lgtm |
I have this sneaking suspicion we can't get away with EDIT: correct, we cannot accomplish what the description is asking for ref: https://cloud.google.com/container-registry/docs/access-control#public
|
ok that comment is less relevant, this PR is for authenticated-image-pulling, into which I have not dug deeply |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An auth token with read-only access will have to be generated afterwards
Can you describe that a little bit more? I feel like that should be part of this PR. I suspect we can get away with either copying or refactoring what we use in ensure-conformance.sh to at least ensure the service account that will be authed is present:
k8s.io/infra/gcp/ensure-conformance-storage.sh
Lines 104 to 131 in 9e2220c
# ensure_conformance_serviceaccount ensures that: | |
# - a serviceaccount of the given name exists in PROJECT | |
# - it can write to the given bucket | |
# - it has a private key stored in a secret in PROJECT accessible to the given group | |
function ensure_conformance_serviceaccount() { | |
local name="${1}" | |
local bucket="${2}" | |
local secret_accessors="${3}" | |
local email="$(svc_acct_email "${PROJECT}" "${name}")" | |
local secret="${name}-key" | |
local private_key_file="${TMPDIR}/key.json" | |
color 6 "Ensuring service account exists: ${email}" | |
ensure_service_account "${PROJECT}" "${name}" "Grants write access to ${bucket}" | |
color 6 "Ensuring ${PROJECT} contains secret ${secret} with private key for ${email}" | |
ensure_serviceaccount_key_secret "${PROJECT}" "${secret}" "${email}" | |
color 6 "Empowering ${secret_accessors} to access secret: ${secret}" | |
ensure_secret_role_binding \ | |
"projects/${PROJECT}/secrets/${secret}" \ | |
"group:${secret_accessors}" \ | |
"roles/secretmanager.secretAccessor" | |
color 6 "Empowering ${email} to write to ${bucket}" | |
empower_svcacct_to_write_gcs_bucket "${email}" "${bucket}" | |
} |
infra/gcp/ensure-staging-storage.sh
Outdated
PRIVATE_PROJECTS=( | ||
e2e-test-auth-img | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is a pattern we want to encourage more of?
/cc @thockin @listx @hh @saschagrunert @jeremyrickard
|
1056d82
to
1d4284f
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: claudiubelu The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conceptually seems OK but not comfortable approving the whole thing myself given prior debate about how this should be done / named / ...
The gcr.io/k8s-staging-e2e-test-auth-img and gcr.io/kubernetes-e2e-test-auth-img registries are meant to be private, to be used in a few E2E test scenarios, and it is meant to replace the gcr.io/authenticated-image-pulling. An auth token with read-only access will have to be generated afterwards, and then baked into the E2E tests.
1d4284f
to
b23a500
Compare
New changes are detected. LGTM label has been removed. |
So, the question remains: can this be made private? If so, how? It seems that kubernetes/k8s.io changed since this was initially proposed, so this just simply creates a new project, it's no longer trying to make it private at the moment. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
This was always done on a separate registry, and it was always a GCR registry. I don't think the purpose of the test is to test cloud providers at all, just the flow of an image that requires credentials. I don't see a reasonable better alternative proposed here, other than perhaps giving up on the test ... I'm going to drop a link in the SIG slack, I think this PR deserved a follow-up answering @claudiubelu's questions. |
IMO: yes. we should give it a one-off, more descriptive name if we do this.
Proposing one alternative (maybe) ... can we rely on running a simple authenticated registry in-cluster as part of the test? And just not serve a public endpoint for this purpose at all. We could probably bake up a docker image that is an authenticated registry with some image pre-pushed to it, the question is mostly of if we can run an in-cluster registry sufficiently portably for test purposes. I think the answer might be "no, we can't" (TLS? CRI <-> pod reachability?), but perhaps worth exploring. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
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. |
The
gcr.io/k8s-staging-e2e-test-auth-img
andk8s.gcr.io/kubernetes-e2e-test-auth-img
registries are meant to be private, to be used in a few E2E test scenarios, and it is meant to replace thegcr.io/authenticated-image-pulling
.An auth token with read-only access will have to be generated afterwards, and then baked into the E2E tests.
Related: #1459
Related: #1528