cannot generate a service account token in kubernetes v1

I am trying to generate a service account token on a kubernetes cluster for API authentication. The operation succeeds and the secret is created but there is no token generated. What could I be missing here?

{
    "kind": "Secret",
    "apiVersion": "v1",
    "metadata": {
        "name": "defaultsecret1",
        "annotations": {
            "kubernetes.io/service-account.name": "cfme"
        }
    },
    "type": "kubernetes.io/service-account-token"
}

[root@atomic001 ~]# kubectl create -f secret.json 
secret "defaultsecret1" created

[root@atomic001 ~]# kubectl get secret defaultsecret1
NAME             TYPE                                  **DATA**          AGE
defaultsecret1   kubernetes.io/service-account-token   **0**         13s

[root@atomic001 ~]# kubectl describe secret defaultsecret1
Name:       defaultsecret1
Namespace:  default
Labels:     <none>
Annotations:    kubernetes.io/service-account.name=core1

Type:   kubernetes.io/service-account-token

Data
====
                    <--- token should be here

[root@atomic001 ~]# 

Been up and down and all around on this. Any help is appreciated.

  • docker mesosphere marathon - unable to see running process inside a docker container
  • Connecting to a USB Android Device in a Docker Container via adb
  • How to mount a directory inside a docker container on linux host
  • How to update a Kubernetes deployment on Google Container Engine?
  • How to handle stage specific keystore in docker images
  • Docker Swarm with image versions externalized to .env file
  • How can I get RabbitMQ running with docker?
  • How can I make actual image files persistent in file upload process running with docker?
  • akka cluster nodes behind NAT (using docker)
  • Docker Cloud autotest cant find service
  • How to build a docker container with nix?
  • custom docker image is not running postgres
  • One Solution collect form web for “cannot generate a service account token in kubernetes v1”

    I figured this out.

    I had to generate a private key with openssl and then point to it in the controller-manager configuration file. Now the tokens are being created.

    KUBE_CONTROLLER_MANAGER_ARGS=”–service-account-private-key-file=/etc/kubernetes/serviceaccount.key”

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.