admissioncontroller-demo

module
v0.0.0-...-f2028b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2023 License: Apache-2.0

README

admissioncontroller-demo

generate-certificate
$ openssl req -newkey rsa:2048 -nodes -keyout tls.key -out tls.csr
$ openssl x509 -req -extfile <(printf "subjectAltName=DNS:localhost,DNS:127.0.0.1,DNS:0.0.0.0") -days 365 -in tls.csr -signkey tls.key -out tls.crt
Encode tls.crt
$ cat tls.crt | base64 | tr -d " \t\n\r"
Build and Start server
$ make build
$ ./bin/admission-webhook-demo -tls -tlskey hack/certs/tls.key -tlscert hack/certs/tls.crt -cacert hack/certs/tls.crt
Test
$ curl --cacert hack/certs/tls.crt https://localhost:8443/healthz
Create validationwebhook configuration
$ kubectl create -f deploy/webhook-example.yaml
$ kubectl create ns demo

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL