zoukankan      html  css  js  c++  java
  • kubernetes logs 命令错误记录

    [root@k8s-master ~]# kubectl logs nginx-dbddb74b8-j9rdf
    error: You must be logged in to the server (the server has asked for the client to provide credentials ( pods/log nginx-dbddb74b8-j9rdf))
    解决办法修改:/opt/kubernetes/cfg/kubelet.config添加
    authentication:
      anonymous:
        enabled: true
     [root@k8s-node1 cfg]# cat kubelet.config 
    kind: KubeletConfiguration
    apiVersion: kubelet.config.k8s.io/v1beta1
    address: 192.168.1.120
    port: 10250
    cgroupDriver: cgroupfs
    clusterDNS:
    - 10.0.0.2 
    clusterDomain: cluster.local.
    failSwapOn: false
    authentication:
      anonymous:
        enabled: true
    
    [root@k8s-master ~]# kubectl logs nginx-dbddb74b8-j9rdf
    Error from server (Forbidden): Forbidden (user=system:anonymous, verb=get, resource=nodes, subresource=proxy) ( pods/log nginx-dbddb74b8-j9rdf)
    解决办法:将system:anonymous绑定到cluster-admin角色中 起个cluster-system:anonymous名字
    [root@k8s-master ~]# kubectl create clusterrolebinding cluster-system:anonymous --clusterrole=cluster-admin --user=system:anonymous
    clusterrolebinding.rbac.authorization.k8s.io/cluster-system:anonymous created
    

      

  • 相关阅读:
    postfix遇到的问题
    SElinux以及防火墙的关闭
    centos查看系统信息
    WINDOWS访问SAMBA提示没有权限
    常用命令
    口才
    【李敖的管理经】
    随笔
    查询MX记录
    bash: ifconfig: command not found
  • 原文地址:https://www.cnblogs.com/caonw/p/11638408.html
Copyright © 2011-2022 走看看