Skip to content

Enable usages of application default credentials #610

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

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

mattcary
Copy link
Contributor

/kind feature

What this PR does / why we need it:
This PR changes driver configuration to allow k8s-on-gce tests to be run using application default credentials, avoiding the security risks of creating service account keys.

Instructions for how to do this have been added to test/run-k8s-integration-local.sh.

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 19, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mattcary

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 19, 2020
@mattcary
Copy link
Contributor Author

/assign @saikat-royc

#images:
#- name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
# newName: gcr.io/mattcary-gke-dev-owned/csi/gce-pd-driver
# newTag: latest.
Copy link
Contributor

Choose a reason for hiding this comment

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

why you prefer to change image here instead of under /image dir?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@verult

I just figured this out this morning, it's a little complicated.... The actual change is to remove the change to the dev driver image, as currently the image in images/dev/images.yaml is not the same as the placeholder in base/.

I add a new overlay noauth which removes the secret volume. It uses the dev overlay as a resource. If the dev overlay uses the image resource, as far as I can tell it overrides the image before any images: transformer in the noauth overlay.

Because the images transform name: must match what's already in the yaml, that would mean for any images: transform (in overlays/noauth/kustomize.yaml) would have to match whatever dev is transformed into, that is, the newName in /images/dev/images.yaml (which is currently David's repo ;-)

When the pd csi driver k8s-integration test runs with --do-driver-build=true, the image tag to load is set by doing kustomize edit in the overlay dir, eg overlays/dev or overlays/noauth. That edit assumes the name is the placeholder (gke.gcr.io/gcp-compute-persiistent-disk-csi-driver). But, if the dev/ overlay has already changed the image name, then that kustomize edit isn't effective (since name: doesn't match anything).

Possibly one could fix this by doing a strategicMergePatch that matches the driver container rather than using an images transform? Then we wouldn't have this problem of import dependancies.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think k8s-integration could potentially create its own image tag instead of overwriting the file. Do you think that would solve the problem?

The other way could be to move the noauth patch up one level and include it as part of the dev overlay itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

k8s-integration would have to know which images/ transform to change.

Moving the noauth patch up would help, I wasn't sure if we wanted to keep a use-key dev for those who aren't restricted about key downloads (because the extra cluster create parameters could break some workflows maybe)

I also looked into sharing the always-push change although the easiest way to do that means passing the no load restriction flag.

@mattcary
Copy link
Contributor Author

ping?

any other comments/suggestions, particularly on the overlay changes?

@msau42
Copy link
Contributor

msau42 commented Sep 25, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 25, 2020
@mattcary
Copy link
Contributor Author

cmek failing, I shouldn't have changed anything that only impacted that test, so probably flake.

/test pull-gcp-compute-persistent-disk-csi-driver-e2e

@k8s-ci-robot k8s-ci-robot merged commit 254f925 into kubernetes-sigs:master Sep 29, 2020
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. 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.

5 participants