使用kubectl proxy命令就可以使API server监听在本地的8009端口上:

$ kubectl proxy --port=8009
Starting to serve on 127.0.0.1:8009

如果想通过其它主机访问就需要指定监听的地址:

$ kubectl proxy --address=0.0.0.0  --port=8009
Starting to serve on [::]:8009

此时通过curl访问会出现未认证的提示:

$ curl -X GET -L http://k8s-master:8009/
<h3>Unauthorized</h3>

设置API server接收所有主机的请求:

$ kubectl proxy --address='0.0.0.0'  --accept-hosts='^*$' --port=8009
Starting to serve on [::]:8009

 

文章转自:https://blog.csdn.net/jijiuqiu6646/article/details/106050201

相关文章:

  • 2021-08-30
  • 2021-10-05
  • 2021-11-08
  • 2022-12-23
  • 2021-05-27
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-22
  • 2022-12-23
  • 2021-11-20
  • 2021-06-15
相关资源
相似解决方案