...

Text file src/sigs.k8s.io/gateway-api/conformance/tests/httproute-redirect-port-and-scheme.yaml

Documentation: sigs.k8s.io/gateway-api/conformance/tests

     1apiVersion: gateway.networking.k8s.io/v1
     2kind: Gateway
     3metadata:
     4  name: same-namespace-with-http-listener-on-8080
     5  namespace: gateway-conformance-infra
     6spec:
     7  gatewayClassName: "{GATEWAY_CLASS_NAME}"
     8  listeners:
     9  - name: http
    10    port: 8080
    11    protocol: HTTP
    12    allowedRoutes:
    13      namespaces:
    14        from: Same
    15---
    16apiVersion: gateway.networking.k8s.io/v1
    17kind: HTTPRoute
    18metadata:
    19  name: http-route-for-listener-on-port-80
    20  namespace: gateway-conformance-infra
    21spec:
    22  parentRefs:
    23  - name: same-namespace
    24  rules:
    25  - matches:
    26    - path:
    27        type: PathPrefix
    28        value: /scheme-nil-and-port-nil
    29    filters:
    30    - type: RequestRedirect
    31      requestRedirect:
    32        hostname: example.org
    33  - matches:
    34    - path:
    35        type: PathPrefix
    36        value: /scheme-nil-and-port-80
    37    filters:
    38    - type: RequestRedirect
    39      requestRedirect:
    40        port: 80
    41        hostname: example.org
    42  - matches:
    43    - path:
    44        type: PathPrefix
    45        value: /scheme-nil-and-port-8080
    46    filters:
    47    - type: RequestRedirect
    48      requestRedirect:
    49        port: 8080
    50        hostname: example.org
    51  - matches:
    52    - path:
    53        type: PathPrefix
    54        value: /scheme-https-and-port-nil
    55    filters:
    56    - type: RequestRedirect
    57      requestRedirect:
    58        scheme: "https"
    59        hostname: example.org
    60  - matches:
    61    - path:
    62        type: PathPrefix
    63        value: /scheme-https-and-port-443
    64    filters:
    65    - type: RequestRedirect
    66      requestRedirect:
    67        scheme: "https"
    68        port: 443
    69        hostname: example.org
    70  - matches:
    71    - path:
    72        type: PathPrefix
    73        value: /scheme-https-and-port-8443
    74    filters:
    75    - type: RequestRedirect
    76      requestRedirect:
    77        scheme: "https"
    78        port: 8443
    79        hostname: example.org
    80---
    81apiVersion: gateway.networking.k8s.io/v1
    82kind: HTTPRoute
    83metadata:
    84  name: http-route-for-listener-on-port-8080
    85  namespace: gateway-conformance-infra
    86spec:
    87  parentRefs:
    88  - name: same-namespace-with-http-listener-on-8080
    89  rules:
    90  - matches:
    91    - path:
    92        type: PathPrefix
    93        value: /scheme-nil-and-port-nil
    94    filters:
    95    - type: RequestRedirect
    96      requestRedirect:
    97        hostname: example.org
    98  - matches:
    99    - path:
   100        type: PathPrefix
   101        value: /scheme-nil-and-port-80
   102    filters:
   103    - type: RequestRedirect
   104      requestRedirect:
   105        port: 80
   106        hostname: example.org
   107  - matches:
   108    - path:
   109        type: PathPrefix
   110        value: /scheme-https-and-port-nil
   111    filters:
   112    - type: RequestRedirect
   113      requestRedirect:
   114        scheme: "https"
   115        hostname: example.org
   116---
   117apiVersion: gateway.networking.k8s.io/v1
   118kind: HTTPRoute
   119metadata:
   120  name: http-route-for-listener-on-port-443
   121  namespace: gateway-conformance-infra
   122spec:
   123  parentRefs:
   124  - name: same-namespace-with-https-listener
   125  rules:
   126  - matches:
   127    - path:
   128        type: PathPrefix
   129        value: /scheme-nil-and-port-nil
   130    filters:
   131    - type: RequestRedirect
   132      requestRedirect:
   133        hostname: example.org
   134  - matches:
   135    - path:
   136        type: PathPrefix
   137        value: /scheme-nil-and-port-443
   138    filters:
   139    - type: RequestRedirect
   140      requestRedirect:
   141        port: 443
   142        hostname: example.org
   143  - matches:
   144    - path:
   145        type: PathPrefix
   146        value: /scheme-nil-and-port-8443
   147    filters:
   148    - type: RequestRedirect
   149      requestRedirect:
   150        port: 8443
   151        hostname: example.org
   152  - matches:
   153    - path:
   154        type: PathPrefix
   155        value: /scheme-http-and-port-nil
   156    filters:
   157    - type: RequestRedirect
   158      requestRedirect:
   159        scheme: "http"
   160        hostname: example.org
   161  - matches:
   162    - path:
   163        type: PathPrefix
   164        value: /scheme-http-and-port-80
   165    filters:
   166    - type: RequestRedirect
   167      requestRedirect:
   168        scheme: "http"
   169        port: 80
   170        hostname: example.org
   171  - matches:
   172    - path:
   173        type: PathPrefix
   174        value: /scheme-http-and-port-8080
   175    filters:
   176    - type: RequestRedirect
   177      requestRedirect:
   178        scheme: "http"
   179        port: 8080
   180        hostname: example.org
   181---

View as plain text