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

service account token missing in pod #246

Open
bcle opened this issue Sep 14, 2021 · 1 comment
Open

service account token missing in pod #246

bcle opened this issue Sep 14, 2021 · 1 comment

Comments

@bcle
Copy link

bcle commented Sep 14, 2021

Pods using in-cluster authentication are failing because /run/secrets/kubernetes.io/serviceaccount/token is missing from their file system. I am using this KIP provider version:

    Image:         elotl/kip:latest
    Image ID:      docker-pullable://elotl/kip@sha256:8182c30c9751290ce319eaa27f82109bd907c5f265095c37d0520b82bd7fa510

on a AWS cluster recently created using KIP's terraform script.

One way to reproduce this problem is to start a simple ubuntu pod that runs an infinite loop:

kubectl run xenial --image=ubuntu:xenial --command -- bash -c 'while true; do echo `date`; sleep 5; done'

Then, this command shows the contents of /run/secrets/kubernetes.io/serviceaccount/:

kubectl exec xenial -- bash -c "ls -l /run/secrets/kubernetes.io/serviceaccount/"

The output shows that the token file is missing:

total 4
-rw-r--r-- 1 root root 1066 Sep 14 04:00 ca.crt
@bcle
Copy link
Author

bcle commented Sep 14, 2021

This command shows that the serviceaccount directory appears correctly mounted. It's just that its contents are missing the token file:

$ kubectl describe pod xenial

Namespace:    default
Priority:     0
Node:         kip-provider-0/10.0.29.198
Start Time:   Mon, 13 Sep 2021 20:59:18 -0700
Labels:       run=xenial
Annotations:  <none>
Status:       Running
IP:           10.0.30.142
IPs:
  IP:  10.0.30.142
Containers:
  xenial:
    Container ID:  
    Image:         ubuntu:xenial
    Image ID:      ubuntu:xenial
    Port:          <none>
    Host Port:     <none>
    Command:
      bash
      -c
      while true; do echo `date`; sleep 5; done
    State:          Running
      Started:      Mon, 01 Jan 0001 00:00:00 +0000
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-lb7j8 (ro)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant