问题
How do I make an ingress with basic auth on every path of the domain except on one. My ingress looks like this:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: frontend-ingress
namespace: dev
labels:
app: x
annotations:
kubernetes.io/ingress.global-static-ip-name: x.x.x
ingress.kubernetes.io/auth-secret: "basic-auth"
ingress.kubernetes.io/auth-type: "basic"
spec:
rules:
- host: x.x.x
http:
paths:
- path: /
backend:
serviceName: hello
servicePort: 80
What i wanna make is to have basic auth on every path except on /successfull_login
, when I hit x.x.x/successfull_login
not to require credentials.
I tried making a new Ingress just with that path that doesn't use basic auth but still it require basic auth.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-successfull-login
namespace: dev
labels:
app: x
annotations:
kubernetes.io/ingress.global-static-ip-name: x.x.x
spec:
rules:
- host: x.x.x
http:
paths:
- path: /successfull_login
backend:
serviceName: hello
servicePort: 80
How do i do it?
来源:https://stackoverflow.com/questions/64858553/how-do-i-use-ingress-with-basic-auth-but-only-for-certain-routes