aws-iam-authenticator icon indicating copy to clipboard operation
aws-iam-authenticator copied to clipboard

--cache issues on Windows

Open RMcD opened this issue 6 years ago • 26 comments

I'm seeing an issue when using the --cache flag from #193 on Windows.

On first run:

Cache file C:\Users\mememe\.kube\cache\aws-iam-authenticator\credentials.yaml does not exist.
No cached credential available.  Refreshing...
Assume Role MFA token code: ######
Unable to update credential cache C:\Users\mememe\.kube\cache\aws-iam-authenticator\credentials.yaml: write C:\Users\mememe\.kube\cache\aws-iam-authenticator\credentials.yaml: The process cannot access the file because another process has locked a portion of the file.

Then subsequent calls fail with:

unable to use cache: cache file C:\Users\mememe\.kube\cache\aws-iam-authenticator\credentials.yaml is not private

I've tried adjusting the permissions on the file to be just rw for my user but that doesn't seem to have an effect. I've also tried from different cmd windows with admin and without.

RMcD avatar Aug 15 '19 17:08 RMcD

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

fejta-bot avatar Dec 09 '19 18:12 fejta-bot

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-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten

fejta-bot avatar Jan 08 '20 19:01 fejta-bot

/remove-lifecycle rotten

RMcD avatar Jan 15 '20 22:01 RMcD

We're currently using a workaround that involved using https://github.com/99designs/aws-vault to manage the MFA authorizations for the aws-iam-authenticator as follows:

- name: DevAdmin
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      args:
      - exec
      - DevelopmentAdminAwsProfile
      - --
      - aws-iam-authenticator.exe
      - token
      - -i
      - <eks-clustername>
      - -r
      - arn:aws:iam::<aws-account-id>:role/K8SClusterManagerRole
      command: aws-vault.exe
      env: null
- name: DevRO
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      args:
      - exec
      - DevelopmentK8sROProfile
      - --
      - aws-iam-authenticator.exe
      - token
      - -i
      - <eks-clustername>
      command: aws-vault.exe
      env: null

RMcD avatar Jan 15 '20 22:01 RMcD

The check here seems like it should still work even on Windows since the other bits should be 0? Will need to find a windows machine to check. https://github.com/kubernetes-sigs/aws-iam-authenticator/blob/cdd216dbd0a6a6021e9dafee8bacac528a89f178/pkg/token/filecache.go#L189

https://golang.org/pkg/os/#Chmod "On Windows, only the 0200 bit (owner writable) of mode is used; it controls whether the file's read-only attribute is set or cleared. The other bits are currently unused. For compatibility with Go 1.12 and earlier, use a non-zero mode. Use mode 0400 for a read-only file and 0600 for a readable+writable file."

wongma7 avatar Jan 15 '20 22:01 wongma7

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

fejta-bot avatar Apr 14 '20 23:04 fejta-bot

I'm encountering this issue as well:

unable to use cache: cache file C:\Users\username\.kube\cache\aws-iam-authenticator\credentials.yaml is not private

Neurrone avatar May 12 '20 10:05 Neurrone

/remove-lifecycle stale

RMcD avatar May 12 '20 17:05 RMcD

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

fejta-bot avatar Aug 10 '20 18:08 fejta-bot

/remove-lifecycle stale

RMcD avatar Aug 10 '20 19:08 RMcD

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

fejta-bot avatar Nov 08 '20 20:11 fejta-bot

/remove-lifecycle stale

Neurrone avatar Nov 09 '20 12:11 Neurrone

Without using this cache it nearly makes it impossible to properly use the aws-iam-authenticator on Windows. For each kubectl command you have to enter a new MFA key...

Is it planned to get this fixed?

chris922 avatar Dec 18 '20 14:12 chris922

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

fejta-bot avatar Mar 18 '21 15:03 fejta-bot

/remove-lifecycle stale

Neurrone avatar Mar 18 '21 15:03 Neurrone

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

fejta-bot avatar Jun 16 '21 16:06 fejta-bot

/remove-lifecycle stale

chris922 avatar Jun 16 '21 19:06 chris922

Still experiencing caching issues.

ngstigator avatar Aug 09 '21 16:08 ngstigator

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Nov 07 '21 16:11 k8s-triage-robot

/remove-lifecycle stale

chris922 avatar Nov 07 '21 18:11 chris922

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Feb 05 '22 19:02 k8s-triage-robot

/remove-lifecycle stale

Neurrone avatar Feb 06 '22 02:02 Neurrone

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar May 07 '22 03:05 k8s-triage-robot

/remove-lifecycle stale

Neurrone avatar May 07 '22 06:05 Neurrone

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 05 '22 07:08 k8s-triage-robot

/remove-lifecycle stale

Neurrone avatar Aug 05 '22 08:08 Neurrone

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Nov 03 '22 09:11 k8s-triage-robot

/remove-lifecycle stale

Neurrone avatar Nov 03 '22 09:11 Neurrone

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Feb 01 '23 10:02 k8s-triage-robot

/remove-lifecycle stale

Neurrone avatar Feb 01 '23 13:02 Neurrone