AWS ALB入口资源路径定义



我正在尝试为已经配置了nginx ingress的现有集群配置aws-alb ingress。这是我在nginxingress中使用的资源文件,它运行良好。

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: "stage-ingress-1"
namespace: "teststage"
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/backend-protocol: HTTP
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
alb.ingress.kubernetes.io/certificate-arn:  <cert_arn>
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/scheme: internet-facing
labels:
app: test-ingress
spec:
rules:
- http:
paths:
- path: /(.*)
backend:
serviceName: ssl-redirect
servicePort: use-annotation
- path: /(.*)
backend:
serviceName: "test-service"
servicePort: 80
host: test.abc.com

然而,我得到一个错误说

"msg"="Reconciler error" "error"="failed to reconcile listeners due to failed to reconcile rules due to failed modifying rule 2 on aws alb due to ValidationError: Condition value '/(.*)' contains a character that is not valid

我知道这与指定的路径有关,但我不知道如何配置。这是包含我所有数据的路径。

它不是正则表达式。它比那简单得多你想要的。

spec:
rules:
- http:
paths:
- path: /*
backend:
serviceName: ssl-redirect
servicePort: use-annotation
- path: /*
backend:
serviceName: "test-service"
servicePort: 80
host: test.abc.com

相关内容

  • 没有找到相关文章

最新更新