HTTPD pod上的kubernetes身份验证问题



在尝试访问HTTPD pod的web时不断得到这个,我缺少什么权限

{
"kind": "Status",
"apiVersion": "v1",
"metadata": {

},
"status": "Failure",
"message": "pods "pod-httpd" is forbidden: User "system:anonymous" cannot get resource "pods" in API group "" in the namespace "default"",
"reason": "Forbidden",
"details": {
"name": "pod-httpd",
"kind": "pods"
},
"code": 403
}

错误是明确的User "system:anonymous"意味着k8s将您识别为anonymous用户,这就是为什么它给出禁止访问所需资源的原因。
因此,当您执行curl https://<ip>:<port>/<endpoint>时,您正在使用TLS进行通信。在这种类型的通信中,您需要提供您的CA(证书颁发机构,谁签署了您的证书)证书,以及您的证书和密钥到curl,如下所示,因为在TLS服务器-客户机中需要进行验证。

curl https://<ip>:<port>/<endpoint> --key <your_key> --cert <your_cert>  --cacert <ca_cert>

N。B:这里you表示客户端

最新更新