-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path01_FabricGatewayCRD.yaml
executable file
·273 lines (273 loc) · 13 KB
/
01_FabricGatewayCRD.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: "{{{ CRD_PLURAL }}}.zalando.org"
spec:
group: zalando.org
version: v1
names:
kind: "{{{ CRD_KIND }}}"
singular: "{{{ CRD_SINGULAR }}}"
plural: "{{{ CRD_PLURAL }}}"
shortNames:
- "{{{ CRD_SHORT_NAME }}}"
scope: Namespaced
additionalPrinterColumns:
- name: Ingress_Count
type: integer
description: The number of ingressii owned by this gateway
JSONPath: .status.num_owned_ingress
subresources:
status: {}
validation:
openAPIV3Schema:
type: object
required:
- spec
properties:
spec:
required:
- paths
properties:
x-fabric-service:
type: array
items:
type: object
required:
- host
- serviceName
properties:
host:
type: string
description: This is the pulic host name for the service
example: app-id.cluster-name.zalan.do
serviceName:
type: string
description: This is the name of the K8s service which Skipper should target when forwarding requests
example: app-id-service
servicePort:
type: string
description: The port to use for the service. Must be the name of a named port defined in your k8s service. Defaults to "http". See https://kubernetes.io/docs/concepts/services-networking/service/#multi-port-services
example: http
pattern: '^[a-z][-a-z0-9]*[^-]$'
x-external-service-provider:
type: object
required:
- stackSetName
- hosts
properties:
stackSetName:
type: string
hosts:
type: array
minItems: 1
items:
type: string
x-fabric-admins:
type: array
minItems: 0
items:
type: string
description: |-
UID of a user which will have open access to the full API. This will exclude this uid from
any rate limits or authorization
example: jbloggs
x-fabric-whitelist:
type: array
items:
type: string
description: |-
UID of a service which will be allowed access to the API if it matches all other authorization
requirements. If there is a whitelist present, then ONLY services which are referenced in the whitelist
will be able to access the API even if they match all other authorization requirements. If the whitelist
is empty, then no service tokens can access via the gateway
example: stups_some-service-name
x-fabric-cors-support:
type: object
description: |
This section configures Cross-Origin Resource Sharing (CORS) support in the gateway.
When this is configured:
1. An HTTP OPTIONS endpoint will be created for each path, fulfilling the preflight requirement for CORS.
2. Each route defined in this gateway will return the `access-control-allow-origin` header for origins configured here.
required:
- allowedOrigins
- allowedHeaders
properties:
allowedOrigins:
type: array
minItems: 1
description: |
List of origins that should be allowed to access your API. Defaults to an empty list.
items:
type: string
description: |
A hostname that should be allowed access your API. "*" is not allowed.
example: foo.example.com
allowedHeaders:
type: array
minItems: 1
description: |
List of headers which are allowed to be used as part of CORS requests. Typically you should list Authorization, Content-Type, and X-Flow-Id at a minimum.
items:
type: string
description: |
A header which an XHR request should be allowed to use.
example: Authorization
x-fabric-employee-access:
type: object
description: |
The `user-list` should only be populated if `type` is set to `allow_list`. If `type` is not
present, it will be defaulted to `scoped_access`
properties:
user-list:
type: array
items:
type: string
description: |-
UID of a user who should bypass scope checks, since user tokens can't have scopes.
type:
type: string
enum:
- allow_list
- allow_all
- deny_all
description: |-
If `allow_list` is selected, then the `user-list` property must be populated, otherwise it
is ignored. If allow_all is selected, any token which is Employee realm will be able to
access the endpoint in spite of any scope restrictions. If `deny_all` is selected, then any
employee realm token will be rejected even if there are no scope restrictions beyond `uid`.
If no employee access configuration is configured then employee access will work as per normal scope
rules; i.e. employees will have access to routes which aren't scope protected. This can be overridden
on a per route basis.
x-fabric-compression-support:
type: object
description: |
Enable compression on response payloads. The actual compression work will be delegated to a Skipper filter
(See https://opensource.zalando.com/skipper/reference/filters/#compress). If this object is not present,
then no compression of the response payload will happen in Skipper. If present the response payload will
be conditionally compressed based off of the requirements outlined in the Skipper filter `compress`
documentation.
required:
- compressionFactor
- encoding
properties:
compressionFactor:
type: integer
description: |
Set the compression level where 0 means no-compression, 1 means best-speed and 9 means
best-compression
minimum: 0
maximum: 9
encoding:
type: string
description: |
Specify the encoding to compress. This must match the Content-Type of the response payload for
compression to happen
paths:
type: object
minProperties: 1
description: |-
Each key represents a path in the API. A single star matches a value between two slashes in a HTTP path
example: /api/resource, /api/resource/*
additionalProperties:
type: object
minProperties: 1
description: Each key represents a supported HTTP verb on the parent path
example: get, head, put, post, patch, delete
additionalProperties:
type: object
properties:
x-fabric-privileges:
type: array
minItems: 1
items:
type: string
description: The name of a scope which will be extracted from the bearer token
example: uid, service-name.write
x-fabric-ratelimits:
type: object
required:
- default-rate
properties:
default-rate:
type: integer
minimum: 1
description: |-
Non user specific value to apply to the route. If a client makes more requests than this
value within the defined period, then they will start getting HTTP 429 responses.
period:
type: string
enum:
- second
- minute
- hour
target:
type: object
description: |-
A uid specific number of requests that can be made within the period before rate
limiting is applied
additionalProperties:
type: integer
x-fabric-whitelist:
type: object
required:
- service-list
properties:
state:
type: string
enum:
- enabled
- disabled
description: Turns whitelisting on and off for this path/operation. Default is `enabled`
service-list:
type: array
items:
type: string
description: |-
UID of a service which will be allowed access to the API if it matches all other authorization
requirements. If there is a whitelist present, then ONLY services which are referenced in the whitelist
will be able to access the API even if they match all other authorization requirements
example: stups_some-service-name
x-fabric-employee-access:
type: object
description: |
The `user-list` should only be populated if `type` is set to `allow_list`. If `type` is not
present, it will be defaulted to `scoped_access`
properties:
user-list:
type: array
items:
type: string
description: |-
UID of a user who should bypass scope checks, since user tokens can't have scopes.
type:
type: string
enum:
- allow_list
- allow_all
- deny_all
description: |-
If `allow_list` is selected, then the `user-list` property must be populated, otherwise it
is ignored. If allow_all is selected, any token which is Employee realm will be able to
access the endpoint in spite of any scope restrictions. If `deny_all` is selected, then any
employee realm token will be rejected even if there are no scope restrictions beyond `uid`.
If the employee access route config object is not present, the employee access configuration
is inherited from any globally defined employee access config.
x-fabric-static-response:
type: object
description: |
This property is used to configure a static, hard-coded response for a route. The request does not reach the backend,
the response is returned immediately from skipper.
properties:
status:
type: integer
description: The status code to use in the static response.
headers:
type: object
description: |-
The headers which should be present in the static response. This is an object whose values are all Strings.
additionalProperties:
type: string
body:
type: string
description: The body of the static response.