@@ -7,7 +7,7 @@ slug: multi-webhook-authorization-made-easy
7
7
8
8
** Authors:** [ Rita Zhang] ( https://github.com/ritazh ) (Microsoft), [ Jordan
9
9
Liggitt] ( https://github.com/liggitt ) (Google), [ Nabarun
10
- Pal] ( https://github.com/palnabarun ) (VMware)
10
+ Pal] ( https://github.com/palnabarun ) (VMware) [ Leigh Capili ] ( https://github.com/stealthybox ) (VMware)
11
11
12
12
# Enhancing Kubernetes Authorization with Multiple Webhooks and Structured Configuration
13
13
@@ -82,7 +82,7 @@ authorizers:
82
82
failurePolicy : Deny
83
83
connectionInfo :
84
84
type : KubeConfig
85
- kubeConfigFile : /kube-system-authz-webhook.yaml
85
+ kubeConfigFile : /files/ kube-system-authz-webhook.yaml
86
86
matchConditions :
87
87
# only send resource requests to the webhook
88
88
- expression : has(request.resourceAttributes)
@@ -120,7 +120,7 @@ authorizers:
120
120
failurePolicy : Deny
121
121
connectionInfo :
122
122
type : KubeConfig
123
- kubeConfigFile : /kube-system-authz-webhook.yaml
123
+ kubeConfigFile : /files/ kube-system-authz-webhook.yaml
124
124
matchConditions :
125
125
# only send resource requests to the webhook
126
126
- expression : has(request.resourceAttributes)
@@ -140,7 +140,7 @@ authorizers:
140
140
failurePolicy : Deny
141
141
connectionInfo :
142
142
type : KubeConfig
143
- kubeConfigFile : /opa-default-authz-webhook.yaml
143
+ kubeConfigFile : /files/ opa-default-authz-webhook.yaml
144
144
matchConditions :
145
145
# only send resource requests to the webhook
146
146
- expression : has(request.resourceAttributes)
@@ -170,6 +170,36 @@ argument. From Kubernetes 1.30, the feature is in beta and enabled by default.
170
170
If you want to keep using command line flags instead of a configuration file,
171
171
those will continue to work as-is.
172
172
173
+ The following kind Cluster configuration sets that command argument on the
174
+ APIserver to load an AuthorizationConfiguration from a file
175
+ (`authorization_config.yaml`) in the files folder.
176
+ Any needed kubeconfig and certificate files can also be put in the files
177
+ directory.
178
+ ` ` ` yaml
179
+ kind: Cluster
180
+ apiVersion: kind.x-k8s.io/v1alpha4
181
+ featureGates:
182
+ StructuredAuthorizationConfiguration: true # enabled by default in v1.30
183
+ kubeadmConfigPatches:
184
+ - |
185
+ kind: ClusterConfiguration
186
+ metadata:
187
+ name: config
188
+ apiServer:
189
+ extraArgs:
190
+ authorization-config: "/files/authorization_config.yaml"
191
+ extraVolumes:
192
+ - name: files
193
+ hostPath: "/files"
194
+ mountPath: "/files"
195
+ readOnly: true
196
+ nodes:
197
+ - role: control-plane
198
+ extraMounts:
199
+ - hostPath: files
200
+ containerPath: /files
201
+ ` ` `
202
+
173
203
We would love to hear your feedback on this feature. In particular, we would
174
204
like feedback from Kubernetes cluster administrators and authorization webhook
175
205
implementors as they go through the process of building their integrations with
0 commit comments