Skip to content

Commit af29d47

Browse files
committed
Add kubeadm example to Structure Authz beta blog
Signed-off-by: leigh capili <[email protected]>
1 parent 48620d7 commit af29d47

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

content/en/blog/_posts/2024-04-xx-structured-authz-beta.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ slug: multi-webhook-authorization-made-easy
77

88
**Authors:** [Rita Zhang](https://github.com/ritazh) (Microsoft), [Jordan
99
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)
1111

1212
# Enhancing Kubernetes Authorization with Multiple Webhooks and Structured Configuration
1313

@@ -82,7 +82,7 @@ authorizers:
8282
failurePolicy: Deny
8383
connectionInfo:
8484
type: KubeConfig
85-
kubeConfigFile: /kube-system-authz-webhook.yaml
85+
kubeConfigFile: /files/kube-system-authz-webhook.yaml
8686
matchConditions:
8787
# only send resource requests to the webhook
8888
- expression: has(request.resourceAttributes)
@@ -120,7 +120,7 @@ authorizers:
120120
failurePolicy: Deny
121121
connectionInfo:
122122
type: KubeConfig
123-
kubeConfigFile: /kube-system-authz-webhook.yaml
123+
kubeConfigFile: /files/kube-system-authz-webhook.yaml
124124
matchConditions:
125125
# only send resource requests to the webhook
126126
- expression: has(request.resourceAttributes)
@@ -140,7 +140,7 @@ authorizers:
140140
failurePolicy: Deny
141141
connectionInfo:
142142
type: KubeConfig
143-
kubeConfigFile: /opa-default-authz-webhook.yaml
143+
kubeConfigFile: /files/opa-default-authz-webhook.yaml
144144
matchConditions:
145145
# only send resource requests to the webhook
146146
- expression: has(request.resourceAttributes)
@@ -170,6 +170,36 @@ argument. From Kubernetes 1.30, the feature is in beta and enabled by default.
170170
If you want to keep using command line flags instead of a configuration file,
171171
those will continue to work as-is.
172172

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+
173203
We would love to hear your feedback on this feature. In particular, we would
174204
like feedback from Kubernetes cluster administrators and authorization webhook
175205
implementors as they go through the process of building their integrations with

0 commit comments

Comments
 (0)