首页
视频
资源
登录
转
kubectl proxy 让外部网络访问K8S service的ClusterIP
15453
人阅读
2020/6/29 11:07
总访问:
2537780
评论:
0
收藏:
0
手机
分类:
容器编排
![Kubernetes](https://img.tnblog.net/arcimg/hb/274ef6f115de4c9b8e40ded5deb2f4c2.jpg "Kubernetes") >#kubectl proxy 让外部网络访问K8S service的ClusterIP [TOC] <br/> >###使用kubectl proxy命令就可以使API server监听在本地的8001端口上: ```bash $ kubectl proxy Starting to serve on 127.0.0.1:8001 ``` >###如果想通过其它主机访问就需要指定监听的地址: ```bash $ kubectl proxy --port=8009 Starting to serve on 127.0.0.1:8009 ``` ```bash $ kubectl proxy --port=8009 Starting to serve on 127.0.0.1:8009 ``` >###此时通过curl访问会出现未认证的提示: ```bash $ curl -X GET -L http://k8s-master:8009/ <h3>Unauthorized</h3> ``` >###设置API server接收所有主机的请求: ```bash $ kubectl proxy --address='0.0.0.0' --accept-hosts='^*$' --port=8009 Starting to serve on [::]:8009 ``` >###访问正常: ```bash $ curl -X GET -L http://k8s-master:8009/ { "paths": [ "/api", "/api/v1", ... ] } ``` >###访问方式: ```bash curl http://[k8s-master]:8009/api/v1/namespaces/[namespace-name]/services/[service-name]/proxy ``` >###感谢声明 tn2>原创作者地址:https://blog.csdn.net/jijiuqiu6646/article/details/106050201 更多请参考:https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/
欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739
👈{{preArticle.title}}
👉{{nextArticle.title}}
评价
{{titleitem}}
{{titleitem}}
{{item.content}}
{{titleitem}}
{{titleitem}}
{{item.content}}
尘叶心繁
这一世以无限游戏为使命!
博主信息
排名
6
文章
6
粉丝
16
评论
8
文章类别
.net后台框架
166篇
linux
17篇
linux中cve
1篇
windows中cve
0篇
资源分享
10篇
Win32
3篇
前端
28篇
传说中的c
4篇
Xamarin
9篇
docker
15篇
容器编排
101篇
grpc
4篇
Go
15篇
yaml模板
1篇
理论
2篇
更多
Sqlserver
4篇
云产品
39篇
git
3篇
Unity
1篇
考证
2篇
RabbitMq
23篇
Harbor
1篇
Ansible
8篇
Jenkins
17篇
Vue
1篇
Ids4
18篇
istio
1篇
架构
2篇
网络
7篇
windbg
4篇
AI
18篇
threejs
2篇
人物
1篇
嵌入式
2篇
python
13篇
HuggingFace
8篇
pytorch
9篇
opencv
6篇
最新文章
最新评价
{{item.articleTitle}}
{{item.blogName}}
:
{{item.content}}
关于我们
ICP备案 :
渝ICP备18016597号-1
网站信息:
2018-2024
TNBLOG.NET
技术交流:
群号656732739
联系我们:
contact@tnblog.net
欢迎加群
欢迎加群交流技术