我已使用头盔在eks集群上安装了最新版本的Nginx入口控制器 这是我的入口
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: prometheus
namespace: monitoring
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: basic-auth
nginx.ingress.kubernetes.io/auth-realm: "Authentication Required"
spec:
rules:
- host: ***
http:
paths:
- path: /
backend:
serviceName: prometheus-operated
servicePort: 9090
这是秘密
apiVersion: v1
data:
auth:
kind: Secret
metadata:
name: basic-auth
namespace: monitoring
type: Opaque
我已经用htpasswd
创建了秘密,并遵循了文档。当我尝试使用浏览器或curl调用主机时,我没有收到auth错误。看起来Nginx没有拾取注释。
有人会知道我在做什么错吗?