【发布时间】:2019-08-16 20:20:37
【问题描述】:
我正在尝试将我的入口连接到静态 IP。我似乎正在关注所有教程,但我似乎仍然无法将我的静态 IP 附加到入口。我的入口文件如下(参考静态ip“test-ip”)
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-web
annotations:
kubernetes.io/ingress.global-static-ip-name: "test-ip"
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/add-base-url: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
rules:
- http:
paths:
- path: /api/
backend:
serviceName: api-cluster-ip-service
servicePort: 5005
- path: /
backend:
serviceName: web-cluster-ip-service
servicePort: 80
但是,当我运行时
kubectl get ingress ingress-web
返回
kubectl get ingress ingress-web
NAME HOSTS ADDRESS PORTS AGE
ingress-web * 80 4m
没有给出地址。在 VPC 网络中 [外部 IP 地址 ] 静态 ip 在那里,它是全局的,但它一直说:正在使用中,没有人使用
gcloud compute addresses describe test-ip --global
给予
address: 34.240.xx.xxx
creationTimestamp: '2019-03-26T00:34:26.086-07:00'
description: ''
id: '536303927960423409'
kind: compute#address
name: test-ip
networkTier: PREMIUM
selfLink: https://www.googleapis.com/compute/v1/projects/my-project- adbc8/global/addresses/test-ip
status: RESERVED
我在这里错过了什么?
【问题讨论】:
-
你能显示
gcloud compute addresses describe test-ip --global的输出吗 -
添加了输出
-
您是否尝试过在同一区域使用静态 IP 和 LB 服务,正如这里所描述的 stackoverflow.com/a/49691364/11101419 ?
标签: google-cloud-platform kubernetes-ingress static-ip-address nginx-ingress