# Validating admission webhook ## Building Docker image From the root directory of Multus execute: ``` cd webhook ./build ``` ## Deploying webhook application Change working directory. From the root directory of Multus execute: ``` cd deployment/webhook ``` Create key and certificate pair and patch configuration-template.yaml file with base64-encoded certificate file. Run: ``` ./certs.sh ``` *Note: Verify that Kubernetes controller manager has --cluster-signing-cert-file and --cluster-signing-key-file parameters set to paths to your CA keypair, to make sure that Certificates API is enabled in order to generate certificate signed by cluster CA. Script generates private key and certificate signing request, which is then pushed to the Kubernetes API server. Then script approves that CSR and API server issues the certificate. Certificate is obtained from the API server and used to create a secret. Script also patches `configuration-template.yaml` file with base64-encoded certificate and creates `configuration.yaml` file containing Validating Webhook Configuration specification, which is deployed in one of the next steps. More details about TLS certificates management in a cluster available [here](https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/).* Create service: ``` kubectl create -f service.yaml ``` Run deployment: ``` kubectl create -f deployment.yaml ``` Create Validating Webhook Configuration: ``` kubectl create -f configuration.yaml ``` ## Verifying installation Try to create invalid Network Attachment Definition resource: ``` cat <