gpt4 book ai didi

nginx - 在 GKE 专用集群上创建入口资源时超时

转载 作者:行者123 更新时间:2023-12-05 01:12:28 24 4
gpt4 key购买 nike

创建了一个 GKE 集群,设置 cloud-nat 以实现互联网连接。然后我部署了 kubernetes ingress-nginx kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud/deploy.yaml

到这里为止一切都很好,但是当我尝试部署 ingress 资源 时,我从服务器收到此 错误(超时):创建“manifests/backend/service/be-nginx”时出错-ingress-service.yaml": 超时:请求未在请求的超时 30 秒内完成

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-resource
namespace: sap
annotations:
kubernetes.io/ingress.class: nginx
spec:
tls:
- hosts:
- mywebname.com
secretName: ingress-tls
rules:
- host: mywebname.com
http:
paths:
- path: /
backend:
serviceName: app
servicePort: 5000
- path: /v1
backend:
serviceName: web
servicePort: 8081

我的 list 在公共(public) GKE 上运行良好,但今天我将其切换为私有(private),我遇到了这个问题,这是我第一次使用 VPC,任何帮助或指导将不胜感激,谢谢

最佳答案

我很确定这是防火墙的问题。你遵守文件了吗?

https://kubernetes.github.io/ingress-nginx/deploy/#gce-gke

For private clusters, you will need to either add an additional firewall rule that allows master nodes access port 8443/tcp on worker nodes, or change the existing rule that allows access to ports 80/tcp, 443/tcp and 10254/tcp to also allow access to port 8443/tcp.

https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#add_firewall_rules

gcloud compute firewall-rules create firewall-rule-name \
--action ALLOW \
--direction INGRESS \
--source-ranges master-CIDR-block \
--rules protocol:port \
--target-tags target

关于nginx - 在 GKE 专用集群上创建入口资源时超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61939499/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com