vicaya commented on issue #441:
URL:
https://github.com/apache/apisix-ingress-controller/issues/441#issuecomment-998422905
IMO, it's still cleaner to do subsets in route, as subsets are fundamentally
part of routing policies that could be dynamically depend on the route match.
One of the common use cases is to expose endpoints in statefulset pods via
headless service, where each pod already has a distinct pod-name label. It'd be
great if we could expose these endpoints concisely with a more expressive label
selection for individual pods within a (headless) service. e.g.:
```yaml
apiVersion: apisix.apache.org/v2beta1
kind: ApisixRoute
metadata:
name: foo-route
spec:
http:
- name: route1
match:
exprs:
- name: context
subject:
scope: Path
op: RegexMatch
value: "^/prefix-([^/]+).*"
backends:
- serviceName: foo-service
servicePort: 9080
labels:
statefulset.kubernetes.io/pod-name: "${.match.context.value.1}"
```
Otherwise, we'd need to dynamically maintain individual routes when the
statefulset resizes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]