이 섹션에서는 포드 시작 시간과 관련된 일반적인 Cloud Service Mesh 문제와 해결 방법을 설명합니다. 추가 지원이 필요하면 지원 받기를 참조하세요.
포드 시작 및 Envoy 구성 동기화
일부 Cloud Service Mesh 및 Istio 환경에서 포드 시작 중에 발생하는 일반적인 문제는 애플리케이션 준비와 Envoy 프록시 구성 간의 동기화와 관련됩니다. 이 문제는 애플리케이션 컨테이너와 Envoy 사이드카가 동시에 시작되어 발생합니다. 애플리케이션은 Envoy 프록시가 초기화를 완료하고 컨트롤 플레인에서 구성을 수신하기 전에 준비를 알릴 수 있습니다. 이렇게 하면 수신 요청이 트래픽을 수신할 준비가 되지 않은 구성되지 않은 Envoy 프록시로 전달되는 경합 상태가 발생합니다. 이로 인해 트래픽을 전달할 사이드카가 없어지므로 애플리케이션 시작 초기 단계에서 요청이 삭제되거나 잘못 라우팅되거나 잘못 처리될 수 있습니다.
완화 전략
다음 섹션에서는 이 문제를 완화할 수 있는 방법을 설명합니다.
전역 메시 구성: holdApplicationUntilProxyStarts
첫 번째 옵션은 Istio 메시 구성에서 holdApplicationUntilProxyStarts: true를 설정하는 것입니다. 이 옵션은 기본적으로 사용 중지되어 있습니다. 이 플래그는 포드의 프록시가 트래픽을 수락할 준비가 될 때까지 애플리케이션 시작을 지연하는 후크를 추가합니다.
구성을 추가하면 이 경합은 제거되지만 이전에 사용 설정되지 않은 경우 새 포드의 애플리케이션 준비 시간이 지연될 수 있습니다.
준비 상태 프로브
또 다른 해결 방법은 애플리케이션 및 Envoy 상태 점검을 모두 통합하는 준비 프로브를 구현하는 것입니다. 준비 프로브는 포드가 트래픽을 수락할 준비가 되었음을 Kubernetes에 알립니다. 중요한 점은 준비 프로브 로직이 애플리케이션 준비뿐만 아니라 Envoy 프록시 상태도 확인해야 한다는 것입니다. Envoy의 관리자 포트에서 상태를 쿼리하여 확인할 수 있습니다. 두 점검을 결합하면 Kubernetes는 애플리케이션과 Envoy가 모두 완전히 초기화되고 구성될 때까지 트래픽이 포드로 전달되지 않도록 않습니다.
이 방식은 더 유연하고 더 복잡한 시작 및 준비 논리를 허용하지만 그만큼 더 복잡해집니다.
apiVersion:v1kind:Podmetadata:name:my-app-with-envoyspec:containers:-name:application<…>
readinessProbe:initialDelaySeconds:15periodSeconds:10failureThreshold:3exec:command:-/healthcheck.sh# using the script-name:envoy<…>
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Pod startup time\n================\n\nThis section explains common Cloud Service Mesh problems with pod startup\ntime and how to resolve them. If you need additional assistance, see\n[Getting support](/service-mesh/v1.24/docs/getting-support).\n\nPod startup and Envoy configuration synchronization\n---------------------------------------------------\n\nA common issue observed during pod startup in some Cloud Service Mesh and\nIstio environments involves the synchronization between application readiness\nand Envoy proxy configuration. The problem arises from the concurrent startup\nof the application container and the Envoy sidecar. The application may signal\nreadiness before the Envoy proxy has completed its initialization and received\nits configuration from the control plane. This creates a race condition where\nincoming requests are directed to an unconfigured Envoy proxy that is not ready\nto receive any traffic. This can lead to requests being dropped, misrouted, or\nhandled incorrectly during the initial phase of application startup, since there\nis no sidecar to forward any traffic.\n\nMitigation strategies\n---------------------\n\nThe following sections describe methods that can mitigate this issue.\n\n### Global mesh configuration: `holdApplicationUntilProxyStarts`\n\nThe first option is to set `holdApplicationUntilProxyStarts: true` in the Istio\nmesh configuration. Note that it is off by default. The flag adds hooks to delay\napplication startup until the pod's proxy is ready to accept traffic.\n\nAdding the configuration eliminates this race but may introduce a delay to\napplication readiness times for new pods if it was not previously enabled.\n\n### Readiness probes\n\nAnother solution is to implement\n[readiness probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)\nthat incorporate both application and Envoy health checks. Readiness probes\ninform Kubernetes when a pod is ready to accept traffic. Critically, the\nreadiness probe logic should verify not only the application's readiness but\nalso the Envoy proxy's status. This can be achieved by querying Envoy's administrator\nport for its health status. By combining both checks, Kubernetes prevents\ntraffic from being directed to the pod until both the application and Envoy are\nfully initialized and configured.\n\nThis approach is more flexible and allows for more complicated startup and\nreadiness logic, but it comes at the cost of more complexity.\n\nCreate the file `healthcheck.sh` from the following code: \n\n #!/bin/sh\n APP_HEALTH=$(curl -s -o /dev/null -w \"%{http_code}\" \\\n http://localhost:8080/health)\n ENVOY_HEALTH=$(curl -s -o /dev/null -w \"%{http_code}\" \\\n http://localhost:9901/ready)\n\n if [[ \"$APP_HEALTH\" -eq 200 && \"$ENVOY_HEALTH\" -eq 200 ]]; then\n exit 0\n else\n exit 1\n fi\n\nReplace the IP/ports with your application container and Envoy's.\n\nThe following YAML file defines a readiness probe that uses the script you\npreviously create: \n\n apiVersion: v1\n kind: Pod\n metadata:\n name: my-app-with-envoy\n spec:\n containers:\n - name: application\n \u003c...\u003e\n readinessProbe:\n initialDelaySeconds: 15\n periodSeconds: 10\n failureThreshold: 3\n exec:\n command:\n - /healthcheck.sh # using the script\n - name: envoy\n \u003c...\u003e\n\nWhat's next\n-----------\n\n- [Learn more about `holdApplicationUntilProxyStarts`](https://istio.io/latest/docs/reference/config/istio.mesh.v1alpha1/#ProxyConfig-hold_application_until_proxy_starts)"]]