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

mount helper does not work with federated workload identity #666

Open
martinkaberg opened this issue Apr 28, 2022 · 5 comments
Open

mount helper does not work with federated workload identity #666

martinkaberg opened this issue Apr 28, 2022 · 5 comments
Labels
Eng-Backlog feature request Feature request: request to add new features or functionality p1 P1

Comments

@martinkaberg
Copy link

I am not able to get mount helper to work with federated workload identity. Just running gcsfuse works fine on the same system. Outputs below.

mount -t gcsfuse  velen-wp-uploads-germany /tmp/bucket
Calling gcsfuse with arguments: -o rw velen-wp-uploads-germany /tmp/bucket
2022/04/28 13:40:52.056394 Start gcsfuse/v0.41.0 (Go version go1.18.1) for app "" using mount point: /tmp/bucket
2022/04/28 13:40:52.067447 Opening GCS connection...

terminal stalls for a few minutes

then prints this message

2022/04/28 13:43:43.084844 Failed to open connection: GetTokenSource: DefaultTokenSource: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
daemonize.Run: readFromProcess: sub-process: mountWithArgs: getConnWithRetry: GetTokenSource: DefaultTokenSource: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
running gcsfuse: exit status 1

On the same system i am able to mount using the gcsfuse command

gcsfuse velen-wp-uploads-germany /tmp/bucket
2022/04/28 13:39:41.808885 Start gcsfuse/v0.41.0 (Go version go1.18.1) for app "" using mount point: /tmp/bucket
2022/04/28 13:39:41.820575 Opening GCS connection...
2022/04/28 13:39:42.050355 Mounting file system "velen-wp-uploads-germany"...
2022/04/28 13:39:42.050891 File system has been successfully mounted.
root@ip-10-200-1-18:/# ls /tmp/bucket
'Image from iOS (13).gif'
@martinkaberg
Copy link
Author

So found out what the issue is GOOGLE_APPLICATION_CREDENTIALS environment variable is not available when mount executes gcsfuse. It would be nice if --key-file option supported workload identity, or if we could have another option for that file.

Now i created a simple work around. I renamed gcsfuse binary to _gcsfuse and wrote bash script called gcsfuse

cat gcsfuse 
#!/bin/bash
export GOOGLE_APPLICATION_CREDENTIALS=/var/run/secrets/tokens/gcp-ksa/google-application-credentials.json
/usr/local/bin/_gcsfuse $@

@avidullu avidullu added the feature request Feature request: request to add new features or functionality label May 2, 2022
@avidullu
Copy link
Contributor

avidullu commented May 2, 2022

Thanks for the helpful feedback here!
We'll investigate the feasibility of using workload identity in gcsfuse.

@amoghmishra-sl
Copy link

Any fixes around it?

@Tulsishah
Copy link
Collaborator

GOOGLE_APPLICATION_CREDENTIALS

Hi @amoghmishra-sl, as I understood, mount helper is running through the root, and the GOOGLE_APPLICATION_CREDENTIALS environment variable is not set in root environment.
You can try to set this environment variable in the root mentioned like this and check if it is working or not.

Let me know if it works for you.

Thanks,
Tulsi Shah.

@vadlakondaswetha
Copy link
Collaborator

vadlakondaswetha commented Jun 19, 2023

@martinkaberg - Can you share details of the machine and how the workload identity is setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Eng-Backlog feature request Feature request: request to add new features or functionality p1 P1
Projects
None yet
Development

No branches or pull requests

8 participants