Describe the bug
Rpc service discovery is succussful in go-zero version 1.8.3, 1.9.3, but failed in version 1.9.0, 1.10.1. I didn't try all go-zero versions, but the varying behaviors across different versions are confusing, and there is no documentation explaining exactly how to perform service discovery for RPC services in a k8s environment.
To Reproduce
Steps to reproduce the behavior, if applicable:
-
The code is
import (
"github.com/zeromicro/go-zero/zrpc"
)
c := zrpc.RpcClientConf{
NonBlock: true,
Target: "k8s://dev/demo-rpc:8080",
}
dev is k8s namespace, demo-rpc is service name, 8080 is service port.
-
The error is
rpc dial: k8s://dev/demo-rpc:8080, error: failed to exit idle mode: failed to start resolver: endpointslices.discovery.k8s.io is forbidden: User "system:serviceaccount:dev:endpoints-reader" cannot list resource "endpointslices" in API group "discovery.k8s.io" in the namespace "dev", make sure rpc service "k8s://dev/demo-rpc:8080" is already started
Expected behavior
- In all subsequent versions, this configuration syntax is supported.
- Improve the documentation to clearly explain how to perform RPC service discovery in a k8s environment.
Environments (please complete the following information):
- OS: Linux
- go-zero version 1.10.1
- goctl version 1.10.1
Describe the bug
Rpc service discovery is succussful in go-zero version 1.8.3, 1.9.3, but failed in version 1.9.0, 1.10.1. I didn't try all go-zero versions, but the varying behaviors across different versions are confusing, and there is no documentation explaining exactly how to perform service discovery for RPC services in a k8s environment.
To Reproduce
Steps to reproduce the behavior, if applicable:
The code is
devis k8s namespace,demo-rpcis service name,8080is service port.The error is
Expected behavior
Environments (please complete the following information):