kubernetes-guide/docs/chap16/16.3.md

27 lines
482 B
Markdown
Raw Permalink Normal View History

2023-03-13 14:23:59 +08:00
**vim redirect.yaml**
```
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/permanent-redirect: https://www.baidu.com
name: nginx-redirect
namespace: study-ingress
spec:
ingressClassName: nginx
rules:
- host: nginx.redirect.com
http:
paths:
- backend:
service:
name: nginx
port:
number: 80
path: /
pathType: ImplementationSpecific
```