Add a mode for accessing redis cluster
Is your feature request related to a problem? Please describe.
- When I deploy a Harbor cluster, I will use redis, but our production environment already has
Redis clusteravailable, we need to use the existingredis cluster,
Describe the solution you'd like
- Configurable access to redis cluster
Describe the main design/architecture of your solution
- Add the connection and use implementation of
redis clusterto the interface of Cache.
Describe the development plan you've considered
- Refer to the example here for implementation:https://redis.uptrace.dev/guide/go-redis-cluster.html
/assign
I have developed and submitted this function, please review. @wy65701436 @MinerYang
@zyyw @MinerYang Have any questions about this issue?
Hi @lengrongfu ,
Thanks @lengrongfu. But there would be limitations for harbor to use redis cluster as you describe above since we need to guarantee all of the components like jobservice, including 3-rd party components like trivy to be compatible with this mode, otherwise it would affect harbor to use Redis service. And unfortunately it have not been supported fundamentally by some of the every essential components.
We might not support this mode currently but would like to here more voice from our community and have a discussion with us!
Your question is very good, this really needs to be discussed in the community, I will first express my opinion.
- For the components inside Harbor, the ability to access the redis cluster can be uniformly provided.
- As you described trivy these are 3rd components, I think these components are optional; then we can describe clearly in the documentation under what circumstances redis cluster can be used.
The above descriptions only represent personal opinions, and the final conclusion is still subject to the community.
Thanks.
Hi @lengrongfu ,
First of all, even we discard the 3-rd party for this Redis cluster mode, here's still some limitations on harbor upstream dependency. For example, we depends on github.com/distribution/distribution and it needs to support the redis cluster as well. And the jobservice also need to connect the redis depends on this module https://github.com/gocraft/work which are using a obsoletes version of redigo modulegithub.com/gomodule/redigo v2.0.0+incompatible
And we don't think to set some of the components as optional for this mode is a best practice cause Trivy scanner is an important parts with a lot of usage in the community and the downstream consumption. Given to this situation, we do not plan to add the redis cluster mode in this release. Btw, maybe here's some workaround you can set up a cluster to use redis with a loadbalancer. I 've noticed that you open a discussion here https://github.com/goharbor/harbor/discussions/17400. Appreciate and how about we keep tracking the feature in this discussion and close this issue and releated PR for now?
Yes, this can be fully discussed in the community first.
Since it would open for discussion here https://github.com/goharbor/harbor/discussions/17400, I will close this issue and the related PR https://github.com/goharbor/harbor/pull/17344 for now.