【发布时间】:2020-03-03 16:01:20
【问题描述】:
我收到此错误:forbidden: User "system:anonymous" cannot get path "/openapi/v2": No policy matched.
这里似乎发生了:
I0302 15:57:33.593662 44 round_trippers.go:423] curl -k -v -XGET -H "Accept: application/com.github.proto-openapi.spec.v2@v1.0+protobuf" -H "User-Agent: kubectl/v1.17.3 (linux/amd64) kubernetes/06ad960" -H "Authorization: Basic YWRxxxxxxxxxxxxxxxxxxxxxx2lm" 'https://<IP>/openapi/v2?timeout=32s'
I0302 15:57:33.767657 44 round_trippers.go:443] GET https://<IP>/openapi/v2?timeout=32s 403 Forbidden in 173 milliseconds
据我了解,应该使用的用户是通过 kubectl 应用此 yaml 创建的:
apiVersion: v1
kind: Namespace
metadata:
name: gitlab-managed-apps
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: gitlab-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: gitlab-admin
namespace: gitlab-managed-apps
GCP 项目中还有一个具有Kubernetes Engine Developer 权限的服务帐户。
因此,我不知道为什么仍然没有用户定义/关联。 我希望你能帮助我!
【问题讨论】:
标签: kubernetes google-cloud-platform gitlab google-kubernetes-engine gitlab-ci