Is pathPrefix of HttpScaledObject work for multiple services? #832
Unanswered
ianuragsingh
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have one host and 2 services with different path. I also created two ingress and corresponding two HttpScaledObject with same pathPrefix of ingress.
********* Application -1 ***************
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: demo-1-ingress
labels:
demo-1-ingress
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
http:
paths:
pathType: Prefix
backend:
service:
name: demo-1-proxy-svc
port:
number: 8080
kind: HTTPScaledObject
apiVersion: http.keda.sh/v1alpha1
metadata:
name: demo-1-http-scaledobject
spec:
hosts:
- mycompany.com
pathPrefix: /demo-1
targetPendingRequests: 1
scaledownPeriod: 30
scaleTargetRef:
deployment: demo-1
service: demo-1-svc
port: 8080
replicas:
min: 0
max: 3
Kind: Service
apiVersion: v1
metadata:
name: demo-1-proxy-svc
spec:
type: ExternalName
externalName: keda-add-ons-http-interceptor-proxy.keda.svc.cluster.local
****************** Application 2 ******************
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: demo-2-ingress
labels:
demo-2-ingress
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
http:
paths:
pathType: Prefix
backend:
service:
name: demo-2-proxy-svc
port:
number: 8080
kind: HTTPScaledObject
apiVersion: http.keda.sh/v1alpha1
metadata:
name: demo-2-http-scaledobject
spec:
hosts:
- mycompany.com
pathPrefix: /demo-2
targetPendingRequests: 1
scaledownPeriod: 30
scaleTargetRef:
deployment: demo-2
service: demo-2-svc
port: 8080
replicas:
min: 0
max: 3
Kind: Service
apiVersion: v1
metadata:
name: demo-2-proxy-svc
spec:
type: ExternalName
externalName: keda-add-ons-http-interceptor-proxy.keda.svc.cluster.local
Let's consider both services are deployed in same namespace (tried different namespace too). is above scenario work?
I am calling service 2 but request was forwarded to service 1.
Beta Was this translation helpful? Give feedback.
All reactions