Repository: milvus-io/milvus

Issue #28895: [Feature]: It is necessary to add authentication to external etcd
Created: 2023-12-01T06:51:06Z
Is there an existing issue for this?

 I have searched the existing issues

Is your feature request related to a problem? Please describe.
I deployed milvus used helm(cpu), when I enable external etcd rbac auth, milvus cannot connect it cause service configuration only has two parameters :externalEtcd.enabled and  externalEtcd.endpoints.
Describe the solution you'd like.
configuration need add some parameters like this.
###################################
# External etcd
# - these configs are only used when `externalEtcd.enabled` is true
###################################
externalEtcd:
  enabled: true
  endpoints:
    # host or ip e.g. http://172.20.148.99:2379
    - http://etcd.etcd.svc.cluster.local:2379
  # -- user for external etcd.
  user: root
  # -- if externalEtcd.existingSecret is empty, externalEtcd.password is the passsword for external etcd.
  password: "your-etcd-password"
  # -- externalEtcd.existingSecret is the name of secret containing the external etcd password
  existingSecret: ""
  # -- externalEtcd.secretPasswordKey Key inside the secret containing the external etcd password
  secretPasswordKey: "etcd-root-password"
Describe an alternate solution.
used milvus internal etcd or disabled external etcd auth, milvus will work well now.
Anything else? (Additional Context)
No response

Duplicate issue #29718: [Bug]: 是不是内置ETCD和外部ETCD都无法启用auth呀，我试了外部的也一样连不上
Created: 2024-01-05T08:01:24Z
Is there an existing issue for this?

 I have searched the existing issues

Environment
- Milvus version:2.3.2
- Deployment mode(standalone or cluster): cluster-helm-deploy(cpu)
- MQ type(rocksmq, pulsar or kafka):    pulsar
- SDK version(e.g. pymilvus v2.0.0rc2):
- OS(Ubuntu or CentOS): centos
- CPU/Memory: 512G
- GPU: 
- Others:
Current Behavior
我用外部etcd配置：
externalEtcd:
  enabled: true
  ## the endpoints of the external etcd
  ##
  endpoints:
    - 10.140.177.73:2379
  user: "root"
  password: "Jxlz2020."

和helm内置配置：
auth:
  ## Role-based access control parameters
  ## ref: https://etcd.io/docs/current/op-guide/authentication/
  ##
  rbac:
    ## @param auth.rbac.enabled Switch to enable RBAC authentication
    ##
    enabled: true
    ## @param auth.rbac.allowNoneAuthentication Allow to use etcd without configuring RBAC authentication
    ##
    allowNoneAuthentication: true
    ## @param auth.rbac.rootPassword Root user password. The root user is always `root`
    ##
    rootPassword: "Jxlz2020."
    userName: "root"
    ## @param auth.rbac.existingSecret Name of the existing secret containing credentials for the root user
    ##
    existingSecret: ""
  ## TLS authentication for client-to-server communications
  ## ref: https://etcd.io/docs/current/op-guide/security/

其他微服务都连不上etcd，报错：
[2024/01/05 07:43:23.845 +00:00] [ERROR] [sessionutil/session_util.go:255] ["retry func failed"] ["retry time"=44] [error="etcdserver: user name is empty"] [stack="github.com/milvus-io/milvus/internal/util/sessionutil.NewSession\n\t/go/src/github.com/milvus-io/milvus/internal/util/sessionutil/session_util.go:255\ngithub.com/milvus-io/milvus/internal/distributed/rootcoord/client.NewClient\n\t/go/src/github.com/milvus-io/milvus/internal/distributed/rootcoord/client/client.go:57\ngithub.com/milvus-io/milvus/internal/distributed/datanode.NewServer.func1\n\t/go/src/github.com/milvus-io/milvus/internal/distributed/datanode/service.go:86\ngithub.com/milvus-io/milvus/internal/distributed/datanode.(*Server).init\n\t/go/src/github.com/milvus-io/milvus/internal/distributed/datanode/service.go:256\ngithub.com/milvus-io/milvus/internal/distributed/datanode.(*Server).Run\n\t/go/src/github.com/milvus-io/milvus/internal/distributed/datanode/service.go:188\ngithub.com/milvus-io/milvus/cmd/components.(*DataNode).Run\n\t/go/src/github.com/milvus-io/milvus/cmd/components/data_node.go:53\ngithub.com/milvus-io/milvus/cmd/roles.runComponent[...].func1\n\t/go/src/github.com/milvus-io/milvus/cmd/roles/roles.go:113"]
[2024/01/05 07:43:26.846 +00:00] [DEBUG] [sessionutil/session_util.go:246] ["Session try to connect to etcd"]
{"level":"warn","ts":"2024-01-05T07:43:26.847Z","logger":"etcd-client","caller":"v3@v3.5.5/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc0002a56c0/10.140.177.73:2379","attempt":0,"error":"rpc error: code = InvalidArgument desc = etcdserver: user name is empty"}

Expected Behavior
在helm的milvus.yaml配置完用户名密码之后可以启用etcd auth
Steps To Reproduce
No response
Milvus Log
[2024/01/05 07:43:23.845 +00:00] [ERROR] [sessionutil/session_util.go:255] ["retry func failed"] ["retry time"=44] [error="etcdserver: user name is empty"] [stack="github.com/milvus-io/milvus/internal/util/sessionutil.NewSession\n\t/go/src/github.com/milvus-io/milvus/internal/util/sessionutil/session_util.go:255\ngithub.com/milvus-io/milvus/internal/distributed/rootcoord/client.NewClient\n\t/go/src/github.com/milvus-io/milvus/internal/distributed/rootcoord/client/client.go:57\ngithub.com/milvus-io/milvus/internal/distributed/datanode.NewServer.func1\n\t/go/src/github.com/milvus-io/milvus/internal/distributed/datanode/service.go:86\ngithub.com/milvus-io/milvus/internal/distributed/datanode.(*Server).init\n\t/go/src/github.com/milvus-io/milvus/internal/distributed/datanode/service.go:256\ngithub.com/milvus-io/milvus/internal/distributed/datanode.(*Server).Run\n\t/go/src/github.com/milvus-io/milvus/internal/distributed/datanode/service.go:188\ngithub.com/milvus-io/milvus/cmd/components.(*DataNode).Run\n\t/go/src/github.com/milvus-io/milvus/cmd/components/data_node.go:53\ngithub.com/milvus-io/milvus/cmd/roles.runComponent[...].func1\n\t/go/src/github.com/milvus-io/milvus/cmd/roles/roles.go:113"]
[2024/01/05 07:43:26.846 +00:00] [DEBUG] [sessionutil/session_util.go:246] ["Session try to connect to etcd"]
{"level":"warn","ts":"2024-01-05T07:43:26.847Z","logger":"etcd-client","caller":"v3@v3.5.5/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc0002a56c0/10.140.177.73:2379","attempt":0,"error":"rpc error: code = InvalidArgument desc = etcdserver: user name is empty"}


Anything else?
No response

Closing comment (2024-01-06T09:45:22Z): related to #28895