Ingress是K8S标准资源类型之一,用于将集群外的请求流量转发至集群内部:
apiVersion: v1
kind: Ingress
metadata:
name: <ingress name>
namespace: <ingress namespace>
annotations:
nginx.ingress.kubernetes.io/secure-backends: "true"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: <host name>
http:
paths:
- path: <url path>
backend:
serviceName: <service name>
servicePort: <service port>
参考:
https://kubernetes.io/docs/concepts/services-networking/ingress/
https://www.jianshu.com/p/595fd3fac7ff
网友评论