[英]Kubernetes: Ingress doesn't have IP address
I setup a 3 nodes K8S cluster locally with virtualbox.我用 virtualbox 在本地设置了一个 3 节点的 K8S 集群。 When I try out the ingress, it doesn't setup the IP address:
当我尝试入口时,它没有设置 IP 地址:
2017-11-11 17:00:49.015691 I | proto: duplicate proto type registered:
google.protobuf.Any
2017-11-11 17:00:49.016061 I | proto: duplicate proto type registered: google.protobuf.Duration
2017-11-11 17:00:49.016112 I | proto: duplicate proto type registered: google.protobuf.Timestamp
NAME HOSTS ADDRESS PORTS AGE
whale-ingress a.whale.hey,b.whale.hey 80 9m
Ingress:入口:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: whale-ingress
spec:
rules:
- host: a.whale.hey
http:
paths:
- path: /
backend:
serviceName: whale-svc-a
servicePort: 80
- host: b.whale.hey
http:
paths:
- path: /
backend:
serviceName: whale-svc-b
servicePort: 80
Did I set something wrong?我设置错了吗?
Are you running an Ingress controller?您正在运行 Ingress 控制器吗? A minimal Kubernetes cluster does not have an Ingress controller by default.
默认情况下,最小的 Kubernetes 集群没有 Ingress 控制器。 If not, try deploying this controller: https://github.com/kubernetes/ingress-nginx
如果没有,请尝试部署此控制器: https ://github.com/kubernetes/ingress-nginx
An Ingress is an object that only provides a configuration, not an active component (such as a Pod or a Service). Ingress 是一个仅提供配置的对象,而不是活动组件(例如 Pod 或 Service)。 As coreypobrien said, you need to deploy an Ingress controller, which will read the ingresses you deployed in your cluster and change its configuration accordingly.
正如 coreypobrien 所说,您需要部署一个 Ingress 控制器,它将读取您在集群中部署的入口并相应地更改其配置。
At this page you can find the documentation of the official kubernetes ingress controller, based on nginx https://github.com/kubernetes/ingress-nginx/blob/master/README.md在这个页面你可以找到官方kubernetes入口控制器的文档,基于nginx https://github.com/kubernetes/ingress-nginx/blob/master/README.md
Another option is the traefik ingress controller: https://docs.traefik.io/user-guide/kubernetes/另一种选择是 traefik 入口控制器: https ://docs.traefik.io/user-guide/kubernetes/
I had the same problem and I solved it by hard coding address in ingress controller.我遇到了同样的问题,我通过入口控制器中的硬编码地址解决了这个问题。 You can do it by adding "externalIPs" parameter in spec block of kind service (in ingress yaml) like bellow
您可以通过在种类服务(在入口 yaml 中)的规范块中添加“externalIPs”参数来做到这一点,如下所示
--snip--
externalIPs:
- 192.168.1.54
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.