【发布时间】:2023-01-04 19:12:42
【问题描述】:
我创建了一个 YAML 文件,它唯一的工作是:It should immediately redirect to google.com
但它就是行不通......
我的localhost 仍然返回404-nginx
我在 docker-desktop 上,我的集群版本是v1.21.5
这是我的redirect.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-google
annotations:
nginx.ingress.kubernetes.io/permanent-redirect: https://www.google.com
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: doesntmatter
port:
number: 80
这是我的kubectl get ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
cheddar nginx cheddar.127.0.0.1.nip.io localhost 80 31m
my-google <none> * 80 26m
stilton nginx stilton.127.0.0.1.nip.io localhost 80 31m
wensleydale nginx wensleydale.127.0.0.1.nip.io localhost 80 31m
注意:其他入口服务,例如cheddar.127.0.0.1.nip.io 工作完美...
【问题讨论】:
标签: kubernetes kubernetes-ingress kubectl nginx-ingress