Description
Is your feature request related to a problem? Please describe.
As we can see from the Cortex architecture https://cortexmetrics.io/docs/architecture/, Ruler queries ingesters (and store gateways) to get data for rules evaluation. This works fine currently but it hard to reuse some features supported in query frontend like vertical query sharding to make rule evaluation faster.
By switching Ruler to query Query Frontend, it simplifies the current architecture to make Query Frontend the entrypoint for both external and internal queries. Ruler components can use less resources as it doesn't need to embed a querier anymore.
Describe the solution you'd like
This feature should be behind a feature flag. If the flag is specified, Ruler will query Query Frontend instead. The implementation should be similar to how Thanos does https://github.com/thanos-io/thanos/blob/main/cmd/thanos/rule.go#L795, by having a custom query func and send HTTP requests to query frontend.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.