Typically, service and pod cluster of IP network can be accessed. All external access traffic is discarded or forwarded elsewhere. ingress is to allow inbound connections to reach set of rules Cluster service may provide the URL to access external services, traffic load balancing, ssl connection can be terminated, and based virtual host configuration.
k8s ingress configuration official website link: https: //github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/annotations.md
When sonar-scanner project analysis go, the outcome document of more than 1M (nginx ingress controller defined by default upload size), can not be uploaded to the sonarqube, it is necessary to change the nginx configuration client_max_body_size size, specific changes ingress file, as follows
For a single ingress
[root@master24 021-sonarqube]# cat sonarqube-ing.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: sonarqube
namespace: default
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "5M"
spec:
rules:
- host: tests.sonar.com
http:
paths:
- backend:
serviceName: sonarqube
servicePort: 9000
path: /
Notice nginx.ingress.kubernetes.io
to ingress-nginx
the startup parameter settings:
--annotations-prefix=nginx.ingress.kubernetes.io
For all ingress
[root@master24 002-nginx-ingress-controller]# cat nginx-ingress-cm.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-custom-configuration
namespace: kube-system
labels:
k8s-app: nginx-ingress-controller
data:
proxy-body-size: "5m"