参考:https://kubernetes.github.io/ingress-nginx/deploy/
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/cloud-generic.yaml
确认启动
kubectl -n ingress-nginx get pods
运行中
接下来就可以添加配置暴露service。
记得将host中配置的域名添加到本机的hosts文件中。
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
namespace: test
annotations:
nginx.ingress.kubernetes.io/proxy-connect-timeout: 30s
nginx.ingress.kubernetes.io/proxy-send-timeout: 20s
nginx.ingress.kubernetes.io/proxy-read-timeout: 20s
nginx.ingress.kubernetes.io/proxy-body-size: 50m
nginx.ingress.kubernetes.io/proxy-buffer-size: "16k"
spec:
rules:
- host: test.abc.com
http:
paths:
- path: /
backend:
serviceName: tomcat
servicePort: 8080
网友评论