Error from server: error when creating "nginx-pod.yaml": Pod "nginx" is forbidden: no API token found for service account default/default, retry after the token is automatically created and added to the service account
Nov 26 21:52:06 localhost kube-apiserver: E1126 21:52:06.697708 1963 server.go:454] Unable to generate self signed cert: open /var/run/kubernetes/apiserver.crt: permission denied
Nov
26 21:52:06 localhost kube-apiserver: E1126 21:52:06.697818 1963 server.go:464] Unable to listen for secure (open /var/run/kubernetes/apiserver.crt: no such file or directory); will try again.
解决方法有两种:
第一种方法:
# vim /usr/lib/systemd/system/kube-apiserver.service
--secure-port=6443: The port on which to serve HTTPS with authentication and authorization. If 0, don't serve HTTPS at all.
3. 在利用yaml文件创建Pod过程中,报“Error from server:the server could not find the requested resource”
这个问题最坑,原因是Kubernetes版本太低,虽然node节点的状态显示是Ready,但无法创建Pod。
伴随现象:在描述节点状态时,显示如下,正常的是没有红色方框部分。