harbor icon indicating copy to clipboard operation
harbor copied to clipboard

Add a mode for accessing redis cluster

Open lengrongfu opened this issue 3 years ago • 5 comments

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 cluster available, we need to use the existing redis 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 cluster to the interface of Cache.

Describe the development plan you've considered

lengrongfu avatar Aug 07 '22 13:08 lengrongfu

/assign

lengrongfu avatar Aug 07 '22 13:08 lengrongfu

I have developed and submitted this function, please review. @wy65701436 @MinerYang

lengrongfu avatar Aug 08 '22 02:08 lengrongfu

@zyyw @MinerYang Have any questions about this issue?

lengrongfu avatar Aug 09 '22 01:08 lengrongfu

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!

MinerYang avatar Aug 09 '22 07:08 MinerYang

Your question is very good, this really needs to be discussed in the community, I will first express my opinion.

  1. For the components inside Harbor, the ability to access the redis cluster can be uniformly provided.
  2. 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.

lengrongfu avatar Aug 09 '22 07:08 lengrongfu

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?

MinerYang avatar Aug 23 '22 02:08 MinerYang

Yes, this can be fully discussed in the community first.

lengrongfu avatar Aug 23 '22 03:08 lengrongfu

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.

MinerYang avatar Aug 24 '22 02:08 MinerYang