You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GKE上使用NGINX Ingress Controller遇异常问题咨询

切换NGINX Ingress Controller后的异常排查

我之前在GKE上一直依赖Google L7负载均衡器对应的gce Ingress暴露应用,最近因为业务和运维层面的多种原因,打算换成基于TCP负载均衡器的NGINX Ingress Controller。目前部署已经正常启动,但遇到了一些奇怪的异常现象,先把相关配置贴出来方便排查:

NGINX Ingress的Service配置

执行命令 kubectl get service ingress-nginx-static -n ingress-nginx -o yaml 得到的输出如下:

apiVersion: v1
kind: Service
metadata:
  creationTimestamp: 2018-03-23T15:08:39Z
  labels:
    app: ingress-nginx
  name: ingress-nginx-static
  namespace: ingress-nginx
  resourceVersion: "101258"
  selfLink: /api/v1/namespaces/ingress-nginx/services/ingress-nginx-static
  uid: 110cf622-2eac-11e8-a8e3-42010a84011f
spec:
  clusterIP: 10.51.247.47
  externalTrafficPolicy: Local
  healthCheckNodePort: 32689
  loadBalancerIP: 99.99.99.99
  ports:
  - name: http
    nodePort: 32296
    port: 80
    protocol: TCP
    targetPort: http
  - name: https
    nodePort: 31228
    port: 443
    protocol: TCP
    targetPort: https
  selector:
    app: ingress-nginx
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer:
    ingress:
    - ip: 99.99.99.99

集群中的Ingress配置示例

我们在集群内配置了多个Ingress资源,目前都可以通过上面的固定IP 99.99.99.99 访问,下面是其中一个Ingress的配置片段(执行命令 kubectl get ing -n staging-application -o yaml 获取):

apiVersion: v1
items:
- apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    annotations:
      kubernetes.io/ingress.class: nginx
    creationTimestamp: 2018-03-23T15:15:56Z
    generation: 1
    name: staging-ingress
    namespace: staging-platform
    resourceVersion: "101788"
    selfLink: /apis/extensions/v1beta1/namespaces/staging-platform/ingresses/staging-ingress

内容的提问来源于stack exchange,提问作者Andrew Holway

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:54:52