简体   繁体   English

gke中如何使用外网IP

[英]How to use external IP in gke

I can't use the External IP of GKE when i run kubectl get service it return:当我运行 kubectl get service 它返回时,我无法使用 GKE 的外部 IP:

NAME         TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)          AGE
hello        LoadBalancer   10.*****31    35.*****132   80:31388/TCP     25h

and bellow is my service.yaml:下面是我的 service.yaml:

apiVersion: v1
kind: Service
metadata:
  name: hello-lib
labels:
 app: hello-lib
spec:
 type: LoadBalancer
selector:
 app: hello
ports:
 - port: 8000
 targetPort: 8000
 protocol: TCP

I created Firewall rules applies all ports and IP ranges:我创建的防火墙规则适用于所有端口和 IP 范围:

这是规则

But when I connect to external IP by browser this returns a message: "This site can't be reached, Checking the proxy and the firewall"但是当我通过浏览器连接到外部 IP 时,会返回一条消息:“无法访问此站点,正在检查代理和防火墙”

Clear browser cache to fix “This site can't be reached – Checking the proxy and the firewall”清除浏览器缓存以修复“无法访问此站点 – 检查代理和防火墙”

Steps to Clear browser cache to fix:清除浏览器缓存以修复的步骤:

1)Press Ctrl + Shift + Del to open Clear browsing data. 1) 按Ctrl + Shift + Del 打开清除浏览数据。

2)Select all the time from the Time range dropdown menu. 2) 从时间范围下拉菜单中选择所有时间。

3)Next, select Cookies and Other site data and Cached images and files, and then click on Clear data. 3) 接下来,选择 Cookies 和其他站点数据以及缓存的图像和文件,然后单击清除数据。

Reset Chrome settings重置 Chrome 设置

1)Paste the following path in Chrome's address bar, and hit Enter: chrome://settings/reset 1) 将以下路径粘贴到 Chrome 的地址栏中,然后回车: chrome://settings/reset

2)Click on Restore settings to their original defaults. 2) 单击将设置恢复为原始默认值。

3)Confirm by clicking on Reset settings. 3) 通过单击重置设置进行确认。

Also Please find the document Exposing an External IP Address to Access an Application in a Cluster for more detailed information about how to use an external IP for GKE.另请参阅文档公开外部 IP 地址以访问集群中的应用程序,了解有关如何为 GKE 使用外部 IP 的更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM