• k8s-(创建一个pods测试)需要授权


    [root@linux-node1 opt]#   kubectl run nignx --image=nginx --port=80 --replicas=3
    [root@linux-node1 opt]# kubectl get pods -o wide
    NAME                    READY   STATUS    RESTARTS   AGE   IP            NODE            NOMINATED NODE
    nignx-69789fbff-22vbd   1/1     Running   0          33m   172.17.84.3   192.168.56.12   <none>
    nignx-69789fbff-glw9m   1/1     Running   0          33m   172.17.75.2   192.168.56.13   <none>
    nignx-69789fbff-nj25r   1/1     Running   0          33m   172.17.84.2   192.168.56.12   <none>
    #会有一个授权的问题
    [root@linux-node1 opt]# kubectl logs pods/nignx-69789fbff-22vbd
    Error from server (Forbidden): Forbidden (user=system:anonymous, verb=get, resource=nodes, subresource=proxy) ( pods/log nignx-69789fbff-22vbd)
    #授权
    [root@linux-node1 opt]#  kubectl create clusterrolebinding cluster-system-anonymous --clusterrole=cluster-admin --user=system:anonymous
    clusterrolebinding.rbac.authorization.k8s.io/cluster-system-anonymous created
    #再次查看
    [root@linux-node1 opt]# kubectl logs pods/nignx-69789fbff-22vbd
    172.17.84.1 - - [17/Feb/2020:17:46:28 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.29.0" "-"
    

      

  • 相关阅读:
    ss
    Linux vmstat命令实战详解
    【好书摘要】性能优化中CPU、内存、磁盘IO、网络性能的依赖
    mysql 数据库授权(给某个用户授权某个数据库)
    windows下mysql安装包安装
    053(五十五)
    053(五十四)
    053(五十三)
    053(五十二)
    053(五十一)
  • 原文地址:https://www.cnblogs.com/zhaojingyu/p/12322801.html
Copyright © 2020-2023  润新知