controller:
image:
registry: docker.io
image: k8smirror/ingress-nginx-controller
admissionWebhooks:
patch:
image:
registry: docker.io
image: k8smirror/ingress-nginx-kube-webhook-certgen
defaultBackend:
image:
registry: docker.io
image: k8smirror/defaultbackend-amd64
opentelemetry:
image:
registry: docker.io
image: k8smirror/ingress-nginx-opentelemetry
replicaCount: 2
resources:
requests:
cpu: 4
memory: 4Gi
limits:
cpu: 4
memory: 4Gi
ingressClass: ingress-nginx
ingressClassResource:
name: ingress-nginx
controllerValue: k8s.io/ingress-nginx
service:
annotations:
service.kubernetes.io/tke-existed-lbid: 'lb-xxxxxxxx'
service.cloud.tencent.com/direct-access: "true"
extraInitContainers:
- name: sysctl
image: busybox
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
command:
- sh
- -c
- |
sysctl -w net.core.somaxconn=65535 # 调大链接队列,防止队列溢出
sysctl -w net.ipv4.ip_local_port_range="1024 65535" # 扩大源端口范围,防止端口耗尽
sysctl -w net.ipv4.tcp_tw_reuse=1 # TIME_WAIT 复用,避免端口耗尽后无法新建连接
sysctl -w fs.file-max=1048576 # 调大文件句柄数,防止连接过多导致文件句柄耗尽
resources:
requests:
cpu: 0.1
memory: 100Mi
limits:
cpu: 0.1
memory: 100Mi
config:
keep-alive-requests: "1000"
upstream-keepalive-connections: "2000"
max-worker-connections: "65536"
access-log-path: /var/log/nginx/nginx_access.log
error-log-path: /var/log/nginx/nginx_error.log
proxy-body-size: 100m
proxy-connect-timeout: "60"
proxy-read-timeout: "60"
proxy-send-timeout: "60"
log-format-upstream:
$remote_addr - $remote_user [$time_iso8601] $msec "$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 $namespace $ingress_name
$service_name $service_port $http_x_forwarded_for $host
compute-full-forwarded-for: "true"
forwarded-for-header: "X-Forwarded-For"
use-forwarded-headers: "true"
large-client-header-buffers: "4 64k"
allow-snippet-annotations: "true"
ssl-ciphers: ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA
ssl-protocols: TLSv1.3 TLSv1.2 TLSv1.1 TLSv1
extraEnvs:
- name: TZ
value: Asia/Shanghai
extraVolumes:
- name: log
emptyDir: {}
extraVolumeMounts:
- name: log
mountPath: /var/log/nginx
extraContainers:
- name: logrotate
image: imroc/logrotate:latest
imagePullPolicy: IfNotPresent
env:
- name: LOGROTATE_FILE_PATTERN
value: "/var/log/nginx/nginx_*.log"
- name: LOGROTATE_FILESIZE
value: "100M"
- name: LOGROTATE_FILENUM
value: "3"
- name: CRON_EXPR
value: "*/1 * * * *"
- name: CROND_LOGLEVEL
value: "8"
volumeMounts:
- name: log
mountPath: /var/log/nginx
resources:
requests:
cpu: 0.1
memory: 100Mi
limits:
cpu: 0.1
memory: 100Mi
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 50
targetMemoryUtilizationPercentage: 50
behavior:
scaleUp:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 900
periodSeconds: 15
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Pods
value: 1
periodSeconds: 600