|
| 1 | +# Resource Annotator Mutating Webhook |
| 2 | + |
| 3 | +This chart deploys the resource annotator mutating admission webhook. |
| 4 | +This webhook can be used to provide extra information for NRI resource |
| 5 | +policy plugins about compute (CPU and memory) resource requirements of |
| 6 | +containers. The hook will put a well known annotation on the pod which |
| 7 | +describes the resources for all init container and containers by name. |
| 8 | +If found, NRI resource policy plugins will use this extra information |
| 9 | +to discover container resource requirements instead of estimating them. |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | + |
| 13 | +- An NRI resource plugin > v0.11.0 |
| 14 | +- Helm 3.0.0+ |
| 15 | + |
| 16 | +## Installing the Chart |
| 17 | + |
| 18 | +Path to the chart: `resource-annotator` |
| 19 | + |
| 20 | +At the moment the webhook does not you cert-manager. Instead you need |
| 21 | +to generate a certificate for the webhook before instantiating it and |
| 22 | +pass the certificate and its related key to helm. The below example |
| 23 | +demonstrates how this can be done. |
| 24 | + |
| 25 | +```shell |
| 26 | +$ helm repo add nri-plugins https://containers.github.io/nri-plugins |
| 27 | +$ mkdir cert |
| 28 | +$ SVC=resource-annotator NS=kube-system |
| 29 | +$ openssl req -x509 -newkey rsa:2048 -sha256 -days 365 -nodes \ |
| 30 | + -keyout ./cert/server-key.pem \ |
| 31 | + -out ./cert/server-crt.pem \ |
| 32 | + -subj "/CN=$SVC.$NS.svc" \ |
| 33 | + -addext "subjectAltName=DNS:$SVC,DNS:$SVC.$NS,DNS:$SVC.$NS.svc" |
| 34 | +$ helm -n $NS install nri-webhook nri-plugins/nri-resource-annotator \ |
| 35 | + --set service.secret.crt=$(base64 -w0 < ./cert/server-crt.pem) \ |
| 36 | + --set service.secret.key=$(base64 -w0 < ./cert/server-key.pem) |
| 37 | +``` |
| 38 | + |
| 39 | +This will set up everything for the resource annotator webhook. |
| 40 | + |
| 41 | +## Uninstalling the Chart |
| 42 | + |
| 43 | +You can uninstall the resource annotator webhook with the following |
| 44 | +helm command. |
| 45 | + |
| 46 | +```shell |
| 47 | +$ NS=kube-system |
| 48 | +$ helm -n $NS uninstall nri-webhook |
| 49 | +``` |
| 50 | + |
| 51 | +## Configuration options |
| 52 | + |
| 53 | +The tables below present an overview of the parameters available for users to |
| 54 | +customize with their own values, along with the default values. |
| 55 | + |
| 56 | +| Name | Default | Description | |
| 57 | +|-----------------------------|-------------------------------------------------------|--------------------------------| |
| 58 | +| `image.name` | ghcr.io/containers/nri-plugins/nri-resource-annotator | container image name | |
| 59 | +| `image.tag` | unstable | container image tag | |
| 60 | +| `image.pullPolicy` | Always | image pull policy | |
| 61 | +| `service.base64Crt` | no sane default, see instructions above | base64 encoded certificate | |
| 62 | +| `service.base64Key` | no sane default, see instructions above | base64 encoded certificate key | |
| 63 | +| `resources.requests.cpu` | 250m | CPU resource request | |
| 64 | +| `resources.requests.memory` | 256Mi | memory resource request | |
| 65 | +| `resources.limits.cpu` | 1 | CPU resource limit | |
| 66 | +| `resources.limits.memory` | 256Mi | memory resource limit | |
0 commit comments