You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Kubernetes API server's authorizer chain can be configured using a
217
217
configuration file.
218
218
219
-
You specify the path to that authorization configuration using the
220
-
`--authorization-config`command line argument. This feature enables
221
-
creation of authorization chains with multiple webhooks with well-defined
222
-
parameters that validate requests in a certain order and enables fine grained
223
-
control - such as explicit Deny on failures. An example configuration with
224
-
all possible values is provided below.
219
+
This feature enables the creation of authorization chains with multiple webhooks with well-defined parameters that validate requests in a particular order and allows fine-grained control – such as explicit Deny on failures. The configuration file approach even allows you to specify [CEL](/docs/reference/using-api/cel/) rules to pre-filter requests before they are dispatched to webhooks, helping you to prevent unnecessary invocations. The API server also automatically reloads the authorizer chain when the configuration file is modified. An example configuration with all possible values is provided below.
225
220
226
-
In order to customise the authorizer chain, you need to enable the
You must specify the path to the authorization configuration using the `--authorization-config`command line argument. If you want to keep using command line flags instead of a configuration file, those will continue to work as-is. To gain access to new authorization webhook capabilities like multiple webhooks, failure policy, and pre-filter rules, switch to putting options in an `--authorization-config` file.
228
222
229
-
Note: When the feature is enabled, setting both `--authorization-config` and
223
+
Starting Kubernetes 1.30, the configuration file format is
224
+
beta-level, and only requires specifying `--authorization-config` since the `StructuredAuthorizationConfiguration` feature gate is enabled by default.
225
+
226
+
{{< caution >}}
227
+
If you want to keep using command line flags to configure authorization instead of a configuration file, those will continue to work as-is.
228
+
229
+
When the feature is enabled, setting both `--authorization-config` and
230
230
configuring an authorization webhook using the `--authorization-mode` and
231
231
`--authorization-webhook-*`command line flags is not allowed. If done, there
232
232
will be an error and API Server would exit right away.
233
233
234
-
{{< caution >}}
235
-
While the feature is in Alpha/Beta, there is no change if you want to keep on
236
-
using command line flags. When the feature goes Beta, the feature flag would
237
-
be turned on by default. The feature flag would be removed when feature goes GA.
234
+
Authorization Config file reloads when an observed file event occurs or a 1 minute poll is encountered. All non-webhook authorizer types are required to remain unchanged in the file on reload. Reload must not add or remove Node or RBAC
235
+
authorizers. They can be reordered, but cannot be added or removed.
238
236
239
237
When configuring the authorizer chain using a config file, make sure all the
240
-
apiserver nodes have the file. Also, take a note of the apiserver configuration
238
+
apiserver nodes have the file. Take a note of the apiserver configuration
241
239
when upgrading/downgrading the clusters. For example, if upgrading to v1.29+
242
240
clusters and using the config file, you would need to make sure the config file
243
241
exists before upgrading the cluster. When downgrading to v1.28, you would need
@@ -248,9 +246,8 @@ to add the flags back to their bootstrap mechanism.
248
246
#
249
247
# DO NOT USE THE CONFIG AS IS. THIS IS AN EXAMPLE.
250
248
#
251
-
apiVersion: apiserver.config.k8s.io/v1alpha1
249
+
apiVersion: apiserver.config.k8s.io/v1beta1
252
250
kind: AuthorizationConfiguration
253
-
# authorizers are defined in order of precedence
254
251
authorizers:
255
252
- type: Webhook
256
253
# Name used to describe the authorizer
@@ -283,7 +280,7 @@ authorizers:
283
280
# MatchConditionSubjectAccessReviewVersion specifies the SubjectAccessReview
284
281
# version the CEL expressions are evaluated against
285
282
# Valid values: v1
286
-
# Required only if matchConditions are specified, no default value
283
+
# Required, no default value
287
284
matchConditionSubjectAccessReviewVersion: v1
288
285
# Controls the authorization decision when a webhook request fails to
289
286
# complete or returns a malformed response or errors evaluating
0 commit comments