小编Arn*_*oll的帖子

如何在每个 nginx-ingress 主机上添加阻止 IP 规则

我搜索了很多,但没有找到解决方案。我想阻止/允许 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)

非常感谢您抽出时间

nginx kubernetes-ingress nginx-ingress

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

kubernetes-ingress ×1

nginx ×1

nginx-ingress ×1