

# Amazon EKS 및 Kubernetes에서 지표 익스포터가 포함된 HAProxy 설정
<a name="ContainerInsights-Prometheus-Sample-Workloads-haproxy"></a>

HAProxy는 오픈 소스 프록시 애플리케이션입니다. 자세한 내용은 [HAProxy](https://www.haproxy.org)를 참조하세요.

Fargate 시작 유형의 클러스터에서 HAProxy를 실행할 경우 이 절차의 단계를 수행하기 전에 먼저, Fargate 프로파일을 설정해야 합니다. 프로파일을 설정하려면 다음 명령을 입력합니다. *MyCluster*를 클러스터 이름으로 바꿉니다.

```
eksctl create fargateprofile --cluster MyCluster \
--namespace haproxy-ingress-sample --name haproxy-ingress-sample
```

**지표 익스포터와 함께 HAProxy를 설치하여 Container Insights Prometheus 지원을 테스트하려면**

1. 다음 명령을 입력하여 Helm 인큐베이터 리포지토리를 추가합니다.

   ```
   helm repo add haproxy-ingress https://haproxy-ingress.github.io/charts
   ```

1. 다음 명령을 입력하여 새 네임스페이스를 생성합니다.

   ```
   kubectl create namespace haproxy-ingress-sample
   ```

1. 다음 명령을 입력하여 HAProxy를 설치합니다.

   ```
   helm install haproxy haproxy-ingress/haproxy-ingress \
   --namespace haproxy-ingress-sample \
   --set defaultBackend.enabled=true \
   --set controller.stats.enabled=true \
   --set controller.metrics.enabled=true \
   --set-string controller.metrics.service.annotations."prometheus\.io/port"="9101" \
   --set-string controller.metrics.service.annotations."prometheus\.io/scrape"="true"
   ```

1. 다음 명령을 입력하여 서비스의 주석을 확인합니다.

   ```
   kubectl describe service haproxy-haproxy-ingress-metrics -n haproxy-ingress-sample
   ```

   다음과 같은 주석이 표시됩니다.

   ```
   Annotations:   prometheus.io/port: 9101
                  prometheus.io/scrape: true
   ```

**HAProxy를 제거하려면**
+ 다음 명령을 입력합니다.

  ```
  helm uninstall haproxy --namespace haproxy-ingress-sample
  kubectl delete namespace haproxy-ingress-sample
  ```