我可以使用基本认证创建入口点。我遵循了来自kubernetes/ingress-nginx的模板:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-with-auth
annotations:
# type of authentication
nginx.ingress.kubernetes.io/auth-type: basic
# name of the secret that contains the user/password definitions
nginx.ingress.kubernetes.io/auth-secret: basic-auth
# message to display with an appropriate context why the authentication is required
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - foo'
spec:
rules:
- host: foo.bar.com
http:
paths:
- path: /
backend:
serviceName: http-svc
servicePort: 80
它运行良好,但是我需要允许 'OPTIONS' 方法在预检请求中不使用基本身份验证。任何有关如何做到这一点的指针都将非常有用。
Ingress
,以降低非认证流量。 - Crouauth
和noauth
分开,并为两者设置不同的入口。 - Crou