![](/img/trans.png)
[英]How do I avoid `ErrImagePull` when using Kubernetes file, local docker image and `kubectl apply`?
[英]How do I authenticate with Kubernetes kubectl using a username and password?
我有一個用戶名和密碼,我如何用它們驗證kubectl?
我運行哪個命令?
我讀過: https : //kubernetes.io/docs/reference/access-authn-authz/authorization/和https://kubernetes.io/docs/reference/access-authn-authz/authentication/雖然不能在這種情況下找到任何相關信息。
kubectl config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif
https://kubernetes-v1-4.github.io/docs/user-guide/kubectl/kubectl_config_set-credentials/
以上似乎不起作用: kubectl get pods
Error from server (Forbidden): pods is forbidden: User "client" cannot list pods in the namespace "default": Unknown user "client"kubectl get pods
Error from server (Forbidden): pods is forbidden: User "client" cannot list pods in the namespace "default": Unknown user "client"
您應該為身份驗證用戶設置一個組。
例:
密碼1,用戶1,userid1,系統:大師
密碼2,用戶2 userid2
參考:
“在系統中使用憑證:masters group,默認綁定綁定到cluster-admin超級用戶角色。” https://kubernetes.io/docs/reference/access-authn-authz/rbac/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.