How to set password to a redis ServiceEntry

hi all

I register my redis-server as a ServiceEntry

kind: ServiceEntry
apiVersion: networking.istio.io/v1alpha3
metadata:
  name: istio-demo-redis
  namespace: default
spec:
  hosts:
    - istio.redis.db
  addresses:
    - 192.168.1.2
  ports:
    - name: redis
      number: 6379
      protocol: REDIS
  location: MESH_EXTERNAL
  resolution: STATIC
  endpoints:
    - address: 1.1.1.1
  exportTo: ~
  subjectAltNames: ~

I am enable the redis protocol support on pliot
when i use client to connect the server

	client := redis.NewClient(&redis.Options{
		Addr:     "192.168.1.2:6379",
		Password: "istioRedisTest123", // no password set
		DB:       0,                   // use default DB
	})
	pong, err := client.Ping().Result() //

return error ERR Client sent AUTH, but no password is set

I am really set the password in redis.Options and the code works well when I use tcp proxy.
I checked the envoyproxy docs,it set the password in envoy config,how to set it in istio? or why cant auth with redis options

1 Like

Try to change spec.ports.protocol from REDIS to TCP

I know tcp proxy can fix it,but it not a good solution to the problem。

+Zhonghu Xu
I think Redis Filter pilot builds, doesn’t add an option to add password(https://github.com/istio/istio/blob/bdeb4f90829f20e4c21c3441a77d7931326f03f2/pilot/pkg/networking/core/v1alpha3/networkfilter.go#L268:6).
Probably need a config to do the same…
Can you please open a bug for the same?


I open a issue for the case