MutatingWebhookConfiguration本地2步调试
step01: windows本地
1.go get -v -u github.com/go-delve/delve/cmd/dlv
2.go build
3.dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec ./love.exe
4.IntelliJ IDEA启动程序
step02: (同server方式1中的step001不变)
调试修改mutatingwebhookconfigurations删除service,使用外部
clientConfig:
url: https://local.wly.com/mutate-core-v1-pod
问题集合:
001:dlv版本要求golang版本
002: 本地启动报错缺少证书,证书放好即可(不管是手动自建证书,还是certmanager)
1.6837720488751214e+09 ERROR setup problem running manager {"error": "open D:\\soft\\cygwin64\\tmp\\k8s-webhook-server\\serving-certs\\tls.crt: The system cannot find
step03:
修改k8s资源触发,验证