K8s Exit Code: 127
2025. 2. 8. 21:03ㆍk8s
에러
State: Terminated
Reason: Error
Exit Code: 127
원인: image binary가 깨지거나 실행명령이 중지되었을 때 발생
image 정상 확인: 명령이 잘 실행되면, binary가 깨지지도, 실행명령에 문제가 없음
kubectl run --rm -it test-metricbeat --image=docker.elastic.co/beats/metricbeat:8.16.3 -- bash
# 명령 실행
metricbeat version
EntryPoint 및 Commands 확인
# Commnad 및 Args 존재하는지 확인: 없으면 default entrypoint 체크
kubectl describe pod metricbeat-55976f7767-vvf4c -n efk
# metricbeat가 없으면, image가 깨진 것
docker run --rm -it docker.elastic.co/beats/metricbeat:8.16.3 sh -c "command -v metricbeat"
결과
이번 경우는 subPath가 누락되어서 /usr/share/metricbeat 디렉토리안의 모든 파일이 없어지고, metricbeat.yml만 있었던 것이 문제 였음
# ASIS
volumeMounts:
- name: config
mountPath: /usr/share/metricbeat/metricbeat.yml
# TOBE
volumeMounts:
- name: config
mountPath: /usr/share/metricbeat/metricbeat.yml
subPath: metricbeat.yml
'k8s' 카테고리의 다른 글
K8s error: error parsing metricbeat-daemonset.yaml: error converting YAML to JSON: yaml: line 3: mapping values are not allowed in this context (0) | 2025.02.09 |
---|---|
K8s image 내용 확인 (0) | 2025.02.08 |
K8s pod 상태 확인 (0) | 2025.02.07 |
k8s namespace 생성 (0) | 2025.02.07 |
414 Request-URI Too Large on nginx (0) | 2025.01.30 |