楼主找到原因了吗?我也出现这种问题了
jaeger-operator一直报错,failed to list *v1.Namespace:....
- 已编辑
执行下面这个命令看看,应该是clusterrole
少了 namespace
的 get/list/watch
权限
kubectl get rolebindings,clusterrolebindings --all-namespaces -o custom-columns='KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,SERVICE_ACCOUNTS:subjects[?(@.kind=="ServiceAccount")].name,ROLE_TYPE:roleRef.kind,ROLE:roleRef.name' | uniq | awk '{if ($4 == "jaeger-operator") print $0}' | awk '{ if ($5 == "Role") {print "kubectl get -oyaml "$5"/"$3" -n"$2} else {print "kubectl get -oyaml "$5"/"$3}}' | sh
Nrehearsal 执行这个命令之后还是报错,没有变化…
a759916748a 上面那个命令试查看 jaeger-operator 这个 sa 有哪些权限,当然不会有什么作用了。我的意思是让你看看 jaeger-operator 有没有 namespace 这个资源的读取权限,没有的话需要加上。你把命令的输出贴一下
Nrehearsal 在安装完kubesphere默认没有创建jaeger-operator的clusterrole,创建好问题解决
ok。
因为namespace是cluster-scope的资源。
larry@DESKTOP-S1CV2P0:~$ kubectl api-resources
NAME SHORTNAMES APIVERSION NAMESPACED KIND
bindings v1 true Binding
componentstatuses cs v1 false ComponentStatus
configmaps cm v1 true ConfigMap
endpoints ep v1 true Endpoints
events ev v1 true Event
limitranges limits v1 true LimitRange
namespaces ns v1 false Namespace
zhanglihao
你按照模板更新一下你发的那个issue帖子,尽可能多的提供环境信息。还有论坛里面有很多【日志】相关的帖子,你也搜搜看。
Nrehearsal 我之前开了一个,没人回复才过来的,https://kubesphere.com.cn/forum/d/7599/2
zhanglihao 你好,具体怎么操作能不能贴一下。
zhanglihao 我也遇到这个问题,如何创建clusterrole呢
试一下自己创建一下clusterrole,如下:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: jaeger-operator
rules:
- apiGroups: [""]
resources: [“namespaces”]
verbs: [“get”, “list”, “watch”]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: jaeger-operator
subjects:
- kind: ServiceAccount
name: jaeger-operator
namespace: istio-system
roleRef:
kind: ClusterRole
name: jaeger-operator
apiGroup: rbac.authorization.k8s.io
创建个yaml文件 jaeger-operator.yaml
kind: ClusterRole
metadata:
name: jaeger-operator
rules:
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: jaeger-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: jaeger-operator
subjects:
- kind: ServiceAccount
name: jaeger-operator
namespace: istio-system
然后导入一下
kubectl apply -f jaeger-operator.yaml
hongzhouziK零S
这个报错是上游 jaeger-operator 中的小问题,在后面版本也修复了,ks 中在安装使用时默认关闭了 rbac.clusterRole 配置项,ks 中这种用法也不影响其正常使用。