我搜索了很多,但没有找到解决方案。我想阻止/允许 ip 进入 nginx-ingress 中的每个主机定义,而不是每个位置。
这是 ingress.yaml:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-nginx
annotations:
kubernetes.io/ingress.class: "nginx"
spec:
rules:
- host: test1.test.com
#Blocking rules here, only affecting test1.test.com domain
http:
paths:
- path: /
backend:
serviceName: wordpressA
servicePort: 80
- host: test2.test.com
#Blocking rules here, only affecting test2.test.com domain
http:
paths:
- path: /
backend:
serviceName: wordpressB
servicePort: 80
Run Code Online (Sandbox Code Playgroud)
非常感谢您抽出时间