Metarget / metarget

Metarget is a framework providing automatic constructions of vulnerable infrastructures.
Apache License 2.0
1.05k stars 163 forks source link

couldn't validate the identity of the API Server #123

Closed r0b1nwoo closed 9 months ago

r0b1nwoo commented 9 months ago

在按照Metarget:构建云原生基础设施靶场此链接中的demo在worker node上部署时,总是出现如下错误:

[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
    [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 18.03.1-ce. Latest validated version: 19.03
error execution phase preflight: couldn't validate the identity of the API Server: abort connecting to API servers after timeout of 5m0s
To see the stack trace of this error execute with --v=5 or higher

请问应当如何解决呢?

ps:最后一句说To see the stack trace of this error execute with --v=5 or higher,但即使使用了这个--v=5选项,也并没有提供更详细的报错信息。

r0b1nwoo commented 9 months ago

问题差不多解决了,反过头来分析,感觉是因为在master节点上执行./metarget cnv install cve-2020-8559 --taint-master指令时,生成的install_k8s_worker.sh脚本中缺少设置$KUBECONFIG环境变量的语句。需要单独执行如下语句。

echo "export KUBECONFIG=/etc/kubernetes/kubelet.conf" > ~/.bash_profile
source ~/.bash_profile