@[toc]
由上一节生成的API Server风格的代码,修改代码后如何在本地Debug调试?
本地调试
启动参数指定:
--v=5
--etcd-servers https://10.10.1.52:2379
--secure-port 1443
--etcd-cafile=D:\artifact\pki\etcd\ca.crt
--etcd-certfile=D:\artifact\pki\apiserver-etcd-client.crt
--etcd-keyfile=D:\artifact\pki\apiserver-etcd-client.key
--kubeconfig=D:\artifact\config
--secure-port=1443
--authorization-kubeconfig=D:\artifact\config
--authentication-kubeconfig=D:\artifact\config
启动之后,用postman访问:
https://127.0.0.1:1443/apis/middleware.hc.middleware/v1alpha1/removenodes
入参:
{
"apiVersion": "middleware.hc.middleware/v1alpha1",
"kind": "RemoveNode",
"metadata": {
"name": "remove-test-2"
},
"spec": {},
"status": {}
}
其中认证需要代header Authorization: Bearer {token}
,具体token
这块的认证可以查看文章: