You need following files
secrets/client.crt: Client certificatesecrets/client.key: Client private keysecrets/kubeconfig: Kubeconfig filesecrets/config.json: Configuration of the virtual node
You can use this config.json.
{
"mock-node": {
"cpu": "2",
"memory": "4Gi",
"pods": "10",
"others": {
"nvidia.com/gpu": "1"
},
"providerID": "mock://test-node",
"deviceIP": "192.168.1.100"
}
}If you use K3s, you can find the client certificate and key in /var/lib/rancher/k3s/agent, each file is named client-kubelet.crt and client-kubelet.key. The kubeconfig file is at /etc/rancher/k3s/k3s.yaml. You need to edit the kubeconfig file to use the correct server address.
Then run:
$ ls secrets
client.crt client.key config.json kubeconfig
$ go run main.go