

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Azure DevOps 파이프라인에서 프라이빗 Amazon EKS 클러스터로 워크로드 배포
<a name="deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters"></a>

*Mahendra Revanasiddappa, Amazon Web Services*

## 요약
<a name="deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters-summary"></a>

이 패턴은 Azure DevOps 파이프라인에서 프라이빗 Amazon Elastic Kubernetes Service(Amazon EKS) 클러스터로 지속적 통합 및 지속적 전달(CI/CD)을 구현하는 방법을 보여줍니다. Amazon EKS 클러스터의 프라이빗 API 서버 엔드포인트로 전환하여 보안 태세를 강화하고 있는 조직이 직면한 중요한 문제를 해결합니다.

퍼블릭 엔드포인트는 Kubernetes API 서버를 인터넷에 직접 노출하여 악의적인 공격자가 잠재적으로 대상으로 삼을 수 있는 더 큰 공격 표면을 생성합니다. 프라이빗 엔드포인트로 전환하면 클러스터의 컨트롤 플레인에 대한 액세스가 고객의 Virtual Private Cloud(VPC) 내에서 로 제한됩니다.

Amazon EKS 클러스터를 프라이빗 API 엔드포인트로 전환하면 보안이 크게 향상되지만 Azure DevOps와 같은 외부 CI/CD 플랫폼에 연결 문제가 발생합니다. 프라이빗 엔드포인트는 클러스터의 VPC 또는 피어링된 네트워크 내에서만 액세스할 수 있습니다. 따라서 AWS 프라이빗 네트워크 외부에서 작동하는 표준 Microsoft 호스팅 Azure DevOps 에이전트는 Kubernetes API 서버에 직접 연결할 수 없습니다. 이렇게 하면 클러스터에 대한 연결을 설정하지 못하기 때문에 이러한 에이전트에서 실행되는 kubectl 또는 Helm과 같은 도구에 의존하는 일반적인 배포 워크플로가 중단됩니다.

이 문제를 해결하기 위해이 패턴은 프라이빗 Amazon EKS 클러스터 내에서 자체 호스팅된 Azure DevOps 에이전트를 사용하여 효율적인 접근 방식을 보여줍니다. 이 솔루션은 보안 요구 사항을 유지하면서 우수한 비용 최적화, 운영 효율성 및 확장성을 제공합니다. 이 접근 방식은 성능이나 보안을 손상시키지 않고 멀티 클라우드 DevOps 프로세스를 간소화하려는 기업에 특히 유용합니다.

## 사전 조건 및 제한 사항
<a name="deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters-prereqs"></a>

