ingress-nginx-controller configmap 의 설정으 변경하면 된다. nginx pod 재기동도 필요 없다.
1. 기본 로그 출력
20.108.82.216 - - [01/Aug/2026:03:37:10 +0000] "GET /core/hostname HTTP/1.1" 200 26 "-" "curl/7.61.1" 115 0.007 [anotherclass-322-core-3222-80] [] 20.108.82.208:8080 26 0.007 200 d29a6bfd8b8e5154a18ece4f0a92efb0
2. 변경
$ kubectl -n ingress-nginx edit cm ingress-nginx-controller
...
data:
log-format-upstream: '[$time_local] Remote[$remote_addr] $http_user_agent -> Service[$service_name] -> Pod[$upstream_addr] : $request $content_type Sta[$upstream_status] ReqLen[$request_length] ResLen[$upstream_response_length] Dur[$upstream_response_time]'
...
3. 확인
[01/Aug/2026:03:38:10 +0000] Remote[20.108.82.216] curl/7.61.1 -> Service[core-3222] -> Pod[20.108.82.208:8080] : GET /core/hostname HTTP/1.1 - Sta[200] ReqLen[115] ResLen[26] Dur[0.011]
참고: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/log-format/
Log format - Ingress-Nginx Controller
Log format The default configuration uses a custom logging format to add additional information about upstreams, response time and status. log_format upstreaminfo '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_refe
kubernetes.github.io
'Kubernetes' 카테고리의 다른 글
| [KUBERNETES] Longhorn 으로 Block Storage 서버 구성하기 (0) | 2026.08.06 |
|---|---|
| [KUBERNETES] ingress nginx 타임존 변경하기 (0) | 2026.08.01 |
| [KUBERNETES] ingress-nginx-controller 의 로드밸런싱 정책을 ewma 로 변경하기 (0) | 2026.08.01 |
| [KUBERNETES] Ingress 에서 base path 를 기준으로 연결 Service 구분하기 (0) | 2026.08.01 |
| [KUBERNETES] Ingress 에서 http 요청을 https + 특정 포트로 리다이렉트 하기 (0) | 2026.07.29 |