@@ -261,12 +261,17 @@ serialized to JSON as the body.
261
261
Webhooks can specify what versions of `AdmissionReview` objects they accept
262
262
with the `admissionReviewVersions` field in their configuration :
263
263
264
- ` ` ` yaml
265
- apiVersion: admissionregistration.k8s.io/v1
266
- kind: ValidatingWebhookConfiguration
267
- webhooks:
268
- - name: my-webhook.example.com
269
- admissionReviewVersions: ["v1", "v1beta1"]
264
+ ` ` ` json
265
+ {
266
+ "apiVersion": "admissionregistration.k8s.io/v1",
267
+ "kind": "ValidatingWebhookConfiguration",
268
+ "webhooks": [
269
+ {
270
+ "name": "my-webhook.example.com",
271
+ "admissionReviewVersions": ["v1", "v1beta1"]
272
+ }
273
+ ]
274
+ }
270
275
` ` `
271
276
272
277
` admissionReviewVersions` is a required field when creating webhook configurations.
@@ -282,98 +287,109 @@ This example shows the data contained in an `AdmissionReview` object
282
287
for a request to update the `scale` subresource of an `apps/v1` `Deployment` :
283
288
284
289
` ` ` yaml
285
- apiVersion: admission.k8s.io/v1
286
- kind: AdmissionReview
287
- request:
288
- # Random uid uniquely identifying this admission call
289
- uid: 705ab4f5-6393-11e8-b7cc-42010a800002
290
-
291
- # Fully-qualified group/version/kind of the incoming object
292
- kind:
293
- group: autoscaling
294
- version: v1
295
- kind: Scale
296
-
297
- # Fully-qualified group/version/kind of the resource being modified
298
- resource:
299
- group: apps
300
- version: v1
301
- resource: deployments
302
-
303
- # subresource, if the request is to a subresource
304
- subResource: scale
305
-
306
- # Fully-qualified group/version/kind of the incoming object in the original request to the API server.
307
- # This only differs from ` kind` if the webhook specified `matchPolicy: Equivalent` and the
308
- # original request to the API server was converted to a version the webhook registered for.
309
- requestKind :
310
- group : autoscaling
311
- version : v1
312
- kind : Scale
313
-
314
- # Fully-qualified group/version/kind of the resource being modified in the original request to the API server.
315
- # This only differs from `resource` if the webhook specified `matchPolicy: Equivalent` and the
316
- # original request to the API server was converted to a version the webhook registered for.
317
- requestResource :
318
- group : apps
319
- version : v1
320
- resource : deployments
321
-
322
- # subresource, if the request is to a subresource
323
- # This only differs from `subResource` if the webhook specified `matchPolicy: Equivalent` and the
324
- # original request to the API server was converted to a version the webhook registered for.
325
- requestSubResource : scale
326
-
327
- # Name of the resource being modified
328
- name : my-deployment
329
-
330
- # Namespace of the resource being modified, if the resource is namespaced (or is a Namespace object)
331
- namespace : my-namespace
332
-
333
- # operation can be CREATE, UPDATE, DELETE, or CONNECT
334
- operation : UPDATE
335
-
336
- userInfo :
337
- # Username of the authenticated user making the request to the API server
338
- username : admin
339
-
340
- # UID of the authenticated user making the request to the API server
341
- uid : 014fbff9a07c
342
-
343
- # Group memberships of the authenticated user making the request to the API server
344
- groups :
345
- - system:authenticated
346
- - my-admin-group
347
- # Arbitrary extra info associated with the user making the request to the API server.
348
- # This is populated by the API server authentication layer and should be included
349
- # if any SubjectAccessReview checks are performed by the webhook.
350
- extra :
351
- some-key :
352
- - some-value1
353
- - some-value2
354
-
355
- # object is the new object being admitted.
356
- # It is null for DELETE operations.
357
- object :
358
- apiVersion : autoscaling/v1
359
- kind : Scale
360
-
361
- # oldObject is the existing object.
362
- # It is null for CREATE and CONNECT operations.
363
- oldObject :
364
- apiVersion : autoscaling/v1
365
- kind : Scale
366
-
367
- # options contains the options for the operation being admitted, like meta.k8s.io/v1 CreateOptions, UpdateOptions, or DeleteOptions.
368
- # It is null for CONNECT operations.
369
- options :
370
- apiVersion : meta.k8s.io/v1
371
- kind : UpdateOptions
372
-
373
- # dryRun indicates the API request is running in dry run mode and will not be persisted.
374
- # Webhooks with side effects should avoid actuating those side effects when dryRun is true.
375
- # See http://k8s.io/docs/reference/using-api/api-concepts/#make-a-dry-run-request for more details.
376
- dryRun : False
290
+ {
291
+ "apiVersion": "admission.k8s.io/v1",
292
+ "kind": "AdmissionReview",
293
+ "request": {
294
+ # Random uid uniquely identifying this admission call
295
+ "uid": "705ab4f5-6393-11e8-b7cc-42010a800002",
296
+
297
+ # Fully-qualified group/version/kind of the incoming object
298
+ "kind": {
299
+ "group": "autoscaling",
300
+ "version": "v1",
301
+ "kind": "Scale"
302
+ },
303
+
304
+ # Fully-qualified group/version/kind of the resource being modified
305
+ "resource": {
306
+ "group": "apps",
307
+ "version": "v1",
308
+ "resource": "deployments"
309
+ },
310
+
311
+ # Subresource, if the request is to a subresource
312
+ "subResource": "scale",
313
+
314
+ # Fully-qualified group/version/kind of the incoming object in the original request to the API server
315
+ # This only differs from ` kind` if the webhook specified `matchPolicy: Equivalent` and the original
316
+ # request to the API server was converted to a version the webhook registered for
317
+ " requestKind " : {
318
+ " group " : " autoscaling" ,
319
+ " version " : " v1" ,
320
+ " kind " : " Scale"
321
+ },
322
+
323
+ # Fully-qualified group/version/kind of the resource being modified in the original request to the API server
324
+ # This only differs from `resource` if the webhook specified `matchPolicy: Equivalent` and the original
325
+ # request to the API server was converted to a version the webhook registered for
326
+ " requestResource " : {
327
+ " group " : " apps" ,
328
+ " version " : " v1" ,
329
+ " resource " : " deployments"
330
+ },
331
+
332
+ # Subresource, if the request is to a subresource
333
+ # This only differs from `subResource` if the webhook specified `matchPolicy: Equivalent` and the original
334
+ # request to the API server was converted to a version the webhook registered for
335
+ " requestSubResource " : " scale" ,
336
+
337
+ # Name of the resource being modified
338
+ " name " : " my-deployment" ,
339
+
340
+ # Namespace of the resource being modified, if the resource is namespaced (or is a Namespace object)
341
+ " namespace " : " my-namespace" ,
342
+
343
+ # Operation can be CREATE, UPDATE, DELETE, or CONNECT
344
+ " operation " : " UPDATE" ,
345
+
346
+ " userInfo " : {
347
+ # Username of the authenticated user making the request to the API server
348
+ " username " : " admin" ,
349
+
350
+ # UID of the authenticated user making the request to the API server
351
+ " uid " : " 014fbff9a07c" ,
352
+
353
+ # Group memberships of the authenticated user making the request to the API server
354
+ " groups " : [
355
+ " system:authenticated" ,
356
+ " my-admin-group"
357
+ ],
358
+
359
+ # Arbitrary extra info associated with the user making the request to the API server
360
+ # This is populated by the API server authentication layer
361
+ " extra " : {
362
+ " some-key " : [
363
+ " some-value1" ,
364
+ " some-value2"
365
+ ]
366
+ }
367
+ },
368
+
369
+ # Object is the new object being admitted. It is null for DELETE operations
370
+ " object " : {
371
+ " apiVersion " : " autoscaling/v1" ,
372
+ " kind " : " Scale"
373
+ },
374
+
375
+ # OldObject is the existing object. It is null for CREATE and CONNECT operations
376
+ " oldObject " : {
377
+ " apiVersion " : " autoscaling/v1" ,
378
+ " kind " : " Scale"
379
+ },
380
+
381
+ # Options contain the options for the operation being admitted, like meta.k8s.io/v1 CreateOptions,
382
+ # UpdateOptions, or DeleteOptions. It is null for CONNECT operations
383
+ " options " : {
384
+ " apiVersion " : " meta.k8s.io/v1" ,
385
+ " kind " : " UpdateOptions"
386
+ },
387
+
388
+ # DryRun indicates the API request is running in dry run mode and will not be persisted
389
+ # Webhooks with side effects should avoid actuating those side effects when dryRun is true
390
+ " dryRun " : false
391
+ }
392
+ }
377
393
```
378
394
379
395
### Response
0 commit comments