...
1# Copyright 2020 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15apiVersion: compute.cnrm.cloud.google.com/v1beta1
16kind: ComputeURLMap
17metadata:
18 name: computeurlmap-sample
19spec:
20 description: "Regional ComputeURLMap L7 Ilb Path"
21 location: us-central1
22 defaultService:
23 backendServiceRef:
24 name: computeurlmap-dep
25 hostRule:
26 - hosts:
27 - "mysite.com"
28 pathMatcher: "allpaths"
29 pathMatcher:
30 - name: "allpaths"
31 defaultService:
32 backendServiceRef:
33 name: computeurlmap-dep
34 pathRule:
35 - paths:
36 - "/home"
37 routeAction:
38 corsPolicy:
39 allowCredentials: true
40 allowHeaders:
41 - "Allowed content"
42 allowMethods:
43 - "GET"
44 allowOrigins:
45 - "Allowed origin"
46 exposeHeaders:
47 - "Exposed header"
48 maxAge: 30
49 disabled: false
50 faultInjectionPolicy:
51 abort:
52 httpStatus: 234
53 percentage: 5.6
54 delay:
55 fixedDelay:
56 seconds: "0"
57 nanos: 50000
58 percentage: 7.8
59 requestMirrorPolicy:
60 backendServiceRef:
61 name: computeurlmap-dep
62 retryPolicy:
63 numRetries: 4
64 retryTimeout:
65 seconds: "30"
66 retryConditions:
67 - "5xx"
68 - "deadline-exceeded"
69 timeout:
70 seconds: "20"
71 nanos: 750000000
72 urlRewrite:
73 hostRewrite: "A replacement header"
74 pathPrefixRewrite: "A replacement path"
75 weightedBackendServices:
76 - backendServiceRef:
77 name: computeurlmap-dep
78 weight: 400
79 headerAction:
80 requestHeadersToRemove:
81 - "RemoveMe"
82 requestHeadersToAdd:
83 - headerName: "AddMe"
84 headerValue: "MyValue"
85 replace: true
86 responseHeadersToRemove:
87 - "RemoveMe"
88 responseHeadersToAdd:
89 - headerName: "AddMe"
90 headerValue: "MyValue"
91 replace: false
92 test:
93 - service:
94 backendServiceRef:
95 name: computeurlmap-dep
96 host: "hi.com"
97 path: "/home"
View as plain text