Skip to content

Commit d69a881

Browse files
committed
Update user docs
1 parent de920fb commit d69a881

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

docs/extension-doc/README.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
# Setup and Configure WASM Extionsion
1+
# Setup and Configure WASM Extension
22

33
The following page explains how to setup and configure the WASM extension for the Kubernetes API-Server.
44

55
First you have to setup a Kubernetes cluster which runs with the custom build of the Kubernetes API-Server which contains the WASM extension.
66
See [cluster setup documentation](../cluster-setup/) on how to setup and run a Kubernetes cluster with a custom build of an API-Server.
77

88
If you don't want to build the API-Server by your own you can use the following image:
9-
```
10-
dvob/kube-apiserver:wasm2
11-
TODO: replace with sha256 sum tag
12-
```
9+
* `dvob/kube-apiserver:wasm` (`dvob/kube-apiserver@sha256:69f9bc68e50bffb0db5ed105ee10b8098adc5a029449ad91543eb97e37440f15`)
1310

1411
To configure the WASM extension you have to prepare configuration files and the actual WASM modules.
1512
Copy the files to the server which runs your API-Server.
@@ -18,7 +15,7 @@ In a typical kubeadm setup you also have to update the kube-apiserver mainfest t
1815
The easiest way to mount all required files into the apiserver Pod is to place all files in one directory and mount that directory into the API-Server.
1916
For this you have to extend `/etc/kubernetes/manifests/kube-apiserver.yaml` with the following parts:
2017
```yaml
21-
# spec.containers[0].volumeMaounts
18+
# spec.containers[0].volumeMounts
2219
- mountPath: /etc/kubernetes/wasm
2320
name: wasm
2421
readOnly: true
@@ -67,9 +64,9 @@ To enable the WASM authentication you have to configure the following option on
6764
--authentication-wasm-config-file=/etc/kubernetes/wasm/authn.conf
6865
```
6966

70-
The authentication extension consults each module in the module list until one sucessfully authenticates the token.
67+
The authentication extension consults each module in the module list until one successfully authenticates the token.
7168

72-
## Example
69+
## Authentication Example
7370
`/etc/kubernetes/wasm/authn.conf`:
7471
```yaml
7572
modules:
@@ -86,9 +83,9 @@ To enable the WASM authorization you have to add `WASM` to the authorization mod
8683
--authorization-wasm-config-file=/etc/kubernetes/wasm/authz.conf
8784
```
8885

89-
The authorization extension consults each module in the module list until one sucessfully authorizes the request.
86+
The authorization extension consults each module in the module list until one successfully authorizes the request.
9087

91-
## Example
88+
## Authorization Example
9289
`/etc/kubernetes/wasm/authz.conf`:
9390
```yaml
9491
modules:
@@ -101,7 +98,7 @@ Copy the module file from https://github.com/dvob/k8s-wasi-rs/releases/download/
10198

10299
# Admission
103100
To enable the WASM admission you have to add the `WASM` admission controller to the list of enabled admission plugins `--enable-admission-plugins`.
104-
To configure the WASM admission controller you have to proviede the configuration with the admission control config file `--admission-control-config-file`.
101+
To configure the WASM admission controller you have to provide the configuration with the admission control config file `--admission-control-config-file`.
105102
```
106103
--enable-admission-plugins=WASM
107104
--admission-control-config-file=/etc/kubernetes/wasm/admission.conf
@@ -134,10 +131,10 @@ If you specify the type `wasi` the module has to conform to the module specifica
134131
If `kubewarden` is used as type the call logic described [here](https://docs.kubewarden.io/writing-policies/spec/intro-spec) is used to run the module.
135132
You can find Kubewarden modules here: https://hub.kubewarden.io/
136133

137-
The WASM admission configuration is part of the full admission configuration and is either included as seperate file or directly in the admisison configuration.
134+
The WASM admission configuration is part of the full admission configuration and is either included as separate file or directly in the admission configuration.
138135

139136
File:
140-
```
137+
```yaml
141138
apiVersion: apiserver.config.k8s.io/v1
142139
kind: AdmissionConfiguration
143140
plugins:
@@ -146,7 +143,7 @@ plugins:
146143
```
147144
148145
Direct:
149-
```
146+
```yaml
150147
apiVersion: apiserver.config.k8s.io/v1
151148
kind: AdmissionConfiguration
152149
plugins:
@@ -170,9 +167,9 @@ plugins:
170167
resources: ["configmaps"]
171168
```
172169
173-
## Example
170+
## Admission Examples
174171
175-
### Basic
172+
### Example with Magic-Modules
176173
`/etc/kubernetes/wasm/admission.conf`:
177174
```yaml
178175
apiVersion: apiserver.config.k8s.io/v1
@@ -202,7 +199,7 @@ Copy the module files the following module files to `/etc/kubernetes/wasm/`
202199
* https://github.com/dvob/k8s-wasi-rs/releases/download/v0.1.1/magic_validator.wasm -> `/etc/kubernetes/wasm/magic_validator.wasm`
203200
* https://github.com/dvob/k8s-wasi-rs/releases/download/v0.1.1/magic_mutator.wasm -> `/etc/kubernetes/wasm/magic_mutator.wasm`
204201

205-
### Kubewarden
202+
### Example with Kubewarden Policy
206203
In the following example we ensure that `configmaps` and `namespaces` have an annotation `puzzle.ch/owner`.
207204
For this we use the Kubewarden policy safe-annotations: https://github.com/kubewarden/safe-annotations-policy.
208205

0 commit comments

Comments
 (0)