values.yaml configuration example. You can copy this example and modify it according to your needs:controller:extraInitContainers:- name: sysctlimage: busyboxsecurityContext:privileged: trueimagePullPolicy: IfNotPresentcommand:- sh- -c- |sysctl -w net.core.somaxconn=65535 # Increase connection queue to prevent queue overflowsysctl -w net.ipv4.ip_local_port_range="1024 65535" # Expand source port range to prevent port exhaustionsysctl -w net.ipv4.tcp_tw_reuse=1 # Enable TIME_WAIT reuse to avoid port exhaustion and allow new connectionssysctl -w fs.file-max=1048576 # Increase file handle count to prevent connection overflow from exhausting file handlesconfig:# The number of requests that can be processed by a persistent connection between Nginx and the client, which defaults to 100. We recommend that you increase this number in high-concurrency scenarios, but setting it too high may cause uneven load after Nginx Ingress scale-out.# Reference: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#keep-alive-requestskeep-alive-requests: "1000"# The maximum number of idle persistent connections (not the maximum number of connections) between Nginx and the upstream, which defaults to 320. We recommend that you increase this number in high-concurrency scenarios to prevent the frequent establishment of connections from significantly increasing the number of TIME_WAIT connections.# Reference: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#upstream-keepalive-connectionsupstream-keepalive-connections: "2000"# The maximum number of connections that each worker process can open, which defaults to 16384.# Reference: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#max-worker-connectionsmax-worker-connections: "65536"log-format-upstream: $remote_addr - $remote_user [$time_local] "$request"$status $body_bytes_sent "$http_referer" "$http_user_agent"$request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr$upstream_response_length $upstream_response_time $upstream_status $req_id $host# Nginx logs are written to log files to avoid high CPU usage under high concurrencyaccess-log-path: /var/log/nginx/nginx_access.logerror-log-path: /var/log/nginx/nginx_error.logextraEnvs:- name: TZvalue: Asia/ShanghaiextraVolumes:- name: logemptyDir: {}extraVolumeMounts:- name: logmountPath: /var/log/nginxextraContainers:- name: logrotateimage: imroc/logrotate:latestimagePullPolicy: Alwaysenv:- name: LOGROTATE_FILE_PATTERN # Pattern of rotated log files, matching the log file path configured in nginxvalue: "/var/log/nginx/nginx_*.log"- name: LOGROTATE_FILESIZE # Log rotation threshold sizevalue: "100M"- name: LOGROTATE_FILENUM # Number of rotations per log filevalue: "3"- name: CRON_EXPR # Crontab expression for periodic logrotate, here it runs every minutevalue: "*/1 * * * *"- name: CROND_LOGLEVEL # Crond log level, 0~8, the smaller the value, the more detailedvalue: "8"volumeMounts:- name: logmountPath: /var/log/nginxpodAnnotations:tke.cloud.tencent.com/networks: tke-route-eni # Declare the use of VPC-CNI networkresources: # Declare the use of ENI in resourcesrequests:tke.cloud.tencent.com/eni-ip: "1"limits:tke.cloud.tencent.com/eni-ip: "1"service:annotations:service.cloud.tencent.com/direct-access: "true" # Enable CLB Direct Accessautoscaling:enabled: trueminReplicas: 1maxReplicas: 10targetCPUUtilizationPercentage: 50targetMemoryUtilizationPercentage: 50behavior: # Quick scaling to handle traffic peaks, slow scaling to leave a buffer and avoid abnormal trafficscaleUp:stabilizationWindowSeconds: 300policies:- type: Percentvalue: 900periodSeconds: 15 # Allow scaling up to 9 times the current number of replicas every 15 secondsscaleDown:stabilizationWindowSeconds: 300policies:- type: Podsvalue: 1periodSeconds: 600 # Allow shrinking by only 1 pod every 10 minutestopologySpreadConstraints: # Strategy to maximize spreading- labelSelector:matchLabels:app.kubernetes.io/name: '{{ include "ingress-nginx.name" . }}'app.kubernetes.io/instance: "{{ .Release.Name }}"app.kubernetes.io/component: controllertopologyKey: topology.kubernetes.io/zonemaxSkew: 1whenUnsatisfiable: ScheduleAnyway- labelSelector:matchLabels:app.kubernetes.io/name: '{{ include "ingress-nginx.name" . }}'app.kubernetes.io/instance: "{{ .Release.Name }}"app.kubernetes.io/component: controllertopologyKey: kubernetes.io/hostnamemaxSkew: 1whenUnsatisfiable: ScheduleAnywayimage:registry: docker.ioimage: k8smirror/ingress-nginx-controlleradmissionWebhooks:patch:image: # The default image cannot be pulled domestically, it can be replaced with the mirror image on Docker Hubregistry: docker.ioimage: k8smirror/ingress-nginx-kube-webhook-certgendefaultBackend:image: # The default image cannot be pulled domestically, it can be replaced with the mirror image on Docker Hubregistry: docker.ioimage: k8smirror/defaultbackend-amd64opentelemetry:image: # The default image cannot be pulled domestically, it can be replaced with the mirror image on Docker Hubregistry: docker.ioimage: k8smirror/ingress-nginx-opentelemetry
Feedback