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

support for username and password prompt #153

Open
WMP opened this issue Aug 16, 2023 · 0 comments
Open

support for username and password prompt #153

WMP opened this issue Aug 16, 2023 · 0 comments

Comments

@WMP
Copy link

WMP commented Aug 16, 2023

Hello, i use rancher with tokens with TTL. When my TTL expire, kubectl trying to execute command (cut from kubeconfig):

users:
- name: "kubdev"
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
        - token
        - --server=kubdev
        - --user=local
        - --auth-provider=activeDirectoryProvider
      command: rancher

With kubectl without kubie it works:

tom@EliteBook-840-G9:~$ kubectl-1.27 --kubeconfig=/home/tom/.kube/configs/kubdev.yaml get all
Enter credentials for activeDirectoryProvider 
 
Enter username: tom
Enter password: 
INFO[0008] Saving config to /home/tom/.rancher/cli2.json 
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.43.0.1    <none>        443/TCP   5d6h
tom@EliteBook-840-G9:~$ kubie ctx kubdev
[kubdev|cattle-system] tom@EliteBook-840-G9:~$ kubectl get all
NAME                                  READY   STATUS    RESTARTS   AGE
pod/rancher-84db8566fb-k96hc          1/1     Running   0          44m
(cut here)
[kubdev|cattle-system] tom@EliteBook-840-G9:~$

But when i havent token, and i try to use kubie ctx with behavior.validate_namespaces: true, kubie dont ask me about login and password:

tom@EliteBook-840-G9:~$ kubie ctx kubdev
Error: Error calling kubectl: Enter credentials for activeDirectoryProvider 
 
Enter username: time="2023-08-16T15:04:58+02:00" level=fatal msg=EOF
Enter credentials for activeDirectoryProvider 
 
Enter username: time="2023-08-16T15:04:58+02:00" level=fatal msg=EOF
Enter credentials for activeDirectoryProvider 
 
Enter username: time="2023-08-16T15:04:58+02:00" level=fatal msg=EOF
Enter credentials for activeDirectoryProvider 
 
Enter username: time="2023-08-16T15:04:58+02:00" level=fatal msg=EOF
Enter credentials for activeDirectoryProvider 
 
Enter username: time="2023-08-16T15:04:58+02:00" level=fatal msg=EOF
Unable to connect to the server: getting credentials: exec: executable rancher failed with exit code 1

tom@EliteBook-840-G9:~$

I need to set behavior.validate_namespaces: false to kubie ctx works:

tom@EliteBook-840-G9:~$ kubie ctx kubdev
[kubdev|cattle-system] tom@EliteBook-840-G9:~$ kubectl get all
Enter credentials for activeDirectoryProvider 
 
Enter username: tom
Enter password: 
INFO[0005] Saving config to /home/tom/.rancher/cli2.json 
NAME                                  READY   STATUS    RESTARTS   AGE
pod/rancher-84db8566fb-k96hc          1/1     Running   0          53m
(cut here)

Could you add forwarding for STDIN from kubectl command?

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