ingress-nginx-helm/docs/examples/customization/custom-upstream-check/README.md

48 lines
978 B
Markdown
Raw Normal View History

2017-10-13 13:55:03 +00:00
# Custom Upstream server checks
This example shows how is possible to create a custom configuration for a particular upstream associated with an Ingress rule.
```
echo "
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
2017-10-13 13:55:03 +00:00
name: http-svc
annotations:
2017-11-24 18:46:51 +00:00
nginx.ingress.kubernetes.io/upstream-fail-timeout: "30"
spec:
rules:
- host: foo.bar.com
http:
paths:
- path: /
backend:
2017-10-13 13:55:03 +00:00
serviceName: http-svc
servicePort: 80
" | kubectl create -f -
```
Check the annotation is present in the Ingress rule:
```
2017-10-13 13:55:03 +00:00
kubectl get ingress http-svc -o yaml
```
Check the NGINX configuration is updated using kubectl or the status page:
```
$ kubectl exec nginx-ingress-controller-v1ppm cat /etc/nginx/nginx.conf
```
```
....
2017-10-13 13:55:03 +00:00
upstream default-http-svc-x-80 {
least_conn;
server 10.2.92.2:8080 max_fails=5 fail_timeout=30;
}
....
```
![nginx-module-vts](custom-upstream.png "screenshot with custom configuration")