apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: cube-route
  namespace: pchub
spec:
  http:
    - name: cube-route
      match:
        hosts:
          - pch-cube.pingcap.net
        paths:
          - /*
      backends:
        - serviceName: cube-api
          servicePort: 4000
          weight: 10
      plugins:
        - name: redirect
          enable: true
          config:
            http_to_https: true
        - name: cors
          enable: true