**사전 조건 **
+ 활성. AWS 계정
+ AWS Command Line Interface (AWS CLI) 버전 2.13.17 이상, [설치됨.](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
+ kubectl 버전 1.25.1 이상 [설치](https://kubernetes.io/docs/tasks/tools/)
+ 네임스페이스, 보안 암호 및 배포를 생성할 수 있는 권한이 있는 프라이빗 Amazon EKS 클러스터 버전 1.24 이상이 [생성](https://docs.aws.amazon.com/eks/latest/userguide/create-cluster.html)되었습니다[.](https://docs.aws.amazon.com/eks/latest/userguide/create-cluster.html)
+ Amazon EKS 클러스터의 작업자 노드를 인터넷에 아웃바운드로 연결하여 해당 노드에서 실행되는 Azure DevOps 에이전트가 Azure DevOps 에이전트 풀에 연결할 수 있도록 합니다.
+ GitHub 계정이 [생성되었습니다](https://github.com/signup).
+ Azure Pipelines과 외부 또는 원격 서비스 간의 인증된 연결인 서비스 연결을 구성할 수 있는 액세스 권한이 있는 Azure DevOps 프로젝트가 [생성됩니다](https://learn.microsoft.com/en-us/azure/devops/user-guide/sign-up-invite-teammates?view=azure-devops&tabs=microsoft-account).
+ 이전 포인트에서 설명한 Azure DevOps 프로젝트를 위해 설치된 AWS Toolkit for Azure DevOps 버전 1.15 이상입니다. 설치 지침은 Visual Studio Marketplace[AWS Toolkit for Azure DevOps](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.aws-vsts-tools)의 섹션을 참조하세요.

**제한 사항 **
+ 일부 AWS 서비스 는 전혀 사용할 수 없습니다 AWS 리전. 리전별 가용성은 [리전별AWS 서비스](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/)를 참조하세요. 구체적인 엔드포인트는 [서비스 엔드포인트 및 할당량](https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html)을 참조하고 서비스 링크를 선택합니다.

## 아키텍처
<a name="deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters-architecture"></a>

이 패턴은 다음을 생성합니다.
+ **Amazon ECR 리포지토리** - Amazon Elastic Container Registry(Amazon ECR) 리포지토리는 Azure DevOps 에이전트 및 배포된 샘플 앱과 함께 Docker 이미지를 저장합니다.
+ **Azure DevOps 에이전트 풀** - Azure DevOps 자체 호스팅 에이전트 풀은 프라이빗 Amazon EKS 클러스터에서 실행되는 에이전트를 등록합니다.
+ **IAM 역할** - 프라이빗 Amazon EKS 클러스터에서 실행 중인 에이전트에 필요한 액세스를 제공하는 Azure 서비스 연결을 위한 AWS Identity and Access Management (IAM) 역할입니다.
+ **Azure DevOps 서비스 연결** - 파이프라인 작업이에 액세스하는 데 필요한 액세스를 제공하는 IAM 역할을 사용하기 위한 Azure DevOps 계정의 서비스 연결입니다 AWS 서비스.

다음 다이어그램은 프라이빗 Amazon EKS 클러스터에 자체 호스팅된 Azure DevOps 에이전트를 배포하고 동일한 클러스터에 샘플 애플리케이션을 배포하는 아키텍처를 보여줍니다.

![\[프라이빗 Amazon EKS 클러스터에 자체 호스팅된 Azure DevOps 에이전트 및 샘플 애플리케이션 배포.\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/images/pattern-img/a965834f-a1e2-4679-bd8c-15eed4f57b55/images/ee22bd3e-311c-46e0-8024-9b7e7752080a.png)


이 다이어그램은 다음 워크플로를 보여줍니다.

1. 자체 호스팅 Azure DevOps 에이전트를 Amazon EKS 클러스터 내에 배포로 배포합니다.

1. Azure DevOps 에이전트는 인증을 위해 개인 액세스 토큰(PAT)을 사용하여 Azure DevOps 계정의 에이전트 풀에 연결합니다.

1. Azure Pipelines은 GitHub 리포지토리의 코드를 사용하여 배포하도록 파이프라인을 구성합니다.

1. 파이프라인은 파이프라인 구성에 구성된 에이전트 풀의 에이전트에서 실행됩니다. Azure DevOps 에이전트는 Azure DevOps 계정으로 지속적으로 폴링하여 파이프라인의 작업 정보를 가져옵니다.

1. Azure DevOps 에이전트는 파이프라인 작업의 일부로 Docker 이미지를 빌드하고 이미지를 Amazon ECR 리포지토리로 푸시합니다.

1. Azure DevOps 에이전트는 라는 네임스페이스의 프라이빗 Amazon EKS 클러스터에 샘플 애플리케이션을 배포합니다`webapp`.

## 도구
<a name="deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters-tools"></a>

**도구**
+ [Amazon Elastic Container Registry(Amazon ECR)](https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html)는 안전하고 확장 가능하고 신뢰할 수 있는 관리형 컨테이너 이미지 레지스트리 서비스입니다.
+ [Amazon Elastic Kubernetes Service(Amazon EKS)](https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html)를 사용하면 자체 Kubernetes 컨트롤 플레인 또는 노드를 설치하거나 유지 관리할 필요 AWS 없이에서 Kubernetes를 실행할 수 있습니다.
+ [AWS Identity and Access Management (IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html)는 AWS 리소스에 대한 액세스를 인증하고 사용할 수 있는 권한을 부여받은 사용자를 제어하여 리소스에 대한 액세스를 안전하게 관리하는 데 도움이 됩니다.

**기타 도구**
+ [Docker](https://www.docker.com/)는 운영 체제 수준의 가상화를 사용하여 컨테이너에 소프트웨어를 제공하는 서비스형 플랫폼(PaaS) 제품 세트입니다.
+ [kubectl](https://kubernetes.io/docs/tasks/tools/)는 Kubernetes 클러스터에 대해 명령의 실행을 돕는 명령줄 인터페이스입니다.

**코드 리포지토리**
+ 이 패턴의 코드는 GitHub [deploy-kubernetes-resources-to-amazon-eks-using-azure-devops](https://github.com/aws-samples/deploy-kubernetes-resources-to-amazon-eks-using-azure-devops) 리포지토리에서 사용할 수 있습니다.

## 모범 사례
<a name="deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters-best-practices"></a>
+ Amazon EKS의 경우 [Amazon EKS 모범 사례 가이드를](https://docs.aws.amazon.com/eks/latest/best-practices/introduction.html) 참조하세요.
+ 최소 권한 원칙을 따르고 작업을 수행하는 데 필요한 최소 권한을 부여하세요. 자세한 내용은 IAM 설명서의 [최소 권한 부여](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#grant-least-priv) 및 [보안 모범 사례](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)를 참조하세요.

## 에픽
<a name="deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters-epics"></a>

### 간단한 연결 만들기
<a name="create-a-service-connection"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| Azure DevOps 조직 GUID를 찾습니다. | Azure DevOps 계정에 로그인한 다음 다음 URL을 사용하여 조직 GUID를 찾습니다. URL`https://dev.azure.com/{DevOps_Org_ID}/_apis/projectCollections?api-version=6.0`에서를 Azure DevOps 조직 ID`{DevOps_org_ID}`로 바꿉니다. | DevOps | 
| 에서 IdP를 구성합니다 AWS 계정. | Azure 서비스 연결을 AWS 계정 위해에서 ID 제공업체(IdP)를 구성하려면 다음 단계를 사용합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)자세한 내용은 [ OpenID Connect를 사용하여 Azure DevOps AWS 에서 로 페더레이션하는 방법을](https://aws.amazon.com/blogs/modernizing-with-aws/how-to-federate-into-aws-from-azure-devops-using-openid-connect/) 참조하세요. | DevOps | 
|  AWS 계정을 사용하여 IAM 정책을 생성합니다. | Azure DevOps 파이프라인에서 사용하는 IAM 역할에 필요한 권한을 제공하는 IAM 정책을 생성하려면 다음 단계를 사용합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html) | DevOps | 
| 에서 IAM 역할 생성하기 | Azure 서비스 연결을 AWS 계정 위해에서 IAM 역할을 구성하려면 다음 단계를 사용합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)<pre>{<br />  "Version": "2012-10-17",		 	 	 <br />  "Statement": [<br />    {<br />      "Effect": "Allow",<br />      "Principal": {<br />        "Federated": "arn:aws:iam::{account_id}:oidc-provider/vstoken.dev.azure.com/{OrganizationGUID}"<br />      },<br />      "Action": "sts:AssumeRoleWithWebIdentity",<br />      "Condition": {<br />        "StringEquals": {<br />          "vstoken.dev.azure.com/{OrganizationGUID}:aud": "api://AzureADTokenExchange",<br />          "vstoken.dev.azure.com/{OrganizationGUID}:sub": "sc://{OrganizationName}/{ProjectName}/{ServiceConnectionName}"<br />        }<br />      }<br />    }<br />  ]<br />}</pre>정책에서 다음 자리 표시자에 대한 정보를 제공합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html) | DevOps | 
| Azure DevOps 계정에서 서비스 연결을 생성합니다. | Azure 서비스 연결을 구성하려면 다음 단계를 사용합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)자세한 내용은 Microsoft 설명서의 [서비스 연결 생성을](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops#create-a-service-connection) 참조하세요. | DevOps | 
| Amazon EKS 구성 파일에 IAM 역할을 추가합니다. | IAM 역할에는 Amazon EKS 클러스터에서 필요한 작업을 수행하는 데 필요한 권한이 있어야 합니다. 파이프라인 역할이므로 IAM 역할은 클러스터에서 거의 모든 유형의 리소스를 관리할 수 있어야 합니다. 따라서 `system:masters` 그룹 권한은이 역할에 적합합니다.Kubernetes `aws-auth ConfigMap` 내의에 필요한 구성을 추가하려면 다음 코드를 사용합니다.<pre>- groups:<br />  - system:masters<br />  rolearn: arn:aws:iam::{account_id}:role/ADO-role<br />  username: ADO-role</pre>를 AWS 계정 ID`{account_id}`로 바꿉니다.자세한 내용은 [Amazon EKS 설명서의 Amazon EKS에서 IAM을 사용하는 방법을](https://docs.aws.amazon.com/eks/latest/userguide/security-iam-service-with-iam.html#security-iam-service-with-iam-roles) 참조하세요. | DevOps | 

### 에이전트 풀 생성
<a name="create-an-agent-pool"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| 자체 호스팅 에이전트 풀을 생성합니다. | Azure DevOps 계정에서 자체 호스팅된 에이전트 풀을 구성하려면 다음 단계를 사용합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)자세한 내용은 Microsoft 설명서의 [에이전트 풀 생성 및 관리를 참조하세요](https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/pools-queues?view=azure-devops&tabs=yaml%2Cbrowser). |  | 

### Azure DevOps 에이전트 이미지 빌드 및 Amazon ECR로 푸시
<a name="build-azure-devops-agent-image-and-push-to-ecr"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| Amazon ECR 리포지토리를 생성합니다. | 프라이빗 Amazon EKS 클러스터에 Azure DevOps 에이전트 및 샘플 애플리케이션(`webapp`)을 배포하는 데 사용되는 Docker 이미지는 Amazon ECR 리포지토리에 저장되어야 합니다. 다음 단계에 따라 프라이빗 리포지토리를 생성합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)자세한 내용은 Amazon ECR 설명서의 [이미지를 저장할 Amazon ECR 프라이빗 리포지토리 생성](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-create.html)을 참조하세요. | DevOps | 
| Dockerfile을 생성하여 Azure DevOps 에이전트를 빌드합니다. | Dockerfile을 생성하여 Azure DevOps 에이전트가 설치된 Docker 이미지를 빌드합니다. 다음 콘텐츠를 `Dockerfile`라는 파일에 복사합니다.<pre><br />FROM ubuntu:22.04 <br />ENV TARGETARCH="linux-x64"<br />RUN apt update && apt upgrade -y && apt install -y curl git jq libicu70 unzip wget<br /><br />RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"<br />RUN unzip awscliv2.zip<br />RUN ./aws/install<br />RUN rm -rf aws awscliv2.zip<br /><br />RUN curl -sSL https://get.docker.com/ | sh<br /><br />RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash<br />RUN mkdir -p azp <br />WORKDIR /azp/<br /><br />COPY ./start.sh ./ <br />RUN chmod +x ./start.sh<br /><br />RUN useradd -m -d /home/agent agent <br />RUN chown -R agent:agent /azp /home/agent<br />RUN groupadd -f docker <br />RUN usermod -aG docker agent<br />USER agent<br /><br />ENTRYPOINT [ "./start.sh" ]</pre> | DevOps | 
| Azure DevOps 에이전트용 스크립트를 생성합니다. | 다음 SQL 스크립트를 사용하여 테이블을 생성합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html) | DevOps | 
| Azure DevOps 에이전트를 사용하여 Docker 이미지를 빌드합니다. | Azure DevOps 에이전트를 설치할 Docker 이미지를 생성하려면 이전에 생성한 Dockerfile을 사용하여 이미지를 빌드합니다. 파일을 저장한 디렉터리에서 다음 명령을 실행합니다.<pre>aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com<br /><br />docker build --platform linux/amd64 -t ado-agent:latest .<br /><br />docker tag ado-agent:latest aws_account_id.dkr.ecr.region.amazonaws.com/webapp:latest<br /><br />docker push aws_account_id.dkr.ecr.region.amazonaws.com/webapp:latest</pre>`aws_account_id` 및를 AWS 계정 ID 및 `region` 로 바꿉니다 AWS 리전. | DevOps | 

### 프라이빗 Amazon EKS 클러스터에 Azure DevOps 에이전트 배포
<a name="deploy-the-azure-devops-agent-to-a-private-eks-cluster"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| 개인 액세스 토큰 생성: | 프라이빗 Amazon EKS 클러스터에서 실행되는 에이전트는 Azure DevOps 계정으로 인증할 수 있도록 개인 액세스 토큰(PAT)이 필요합니다. PAT를 생성하려면 다음 단계를 사용합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)<pre>apiVersion: v1<br />kind: Secret<br />metadata:<br />  name: azdevops-pat<br />  namespace: default<br />type: Opaque<br />stringData:<br />  AZP_TOKEN: <PAT Token></pre>[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)<pre>kubectl create -f ado-secret.yaml</pre>자세한 내용은 Microsoft 설명서의 [개인 액세스 토큰(PAT)을 사용하여 에이전트 등록](https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/personal-access-token-agent-registration?view=azure-devops)을 참조하세요. | DevOps | 
| Kubernetes 배포 매니페스트 파일을 생성합니다. | 프라이빗 Amazon EKS 클러스터에 Azure DevOps 에이전트를 배포하려면 다음 매니페스트 파일을 복사하고 파일을 로 저장합니다. `agent-deployment.yaml` <pre>apiVersion: apps/v1<br />kind: Deployment<br />metadata:<br />  name: azure-pipelines-agent-eks<br />  labels:<br />    app: azure-pipelines-agent<br />spec:<br />  replicas: 1<br />  selector:<br />    matchLabels:<br />      app: azure-pipelines-agent<br />  template:<br />    metadata:<br />      labels:<br />        app: azure-pipelines-agent<br />    spec:<br />      containers:<br />      - name: docker<br />        image: docker:dind<br />        securityContext: <br />          privileged: true<br />        volumeMounts:<br />        - name: shared-workspace<br />          mountPath: /workspace<br />        - name: dind-storage<br />          mountPath: /var/lib/docker<br />        env:<br />        - name: DOCKER_TLS_CERTDIR<br />          value: ""<br />      - name: azure-pipelines-agent<br />        image: aws_account_id.dkr.ecr.region.amazonaws.com/webapp:latest<br />        env:<br />        - name: AZP_URL<br />          value: "<Azure account URL>"<br />        - name: AZP_POOL<br />          value: "eks-agent"<br />        - name: AZP_TOKEN<br />          valueFrom:<br />            secretKeyRef:<br />              name: azdevops-pat<br />              key: AZP_TOKEN<br />        - name: AZP_AGENT_NAME<br />          valueFrom:<br />            fieldRef:<br />              fieldPath: metadata.name<br />        - name: DOCKER_HOST<br />          value: tcp://localhost:2375<br />        volumeMounts:<br />        - mountPath: /workspace<br />          name: shared-workspace<br />      volumes:<br />      - name: dind-storage<br />        emptyDir: {}<br />      - name: shared-workspace<br />        emptyDir: {}</pre>`aws_account_id` 및를 AWS 계정 ID 및 Azure DevOps 계정 URL`<Azure account URL>`로 바꿉니다. | DevOps | 
| 프라이빗 Amazon EKS 클러스터에 에이전트를 배포합니다. | 프라이빗 Amazon EKS 클러스터에 Azure Devops 에이전트를 배포하려면 다음 명령을 사용합니다.<pre>kubectl create -f agent-deployment.tf</pre> | DevOps | 
|  에이전트가 실행 중인지 확인 |  에이전트가 실행 중인지 확인하려면 다음 명령을 사용합니다.<pre>kubectl get deploy azure-pipelines-agent-eks<br /></pre>출력은 다음 예시와 비슷해야 합니다.<pre><br />NAME                        READY   UP-TO-DATE   AVAILABLE   AGE<br />azure-pipelines-agent-eks   1/1     1            1           58s</pre>`READY `열에가 표시되는지 확인합니다`1/1`. | DevOps | 
| 에이전트가 Azure DevOps 에이전트 풀에 등록되어 있는지 확인합니다. | 에이전트가 프라이빗 Amazon EKS 클러스터에 배포되고 에이전트 풀에 등록되었는지 확인하려면 다음 단계를 `eks-agent`사용합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)**온라인** **상태**인 에이전트가 하나 나열되고 에이전트 이름이 **azure-pipelines-agent-eks-\$1**로 시작해야 합니다. | DevOps | 

### 샘플 애플리케이션 배포
<a name="deploy-sample-application"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| 샘플 애플리케이션 리포지토리를 GitHub 계정으로 포크합니다. | GitHub 계정에 다음 AWS 샘플 리포지토리를 포크합니다.[https://github.com/aws-samples/deploy-kubernetes-resources-to-amazon-eks-using-azure-devops](https://github.com/aws-samples/deploy-kubernetes-resources-to-amazon-eks-using-azure-devops) | DevOps | 
| 파이프라인 생성. | Azure DevOps 계정에서 파이프라인을 생성하려면 다음 단계를 사용합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)<pre>pool:<br />  name: eks-agent<br />#pool: self-hosted # If you are running self-hosted Azure DevOps Agents<br /><br />stages:<br /># Refering the pipeline template, input parameter that are not specified will be added with defaults<br />- template: ./pipeline_templates/main_template.yaml<br />  parameters:<br />    serviceConnectionName: aws-sc<br />    awsRegion: <your region><br />    awsEKSClusterName: <name of your EKS cluster><br />    projectName: webapp<br /></pre>[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html) | DevOps | 
| 샘플 애플리케이션이 실행 중인지 확인합니다. | 파이프라인이 완료되면 Amazon ECR 리포지토리와 Amazon EKS 클러스터를 모두 확인하여 샘플 애플리케이션의 성공적인 배포를 확인합니다.Amazon ECR 리포지토리에서 아티팩트를 확인하려면 다음 단계를 사용합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html)예: `20250501.1-image` 및 `20250501.1-helm`.네임스페이스의 프라이빗 Amazon EKS 클러스터에서 배포를 확인하려면 다음 명령을 `webapp`사용합니다.<pre>kubectl get deploy -n webapp </pre>예상 출력은 다음과 같습니다.<pre><br />NAME     READY   UP-TO-DATE   AVAILABLE<br />webapp   1/1     1            1           </pre>참고: 첫 번째 파이프라인 실행인 경우 서비스 연결 및 에이전트 풀을 승인해야 할 수 있습니다. Azure DevOps 파이프라인 인터페이스에서 권한 요청을 찾아 계속 진행하도록 승인합니다. | DevOps | 

## 문제 해결
<a name="deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters-troubleshooting"></a>


| 문제 | Solution | 
| --- | --- | 
| Amazon ECR 리포지토리 이름이 일치하지 않으면 파이프라인이 실패합니다. `webapp`  | 샘플 애플리케이션은 Amazon ECR 리포지토리 이름이의 `projectName: webapp` 파라미터와 일치할 것으로 예상합니다`azure_pipeline.yml`.이 문제를 해결하려면 Amazon ECR 리포지토리의 이름을 로 바꾸`webapp`거나 다음을 업데이트합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html) | 
| 오류: Kubernetes 클러스터에 연결할 수 없음: 서버에서 클라이언트에 자격 증명을 제공하도록 요청했습니다. | Azure 파이프라인의 "Helm 차트 풀 및 배포" 단계에서이 오류가 발생하는 경우 근본 원인은 일반적으로 Amazon EKS 클러스터의에서 잘못된 IAM 역할 구성으로 인해 발생합니다`aws-auth ConfigMap`.이 문제를 해결하려면 다음과 같이 실행합니다.[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters.html) | 

## 관련 리소스
<a name="deploy-workloads-from-azure-devops-pipelines-to-private-amazon-eks-clusters-resources"></a>

**AWS 블로그**
+ [OpenID Connect를 사용하여 Azure DevOps AWS 에서 로 페더레이션하는 방법](https://aws.amazon.com/blogs/modernizing-with-aws/how-to-federate-into-aws-from-azure-devops-using-openid-connect/)

**AWS 서비스 설명서**
+ [Amazon ECR](https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html)
+ [Amazon EKS](https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html)

**Microsoft 설명서**
+ [Azure DevOps란 무엇인가요?](https://learn.microsoft.com/en-us/azure/devops/user-guide/what-is-azure-devops?view=azure-devops)
+ [Azure Pipelines이란 무엇인가요?](https://learn.microsoft.com/en-us/azure/devops/pipelines/get-started/what-is-azure-pipelines?view=azure-devops)