sigs.k8s.io/gateway-api@v1.0.0/examples/standard/http-redirect.yaml (about)

     1  apiVersion: gateway.networking.k8s.io/v1beta1
     2  kind: GatewayClass
     3  metadata:
     4    name: filter-lb
     5  spec:
     6    controllerName: acme.io/gateway-controller
     7    parametersRef:
     8      name: acme-lb
     9      group: acme.io
    10      kind: Parameters
    11  ---
    12  apiVersion: v1
    13  kind: Namespace
    14  metadata:
    15    name: gateway-api-example-ns1
    16  ---
    17  apiVersion: gateway.networking.k8s.io/v1beta1
    18  kind: Gateway
    19  metadata:
    20    name: my-filter-gateway
    21    namespace: gateway-api-example-ns1
    22  spec:
    23    gatewayClassName: filter-lb
    24    listeners:
    25      - name: http
    26        protocol: HTTP
    27        port: 80
    28      - name: https
    29        protocol: HTTPS
    30        port: 443
    31        tls:
    32          certificateRefs:
    33            - kind: Secret
    34              group: ""
    35              name: example-com-cert
    36  ---
    37  apiVersion: gateway.networking.k8s.io/v1beta1
    38  kind: HTTPRoute
    39  metadata:
    40    name: http-filter-1
    41    namespace: gateway-api-example-ns1
    42  spec:
    43    parentRefs:
    44      - name: my-filter-gateway
    45        sectionName: http
    46    hostnames:
    47      - my-filter.example.com
    48    rules:
    49      - filters:
    50          - type: RequestRedirect
    51            requestRedirect:
    52              scheme: https
    53  ---
    54  apiVersion: gateway.networking.k8s.io/v1beta1
    55  kind: HTTPRoute
    56  metadata:
    57    name: http-filter-2
    58    namespace: gateway-api-example-ns1
    59  spec:
    60    parentRefs:
    61      - name: my-filter-gateway
    62        sectionName: https
    63    hostnames:
    64      - my-filter.example.com
    65    rules:
    66      - matches:
    67          - path:
    68              type: PathPrefix
    69              value: /
    70        backendRefs:
    71          - name: my-filter-svc1
    72            weight: 1
    73            port: 80