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

garden dev --hot='*' loses track of Kubernetes authorization #1043

Closed
jmeickle opened this issue Jul 29, 2019 · 2 comments
Closed

garden dev --hot='*' loses track of Kubernetes authorization #1043

jmeickle opened this issue Jul 29, 2019 · 2 comments
Assignees
Labels
bug stale Label that's automatically set by stalebot. Stale issues get closed after 14 days of inactivity.

Comments

@jmeickle
Copy link

Bug

Current Behavior

Initially, hot reloading works fine. After some time it starts reliably failing on save, with k8s auth errors:

⏳ Processing...
ℹ web                       → Hot reloading...
✔ web                       → Hot reloading... → Done (took 822 ms)

🕑 Waiting for code changes...

⏳ Processing...
ℹ web                       → Hot reloading...
✔ web                       → Hot reloading... → Done (took 948 ms)

🕑 Waiting for code changes...

⏳ Processing...
ℹ web                       → Hot reloading...
✖ web                       → Hot reloading...

Failed hot-reloading service web. Here is the output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
StatusCodeError from Kubernetes API - 401 - {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━


🕑 Waiting for code changes...

⏳ Processing...
ℹ web                       → Hot reloading...
✖ web                       → Hot reloading...

Failed hot-reloading service web. Here is the output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
StatusCodeError from Kubernetes API - 401 - {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━


🕑 Waiting for code changes...

⏳ Processing...
ℹ web                       → Hot reloading...
✖ web                       → Hot reloading...

Failed hot-reloading service web. Here is the output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
StatusCodeError from Kubernetes API - 401 - {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ctrl-c'ing the process and restarting it fixes it, so I believe this is a token auth issue.

Expected behavior

No auth errors on hot reloads, and retries if there are any errors.

Additional context

We're using a kubectl exec plugin, specifically heptio-authenticator-aws, to fetch time-limited authentication tokens. This is likely what's breaking Garden (we've seen it before with other applications, since many don't implement logic to re-fetch creds after a period of time or on error). Here's what our config looks like:

- name: stg-admin
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      args:
      - token
      - -i
      - CLUSTER_URL
      - -r
      - arn:aws:iam::ACCT_ID:role/IAM_ROLE_NAME
      command: heptio-authenticator-aws
      env: null

Your environment

[eronarn@ip-192-168-10-243 qf]$ garden version && kubectl version && docker version
0.10.2
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:44:30Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.7", GitCommit:"4683545293d792934a7a7e12f2cc47d20b2dd01b", GitTreeState:"clean", BuildDate:"2019-06-06T01:39:30Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Client: Docker Engine - Community
 Version:           19.03.0-rc2
 API version:       1.40
 Go version:        go1.12.5
 Git commit:        f97efcc
 Built:             Wed Jun  5 01:37:53 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.0-rc2
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.5
  Git commit:       f97efcc
  Built:            Wed Jun  5 01:42:10 2019
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.2.6
  GitCommit:        894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc:
  Version:          1.0.0-rc8
  GitCommit:        425e105d5a03fabd737a126ad93d62a9eeede87f
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
@eysi09 eysi09 assigned eysi09 and thsig and unassigned eysi09 Jul 30, 2019
@edvald edvald added the bug label Jul 30, 2019
@edvald
Copy link
Collaborator

edvald commented Jul 30, 2019

This turns out to be an issue in the Kubernetes API library we use, but we should be able to catch and work around it. I'll take a look.

@edvald edvald assigned edvald and unassigned thsig Jul 30, 2019
@stale
Copy link

stale bot commented Jan 15, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Label that's automatically set by stalebot. Stale issues get closed after 14 days of inactivity. label Jan 15, 2020
@stale stale bot closed this as completed Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale Label that's automatically set by stalebot. Stale issues get closed after 14 days of inactivity.
Projects
None yet
Development

No branches or pull requests

4 participants