# 샘플 마이크로서비스 배포

이제 [X-Ray SDKs](https://docs.aws.amazon.com/xray/index.html#lang/en_us)로 측정되는 마이크로 서비스를 EKS 클러스터에 배포할 수 있는 기반이 마련되었습니다.

이 단계에서는 [front-end](https://github.com/aws-samples/eks-workshop/tree/main/content/intermediate/245_x-ray/sample-front.files) 및 [back-end](https://github.com/aws-samples/eks-workshop/tree/main/content/intermediate/245_x-ray/sample-back.files) 마이크로서비스 예제를 클러스터에 배포하겠습니다. 예제 서비스는  [X-Ray SDK for Go](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go.html)를 사용하여 측정됩니다. 현재 X-Ray는  Go, Python, Node.js, Ruby, NET과 Java 용 등의 SDK가 있습니다.

{% hint style="info" %}
자세한 내용은 링크를 참고 하십시오. <https://docs.aws.amazon.com/ko_kr/xray/latest/devguide/xray-sdk-go.html>
{% endhint %}

샘플 애플리케이션을 배포합니다.

```
kubectl apply -f https://eksworkshop.com/intermediate/245_x-ray/sample-front.files/x-ray-sample-front-k8s.yml

kubectl apply -f https://eksworkshop.com/intermediate/245_x-ray/sample-back.files/x-ray-sample-back-k8s.yml

```

배포 상태를 확인합니다.

```
kubectl describe deployments x-ray-sample-front-k8s x-ray-sample-back-k8s

```

![](/files/-MhOadgtdlLPxLUKgDHO)

서비스에 대한 상태도 확인합니다.

```
kubectl describe services x-ray-sample-front-k8s x-ray-sample-back-k8s

```

프런트 엔드 서비스가 배포되면 다음 명령을 실행하여 ELB의 엔드포인트(EXTERNAL-IP)를 확인하여 브라우저에서 엽니다.

```
kubectl get service x-ray-sample-front-k8s -o wide

```

![](/files/-MhObKHPXdunfdL_lYr9)

브라웆는 열린 상태로 유지 합니다. 프런트 엔드 애플리케이션은 초당 한 번씩 /api 끝점에 새 요청을 하고, 이 요청은 다시 백엔드 서비스를 호출합니다. 브라우저에 표시된 JSON 문서는 백엔드 서비스에 대한 요청의 결과입니다.

{% hint style="warning" %}
프런트 엔드 서비스를 처음 배포할 때 ELB를 만들고 DNS를 업데이트하는 데 최대 몇 분이 소요 될  있습니다.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wjlee81.gitbook.io/amazon-eks/untitled-11/undefined.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
