<p>I get <code>Please enter Username</code> when I try to deploy with a ServiceAccount, even I have set ClusterRole bindings - do you know why?</p>

<p>kubectl:</p>

<pre><code>kubectl apply -f deployment.yaml
</code></pre>

<p>Role &amp; binding:</p>

<pre><code>kubectl create clusterrole tutorial-role \
               --verb=get,list,watch,create,update,patch,delete \
               --resource=deployments


kubectl create clusterrolebinding tutorial-binding \
             --clusterrole=tutorial-role \
             --serviceaccount=default:tutorial-service
</code></pre>

<p>Create config user:</p>

<pre><code>TOKEN=$(kubectl describe secrets "$(kubectl describe serviceaccount tutorial-service | grep -i Tokens | awk '{print $2}')" | grep token: | awk '{print $2}')
kubectl config set-credentials tutorialuser --token=$TOKEN
kubectl config set-context sausercontext --cluster=&lt;my-cluster&gt; --user=tutorialuser
kubectl config use-context sausercontext --namespace=default
</code></pre>

<p>Deployment:</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: leeroy-web
  labels:
    app: leeroy-web
spec:
  replicas: 1
  selector:
    matchLabels:
      app: leeroy-web
  template:
    metadata:
      labels:
        app: leeroy-web
    spec:
      containers:
        - name: leeroy-web
          image: gcr.io/appsyouwear/leeroy-web
          ports:
            - containerPort: 8080
</code></pre>

<p>Info:</p>

<pre><code>kubernetes % kubectl -v=8 apply -f deployment.yaml   
I0111 13:57:05.950317   63261 loader.go:359] Config loaded from file /Users/username/.kube/config
Please enter Username:
</code></pre>

Chris G.
<p>Your Kubeconfig file is munged.Either you don't have an user in the contexts section or you don't have an user in the users section.
contexts and users section of your kubeconfig should look like below.</p>

<pre><code>contexts:
- context:
    cluster: kubernetes
    user: tutorialuser
  name: sausercontext


users:
- name: tutorialuser
  user: 
    token: &lt;removed&gt;
</code></pre>
