@@ -6,7 +6,8 @@ reviewers:
6
6
- erictune
7
7
- janetkuo
8
8
- thockin
9
- title : Using Admission Controllers
9
+ title : Admission Controllers Reference
10
+ linkTitle : Admission Controllers
10
11
content_type : concept
11
12
weight : 30
12
13
---
@@ -18,9 +19,19 @@ This page provides an overview of Admission Controllers.
18
19
<!-- body -->
19
20
## What are they?
20
21
21
- An admission controller is a piece of code that intercepts requests to the
22
+ An _ admission controller _ is a piece of code that intercepts requests to the
22
23
Kubernetes API server prior to persistence of the object, but after the request
23
- is authenticated and authorized. The controllers consist of the
24
+ is authenticated and authorized.
25
+
26
+ Admission controllers may be _ validating_ , _ mutating_ , or both. Mutating
27
+ controllers may modify related objects to the requests they admit; validating controllers may not.
28
+
29
+ Admission controllers limit requests to create, delete, modify objects. Admission
30
+ controllers can also block custom verbs, such as a request connect to a Pod via
31
+ an API server proxy. Admission controllers do _ not_ (and cannot) block requests
32
+ to read (** get** , ** watch** or ** list** ) objects.
33
+
34
+ The admission controllers in Kubernetes {{< skew currentVersion >}} consist of the
24
35
[ list] ( #what-does-each-admission-controller-do ) below, are compiled into the
25
36
` kube-apiserver ` binary, and may only be configured by the cluster
26
37
administrator. In that list, there are two special controllers:
@@ -29,10 +40,7 @@ mutating and validating (respectively)
29
40
[ admission control webhooks] ( /docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks )
30
41
which are configured in the API.
31
42
32
- Admission controllers may be "validating", "mutating", or both. Mutating
33
- controllers may modify related objects to the requests they admit; validating controllers may not.
34
-
35
- Admission controllers limit requests to create, delete, modify objects or connect to proxy. They do not limit requests to read objects.
43
+ ## Admission control phases
36
44
37
45
The admission control process proceeds in two phases. In the first phase,
38
46
mutating admission controllers are run. In the second phase, validating
@@ -52,7 +60,7 @@ other admission controllers.
52
60
53
61
## Why do I need them?
54
62
55
- Many advanced features in Kubernetes require an admission controller to be enabled in order
63
+ Several important features of Kubernetes require an admission controller to be enabled in order
56
64
to properly support the feature. As a result, a Kubernetes API server that is not properly
57
65
configured with the right set of admission controllers is an incomplete server and will not
58
66
support all the features you expect.
@@ -91,7 +99,7 @@ To see which admission plugins are enabled:
91
99
kube-apiserver -h | grep enable-admission-plugins
92
100
```
93
101
94
- In the current version , the default ones are:
102
+ In Kubernetes {{< skew currentVersion >}} , the default ones are:
95
103
96
104
``` shell
97
105
CertificateApproval, CertificateSigning, CertificateSubjectRestriction, DefaultIngressClass, DefaultStorageClass, DefaultTolerationSeconds, LimitRanger, MutatingAdmissionWebhook, NamespaceLifecycle, PersistentVolumeClaimResize, PodSecurity, Priority, ResourceQuota, RuntimeClass, ServiceAccount, StorageObjectInUseProtection, TaintNodesByCondition, ValidatingAdmissionWebhook
@@ -103,18 +111,18 @@ CertificateApproval, CertificateSigning, CertificateSubjectRestriction, DefaultI
103
111
104
112
{{< feature-state for_k8s_version="v1.13" state="deprecated" >}}
105
113
106
- This admission controller allows all pods into the cluster. It is deprecated because
114
+ This admission controller allows all pods into the cluster. It is ** deprecated** because
107
115
its behavior is the same as if there were no admission controller at all.
108
116
109
117
### AlwaysDeny {#alwaysdeny}
110
118
111
119
{{< feature-state for_k8s_version="v1.13" state="deprecated" >}}
112
120
113
- Rejects all requests. AlwaysDeny is DEPRECATED as it has no real meaning.
121
+ Rejects all requests. AlwaysDeny is ** deprecated ** as it has no real meaning.
114
122
115
123
### AlwaysPullImages {#alwayspullimages}
116
124
117
- This admission controller modifies every new Pod to force the image pull policy to Always. This is useful in a
125
+ This admission controller modifies every new Pod to force the image pull policy to ` Always ` . This is useful in a
118
126
multitenant cluster so that users can be assured that their private images can only be used by those
119
127
who have the credentials to pull them. Without this admission controller, once an image has been pulled to a
120
128
node, any pod from any user can use it by knowing the image's name (assuming the Pod is
@@ -124,8 +132,8 @@ required.
124
132
125
133
### CertificateApproval {#certificateapproval}
126
134
127
- This admission controller observes requests to ' approve' CertificateSigningRequest resources and performs additional
128
- authorization checks to ensure the approving user has permission to ` approve ` certificate requests with the
135
+ This admission controller observes requests to approve CertificateSigningRequest resources and performs additional
136
+ authorization checks to ensure the approving user has permission to ** approve** certificate requests with the
129
137
` spec.signerName ` requested on the CertificateSigningRequest resource.
130
138
131
139
See [ Certificate Signing Requests] ( /docs/reference/access-authn-authz/certificate-signing-requests/ ) for more
@@ -134,7 +142,7 @@ information on the permissions required to perform different actions on Certific
134
142
### CertificateSigning {#certificatesigning}
135
143
136
144
This admission controller observes updates to the ` status.certificate ` field of CertificateSigningRequest resources
137
- and performs an additional authorization checks to ensure the signing user has permission to ` sign ` certificate
145
+ and performs an additional authorization checks to ensure the signing user has permission to ** sign** certificate
138
146
requests with the ` spec.signerName ` requested on the CertificateSigningRequest resource.
139
147
140
148
See [ Certificate Signing Requests] ( /docs/reference/access-authn-authz/certificate-signing-requests/ ) for more
@@ -159,7 +167,7 @@ must revisit their `IngressClass` objects and mark only one as default (with the
159
167
"ingressclass.kubernetes.io/is-default-class"). This admission controller ignores any ` Ingress `
160
168
updates; it acts only on creation.
161
169
162
- See the [ ingress ] ( /docs/concepts/services-networking/ingress/ ) documentation for more about ingress
170
+ See the [ Ingress ] ( /docs/concepts/services-networking/ingress/ ) documentation for more about ingress
163
171
classes and how to mark one as default.
164
172
165
173
### DefaultStorageClass {#defaultstorageclass}
@@ -181,7 +189,7 @@ storage classes and how to mark a storage class as default.
181
189
182
190
This admission controller sets the default forgiveness toleration for pods to tolerate
183
191
the taints ` notready:NoExecute ` and ` unreachable:NoExecute ` based on the k8s-apiserver input parameters
184
- ` default-not-ready-toleration-seconds ` and ` default-unreachable-toleration-seconds ` if the pods don't already
192
+ ` default-not-ready-toleration-seconds ` and ` default-unreachable-toleration-seconds ` if the pods don't already
185
193
have toleration for taints ` node.kubernetes.io/not-ready:NoExecute ` or
186
194
` node.kubernetes.io/unreachable:NoExecute ` .
187
195
The default value for ` default-not-ready-toleration-seconds ` and ` default-unreachable-toleration-seconds ` is 5 minutes.
@@ -206,7 +214,7 @@ This admission controller is disabled by default.
206
214
{{< feature-state for_k8s_version="v1.13" state="alpha" >}}
207
215
208
216
This admission controller mitigates the problem where the API server gets flooded by
209
- event requests. The cluster admin can specify event rate limits by:
217
+ requests to store new Events . The cluster admin can specify event rate limits by:
210
218
211
219
* Enabling the ` EventRateLimit ` admission controller;
212
220
* Referencing an ` EventRateLimit ` configuration file from the file provided to the API
@@ -223,7 +231,7 @@ plugins:
223
231
224
232
There are four types of limits that can be specified in the configuration:
225
233
226
- * ` Server ` : All event requests received by the API server share a single bucket.
234
+ * ` Server ` : All Event requests (creation or modifications) received by the API server share a single bucket.
227
235
* ` Namespace ` : Each namespace has a dedicated bucket.
228
236
* ` User ` : Each user is allocated a bucket.
229
237
* ` SourceAndObject ` : A bucket is assigned by each combination of source and
@@ -266,7 +274,7 @@ The ImagePolicyWebhook admission controller allows a backend webhook to make adm
266
274
267
275
This admission controller is disabled by default.
268
276
269
- #### Configuration File Format
277
+ #### Configuration file format {#imagereview-config-file-format}
270
278
271
279
ImagePolicyWebhook uses a configuration file to set options for the behavior of the backend.
272
280
This file may be json or yaml and has the following format:
@@ -377,8 +385,8 @@ An example request body:
377
385
}
378
386
` ` `
379
387
380
- The remote service is expected to fill the `ImageReviewStatus ` field of the request and
381
- respond to either allow or disallow access. The response body's `spec` field is ignored and
388
+ The remote service is expected to fill the `status ` field of the request and
389
+ respond to either allow or disallow access. The response body's `spec` field is ignored, and
382
390
may be omitted. A permissive response would return :
383
391
384
392
` ` ` json
@@ -529,9 +537,9 @@ permissions required to operate correctly.
529
537
# ## OwnerReferencesPermissionEnforcement {#ownerreferencespermissionenforcement}
530
538
531
539
This admission controller protects the access to the `metadata.ownerReferences` of an object
532
- so that only users with " delete" permission to the object can change it.
540
+ so that only users with ** delete** permission to the object can change it.
533
541
This admission controller also protects the access to `metadata.ownerReferences[x].blockOwnerDeletion`
534
- of an object, so that only users with " update" permission to the `finalizers`
542
+ of an object, so that only users with ** update** permission to the `finalizers`
535
543
subresource of the referenced *owner* can change it.
536
544
537
545
# ## PersistentVolumeClaimResize {#persistentvolumeclaimresize}
@@ -568,12 +576,12 @@ For more information about persistent volume claims, see [PersistentVolumeClaims
568
576
{{< feature-state for_k8s_version="v1.13" state="deprecated" >}}
569
577
570
578
This admission controller automatically attaches region or zone labels to PersistentVolumes
571
- as defined by the cloud provider (for example, GCE or AWS ).
579
+ as defined by the cloud provider (for example, Azure or GCP ).
572
580
It helps ensure the Pods and the PersistentVolumes mounted are in the same
573
581
region and/or zone.
574
582
If the admission controller doesn't support automatic labelling your PersistentVolumes, you
575
583
may need to add the labels manually to prevent pods from mounting volumes from
576
- a different zone. PersistentVolumeLabel is DEPRECATED and labeling persistent volumes has been taken over by
584
+ a different zone. PersistentVolumeLabel is **deprecated** as labeling for persistent volumes has been taken over by
577
585
the {{< glossary_tooltip text="cloud-controller-manager" term_id="cloud-controller-manager" >}}.
578
586
579
587
This admission controller is disabled by default.
@@ -745,7 +753,8 @@ pod privileges.
745
753
746
754
This admission controller implements automation for
747
755
[serviceAccounts](/docs/tasks/configure-pod-container/configure-service-account/).
748
- We strongly recommend using this admission controller if you intend to make use of Kubernetes
756
+ The Kubernetes project strongly recommends enabling this admission controller.
757
+ You should enable this admission controller if you intend to make any use of Kubernetes
749
758
` ServiceAccount` objects.
750
759
751
760
# ## StorageObjectInUseProtection
0 commit comments