0

我正在创建一个创建 route53 记录集的 VirtualService。如果主机已经存在,有没有办法让 VirtualService 创建失败(我的意思是如果记录集已经存在于路由 53 中,则创建 VS 失败)

显示我创建 VS 方式的示例代码

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: subdomaintest2-internal-vs
  annotations:
    external-dns.alpha.kubernetes.io/target: test-istio-ingress-us-west-2.example.goto.com
    external-dns.alpha.kubernetes.io/alias: "true"
    external-dns.alpha.kubernetes.io/set-identifier: US-WEST-2 
    external-dns.alpha.kubernetes.io/aws-weight: "100"
spec:
  hosts:
  - test-samesubdomain.example.com
  gateways:
  - istio-system/istio-global-test-internal
  http:
    - name: "subdomaintest2-routes"
      headers:
        request:
          set:
            x-forwarded-prefix: /test
      match:
        - uri:
            prefix: /test/
      rewrite:
        uri: /
      route:
        - destination:
            host: subdomaintest2
            subset: subdomaintest2
            port:
              number: 80
4

0 回答 0