<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex Galperin</title>
    <description>The latest articles on DEV Community by Alex Galperin (@alex_galperin_0cecc4a9bc2).</description>
    <link>https://dev.to/alex_galperin_0cecc4a9bc2</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2831334%2F0980c736-64e2-43b4-9b34-862a85360c00.png</url>
      <title>DEV Community: Alex Galperin</title>
      <link>https://dev.to/alex_galperin_0cecc4a9bc2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alex_galperin_0cecc4a9bc2"/>
    <language>en</language>
    <item>
      <title>How to Deploy Azure Pipeline Agent on EKS with Auto Scaling!</title>
      <dc:creator>Alex Galperin</dc:creator>
      <pubDate>Fri, 07 Feb 2025 21:29:14 +0000</pubDate>
      <link>https://dev.to/alex_galperin_0cecc4a9bc2/how-to-deploy-azure-pipeline-agent-on-eks-with-auto-scaling-5fjo</link>
      <guid>https://dev.to/alex_galperin_0cecc4a9bc2/how-to-deploy-azure-pipeline-agent-on-eks-with-auto-scaling-5fjo</guid>
      <description>&lt;p&gt;To deploy self-hosted Azure DevOps agents on Amazon EKS with KEDA-based auto-scaling, follow this step-by-step guide.&lt;br&gt;
requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;External Secrets Operator ( &lt;a href="https://external-secrets.io" rel="noopener noreferrer"&gt;https://external-secrets.io&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;KEDA ( &lt;a href="https://keda.sh/docs/2.16/scalers/azure-pipelines/" rel="noopener noreferrer"&gt;https://keda.sh/docs/2.16/scalers/azure-pipelines/&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Create the IAM Role and IAM&amp;nbsp;Policy.&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here are the AWS CLI commands to IAM Role:&lt;br&gt;
Replace&lt;br&gt;
&lt;code&gt;&amp;lt;ACCOUNT_ID&amp;gt;&lt;/code&gt; → Your AWS Account ID.&lt;br&gt;
&lt;code&gt;&amp;lt;AWS_REGION&amp;gt;&lt;/code&gt; → Your AWS region (e.g., us-east-1).&lt;br&gt;
&lt;code&gt;&amp;lt;OIDC_ID&amp;gt;&lt;/code&gt; → Your EKS OIDC ID (get it using the command below).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws iam create-role --role-name AzureDevOpsEKSRole \
    --assume-role-policy-document '{
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Federated": "arn:aws:iam::&amp;lt;ACCOUNT_ID&amp;gt;:oidc-provider/oidc.eks.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/id/&amp;lt;OIDC_ID&amp;gt;"
                },
                "Action": "sts:AssumeRoleWithWebIdentity",
                "Condition": {
                    "StringEquals": {
                        "oidc.eks.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/id/&amp;lt;OIDC_ID&amp;gt;:sub": "system:serviceaccount:&amp;lt;NAMESPACE&amp;gt;:azure-devops-agent"
                    }
                }
            }
        ]
    }'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are the AWS CLI commands to create IAM policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws iam create-policy \
    --policy-name ecr-secrets-policy \
    --policy-document '{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecr:GetDownloadUrlForLayer",
                "ecr:BatchGetImage",
                "ecr:GetAuthorizationToken",
                "ecr:DescribeRepositories",
                "ecr:ListImages",
                "ecr:BatchCheckLayerAvailability",
                "ecr:PutImage",
                "ecr:InitiateLayerUpload",
                "ecr:UploadLayerPart",
                "ecr:CompleteLayerUpload",
                "ecr:CreateRepository"
            ],
            "Resource": ["arn:aws:ecr:&amp;lt;AWS_REGION&amp;gt;:&amp;lt;ACCOUNT_ID&amp;gt;:repository/*"]
        },
        {
            "Effect": "Allow",
            "Action": "ecr:GetAuthorizationToken",
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "secretsmanager:GetSecretValue",
                "secretsmanager:DescribeSecret"
            ],
            "Resource": ["arn:aws:secretsmanager:&amp;lt;AWS_REGION&amp;gt;:&amp;lt;ACCOUNT_ID&amp;gt;:secret/*"]
        }
    ]
}'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are the AWS CLI commands to attach the policy to IAM Role:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Attach policy to role
aws iam attach-role-policy \
    --role-name AzureDevOpsEKSRole \
    --policy-arn arn:aws:iam::&amp;lt;ACCOUNT_ID&amp;gt;:policy/ecr-secrets-policy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Create Docker Image and push to AWS&amp;nbsp;ECR!&lt;/strong&gt;&lt;br&gt;
Here are the AWS CLI commands to create docker image and push to AWS ECR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ecr get-login-password --region &amp;lt;AWS_REGION&amp;gt; | docker login --username AWS --password-stdin &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com
docker build -t azure-pipeline-agent .
docker tag azure-pipeline-agent:latest &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/azure-pipeline-agent:latest
docker push &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/azure-pipeline-agent:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Create a Secret for the PAT Token&lt;/strong&gt;&lt;br&gt;
Generate a PAT (Personal Access Token) in Azure DevOps with Agent Pools (Read &amp;amp; Manage) permissions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Store the PAT Token in AWS Secrets Manager&lt;/strong&gt;&lt;br&gt;
Instead of storing the Azure DevOps Personal Access Token (PAT) directly in Kubernetes, we'll store it securely in AWS Secrets Manager and retrieve it dynamically.&lt;br&gt;
Here are the AWS CLI commands to store it securely in AWS Secrets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws secretsmanager create-secret --name azure-pipelines-secret \
--secret-string '{
  "AZP_URL": "https://dev.azure.com/YOUR_ORG",
  "AZP_TOKEN": "your_personal_access_token",
  "AZP_AGENT_NAME": "AWS-EKS-Agent-Pool"
}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Create an Agent Pool in Azure DevOps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;Azure DevOps&lt;/strong&gt; → &lt;strong&gt;Organization Settings&lt;/strong&gt; → &lt;strong&gt;Agent Pools&lt;/strong&gt;.&lt;br&gt;
Click Add Pool.&lt;br&gt;
Choose a name, e.g., AWS-EKS-Agent-Pool.&lt;br&gt;
Select Self-hosted and click Create.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Install Helm To EKS!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clone &lt;a href="https://github.com/alexg84/azure-pipeline-agent" rel="noopener noreferrer"&gt;https://github.com/alexg84/azure-pipeline-agent&lt;/a&gt; and navigate to Your Helm Chart Directory.&lt;br&gt;
Create the azure-pipeline-agent Namespace and ensure the namespace exists before deploying the Helm chart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create namespace azure-pipeline-agent
kubectl get namespaces
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /azure-pipeline-agent/agent
helm dependency build
helm install azure-pipeline-agent . -n azure-pipeline-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 7: Check Helm Release Status&lt;/strong&gt;&lt;br&gt;
Run the following command to check if Helm successfully installed the chart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm list -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the deployment is successful, you should see an entry like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                    NAMESPACE               REVISION    STATUS      CHART                 APP VERSION
azure-pipeline-agent    azure-pipeline-agent    1           deployed    my-chart-0.1.0        1.0.0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the STATUS is failed, use the following command to inspect what went wrong:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm status azure-pipeline-agent -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that the pods are running correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output (example):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                                    READY   STATUS    RESTARTS   AGE
azure-pipeline-agent-7f5d8f6dfd-abc12   1/1     Running   0          2m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the pods are not running, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe pod &amp;lt;POD_NAME&amp;gt; -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl logs &amp;lt;POD_NAME&amp;gt; -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If something is wrong, check Helm and Kubernetes events:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get events -n azure-pipeline-agent --sort-by=.metadata.creationTimestamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If needed, delete the deployment and try again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm uninstall azure-pipeline-agent -n azure-pipeline-agent
helm install azure-pipeline-agent . -n azure-pipeline-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How to Deploy Azure Pipeline Agent on EKS with Auto Scaling!</title>
      <dc:creator>Alex Galperin</dc:creator>
      <pubDate>Fri, 07 Feb 2025 19:11:08 +0000</pubDate>
      <link>https://dev.to/alex_galperin_0cecc4a9bc2/how-to-deploy-azure-pipeline-agent-on-eks-with-auto-scaling-50hj</link>
      <guid>https://dev.to/alex_galperin_0cecc4a9bc2/how-to-deploy-azure-pipeline-agent-on-eks-with-auto-scaling-50hj</guid>
      <description>&lt;p&gt;To deploy self-hosted Azure DevOps agents on Amazon EKS with KEDA-based auto-scaling, follow this step-by-step guide.&lt;br&gt;
requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;External Secrets Operator ( &lt;a href="https://external-secrets.io" rel="noopener noreferrer"&gt;https://external-secrets.io&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;KEDA ( &lt;a href="https://keda.sh/docs/2.16/scalers/azure-pipelines/" rel="noopener noreferrer"&gt;https://keda.sh/docs/2.16/scalers/azure-pipelines/&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Create the IAM Role and IAM&amp;nbsp;Policy.&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here are the AWS CLI commands to IAM Role:&lt;br&gt;
Replace&lt;br&gt;
&lt;code&gt;&amp;lt;ACCOUNT_ID&amp;gt;&lt;/code&gt; → Your AWS Account ID.&lt;br&gt;
&lt;code&gt;&amp;lt;AWS_REGION&amp;gt;&lt;/code&gt; → Your AWS region (e.g., us-east-1).&lt;br&gt;
&lt;code&gt;&amp;lt;OIDC_ID&amp;gt;&lt;/code&gt; → Your EKS OIDC ID (get it using the command below).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws iam create-role --role-name AzureDevOpsEKSRole \
    --assume-role-policy-document '{
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Federated": "arn:aws:iam::&amp;lt;ACCOUNT_ID&amp;gt;:oidc-provider/oidc.eks.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/id/&amp;lt;OIDC_ID&amp;gt;"
                },
                "Action": "sts:AssumeRoleWithWebIdentity",
                "Condition": {
                    "StringEquals": {
                        "oidc.eks.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/id/&amp;lt;OIDC_ID&amp;gt;:sub": "system:serviceaccount:&amp;lt;NAMESPACE&amp;gt;:azure-devops-agent"
                    }
                }
            }
        ]
    }'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are the AWS CLI commands to create IAM policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws iam create-policy \
    --policy-name ecr-secrets-policy \
    --policy-document '{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecr:GetDownloadUrlForLayer",
                "ecr:BatchGetImage",
                "ecr:GetAuthorizationToken",
                "ecr:DescribeRepositories",
                "ecr:ListImages",
                "ecr:BatchCheckLayerAvailability",
                "ecr:PutImage",
                "ecr:InitiateLayerUpload",
                "ecr:UploadLayerPart",
                "ecr:CompleteLayerUpload",
                "ecr:CreateRepository"
            ],
            "Resource": ["arn:aws:ecr:&amp;lt;AWS_REGION&amp;gt;:&amp;lt;ACCOUNT_ID&amp;gt;:repository/*"]
        },
        {
            "Effect": "Allow",
            "Action": "ecr:GetAuthorizationToken",
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "secretsmanager:GetSecretValue",
                "secretsmanager:DescribeSecret"
            ],
            "Resource": ["arn:aws:secretsmanager:&amp;lt;AWS_REGION&amp;gt;:&amp;lt;ACCOUNT_ID&amp;gt;:secret/*"]
        }
    ]
}'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are the AWS CLI commands to attach the policy to IAM Role:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Attach policy to role
aws iam attach-role-policy \
    --role-name AzureDevOpsEKSRole \
    --policy-arn arn:aws:iam::&amp;lt;ACCOUNT_ID&amp;gt;:policy/ecr-secrets-policy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Create Docker Image and push to AWS&amp;nbsp;ECR!&lt;/strong&gt;&lt;br&gt;
Here are the AWS CLI commands to create docker image and push to AWS ECR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ecr get-login-password --region &amp;lt;AWS_REGION&amp;gt; | docker login --username AWS --password-stdin &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com
docker build -t azure-pipeline-agent .
docker tag azure-pipeline-agent:latest &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/azure-pipeline-agent:latest
docker push &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/azure-pipeline-agent:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Create a Secret for the PAT Token&lt;/strong&gt;&lt;br&gt;
Generate a PAT (Personal Access Token) in Azure DevOps with Agent Pools (Read &amp;amp; Manage) permissions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Store the PAT Token in AWS Secrets Manager&lt;/strong&gt;&lt;br&gt;
Instead of storing the Azure DevOps Personal Access Token (PAT) directly in Kubernetes, we'll store it securely in AWS Secrets Manager and retrieve it dynamically.&lt;br&gt;
Here are the AWS CLI commands to store it securely in AWS Secrets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws secretsmanager create-secret --name azure-pipelines-secret \
--secret-string '{
  "AZP_URL": "https://dev.azure.com/YOUR_ORG",
  "AZP_TOKEN": "your_personal_access_token",
  "AZP_AGENT_NAME": "AWS-EKS-Agent-Pool"
}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Create an Agent Pool in Azure DevOps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;Azure DevOps&lt;/strong&gt; → &lt;strong&gt;Organization Settings&lt;/strong&gt; → &lt;strong&gt;Agent Pools&lt;/strong&gt;.&lt;br&gt;
Click Add Pool.&lt;br&gt;
Choose a name, e.g., AWS-EKS-Agent-Pool.&lt;br&gt;
Select Self-hosted and click Create.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Install Helm To EKS!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clone &lt;a href="https://github.com/alexg84/azure-pipeline-agent" rel="noopener noreferrer"&gt;https://github.com/alexg84/azure-pipeline-agent&lt;/a&gt; and navigate to Your Helm Chart Directory.&lt;br&gt;
Create the azure-pipeline-agent Namespace and ensure the namespace exists before deploying the Helm chart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create namespace azure-pipeline-agent
kubectl get namespaces
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /azure-pipeline-agent/agent
helm dependency build
helm install azure-pipeline-agent . -n azure-pipeline-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 7: Check Helm Release Status&lt;/strong&gt;&lt;br&gt;
Run the following command to check if Helm successfully installed the chart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm list -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the deployment is successful, you should see an entry like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                    NAMESPACE               REVISION    STATUS      CHART                 APP VERSION
azure-pipeline-agent    azure-pipeline-agent    1           deployed    my-chart-0.1.0        1.0.0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the STATUS is failed, use the following command to inspect what went wrong:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm status azure-pipeline-agent -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that the pods are running correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output (example):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                                    READY   STATUS    RESTARTS   AGE
azure-pipeline-agent-7f5d8f6dfd-abc12   1/1     Running   0          2m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the pods are not running, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe pod &amp;lt;POD_NAME&amp;gt; -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl logs &amp;lt;POD_NAME&amp;gt; -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If something is wrong, check Helm and Kubernetes events:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get events -n azure-pipeline-agent --sort-by=.metadata.creationTimestamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If needed, delete the deployment and try again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm uninstall azure-pipeline-agent -n azure-pipeline-agent
helm install azure-pipeline-agent . -n azure-pipeline-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How to Deploy Azure Pipeline Agent on EKS with Auto Scaling!</title>
      <dc:creator>Alex Galperin</dc:creator>
      <pubDate>Fri, 07 Feb 2025 19:11:07 +0000</pubDate>
      <link>https://dev.to/alex_galperin_0cecc4a9bc2/how-to-deploy-azure-pipeline-agent-on-eks-with-auto-scaling-4gi4</link>
      <guid>https://dev.to/alex_galperin_0cecc4a9bc2/how-to-deploy-azure-pipeline-agent-on-eks-with-auto-scaling-4gi4</guid>
      <description>&lt;p&gt;To deploy self-hosted Azure DevOps agents on Amazon EKS with KEDA-based auto-scaling, follow this step-by-step guide.&lt;br&gt;
requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;External Secrets Operator ( &lt;a href="https://external-secrets.io" rel="noopener noreferrer"&gt;https://external-secrets.io&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;KEDA ( &lt;a href="https://keda.sh/docs/2.16/scalers/azure-pipelines/" rel="noopener noreferrer"&gt;https://keda.sh/docs/2.16/scalers/azure-pipelines/&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Create the IAM Role and IAM&amp;nbsp;Policy.&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here are the AWS CLI commands to IAM Role:&lt;br&gt;
Replace&lt;br&gt;
&lt;code&gt;&amp;lt;ACCOUNT_ID&amp;gt;&lt;/code&gt; → Your AWS Account ID.&lt;br&gt;
&lt;code&gt;&amp;lt;AWS_REGION&amp;gt;&lt;/code&gt; → Your AWS region (e.g., us-east-1).&lt;br&gt;
&lt;code&gt;&amp;lt;OIDC_ID&amp;gt;&lt;/code&gt; → Your EKS OIDC ID (get it using the command below).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws iam create-role --role-name AzureDevOpsEKSRole \
    --assume-role-policy-document '{
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Federated": "arn:aws:iam::&amp;lt;ACCOUNT_ID&amp;gt;:oidc-provider/oidc.eks.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/id/&amp;lt;OIDC_ID&amp;gt;"
                },
                "Action": "sts:AssumeRoleWithWebIdentity",
                "Condition": {
                    "StringEquals": {
                        "oidc.eks.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/id/&amp;lt;OIDC_ID&amp;gt;:sub": "system:serviceaccount:&amp;lt;NAMESPACE&amp;gt;:azure-devops-agent"
                    }
                }
            }
        ]
    }'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are the AWS CLI commands to create IAM policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws iam create-policy \
    --policy-name ecr-secrets-policy \
    --policy-document '{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecr:GetDownloadUrlForLayer",
                "ecr:BatchGetImage",
                "ecr:GetAuthorizationToken",
                "ecr:DescribeRepositories",
                "ecr:ListImages",
                "ecr:BatchCheckLayerAvailability",
                "ecr:PutImage",
                "ecr:InitiateLayerUpload",
                "ecr:UploadLayerPart",
                "ecr:CompleteLayerUpload",
                "ecr:CreateRepository"
            ],
            "Resource": ["arn:aws:ecr:&amp;lt;AWS_REGION&amp;gt;:&amp;lt;ACCOUNT_ID&amp;gt;:repository/*"]
        },
        {
            "Effect": "Allow",
            "Action": "ecr:GetAuthorizationToken",
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "secretsmanager:GetSecretValue",
                "secretsmanager:DescribeSecret"
            ],
            "Resource": ["arn:aws:secretsmanager:&amp;lt;AWS_REGION&amp;gt;:&amp;lt;ACCOUNT_ID&amp;gt;:secret/*"]
        }
    ]
}'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are the AWS CLI commands to attach the policy to IAM Role:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Attach policy to role
aws iam attach-role-policy \
    --role-name AzureDevOpsEKSRole \
    --policy-arn arn:aws:iam::&amp;lt;ACCOUNT_ID&amp;gt;:policy/ecr-secrets-policy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Create Docker Image and push to AWS&amp;nbsp;ECR!&lt;/strong&gt;&lt;br&gt;
Here are the AWS CLI commands to create docker image and push to AWS ECR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ecr get-login-password --region &amp;lt;AWS_REGION&amp;gt; | docker login --username AWS --password-stdin &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com
docker build -t azure-pipeline-agent .
docker tag azure-pipeline-agent:latest &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/azure-pipeline-agent:latest
docker push &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/azure-pipeline-agent:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Create a Secret for the PAT Token&lt;/strong&gt;&lt;br&gt;
Generate a PAT (Personal Access Token) in Azure DevOps with Agent Pools (Read &amp;amp; Manage) permissions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Store the PAT Token in AWS Secrets Manager&lt;/strong&gt;&lt;br&gt;
Instead of storing the Azure DevOps Personal Access Token (PAT) directly in Kubernetes, we'll store it securely in AWS Secrets Manager and retrieve it dynamically.&lt;br&gt;
Here are the AWS CLI commands to store it securely in AWS Secrets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws secretsmanager create-secret --name azure-pipelines-secret \
--secret-string '{
  "AZP_URL": "https://dev.azure.com/YOUR_ORG",
  "AZP_TOKEN": "your_personal_access_token",
  "AZP_AGENT_NAME": "AWS-EKS-Agent-Pool"
}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Create an Agent Pool in Azure DevOps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;Azure DevOps&lt;/strong&gt; → &lt;strong&gt;Organization Settings&lt;/strong&gt; → &lt;strong&gt;Agent Pools&lt;/strong&gt;.&lt;br&gt;
Click Add Pool.&lt;br&gt;
Choose a name, e.g., AWS-EKS-Agent-Pool.&lt;br&gt;
Select Self-hosted and click Create.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Install Helm To EKS!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clone &lt;a href="https://github.com/alexg84/azure-pipeline-agent" rel="noopener noreferrer"&gt;https://github.com/alexg84/azure-pipeline-agent&lt;/a&gt; and navigate to Your Helm Chart Directory.&lt;br&gt;
Create the azure-pipeline-agent Namespace and ensure the namespace exists before deploying the Helm chart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create namespace azure-pipeline-agent
kubectl get namespaces
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /azure-pipeline-agent/agent
helm dependency build
helm install azure-pipeline-agent . -n azure-pipeline-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 7: Check Helm Release Status&lt;/strong&gt;&lt;br&gt;
Run the following command to check if Helm successfully installed the chart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm list -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the deployment is successful, you should see an entry like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                    NAMESPACE               REVISION    STATUS      CHART                 APP VERSION
azure-pipeline-agent    azure-pipeline-agent    1           deployed    my-chart-0.1.0        1.0.0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the STATUS is failed, use the following command to inspect what went wrong:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm status azure-pipeline-agent -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that the pods are running correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output (example):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                                    READY   STATUS    RESTARTS   AGE
azure-pipeline-agent-7f5d8f6dfd-abc12   1/1     Running   0          2m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the pods are not running, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe pod &amp;lt;POD_NAME&amp;gt; -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl logs &amp;lt;POD_NAME&amp;gt; -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If something is wrong, check Helm and Kubernetes events:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get events -n azure-pipeline-agent --sort-by=.metadata.creationTimestamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If needed, delete the deployment and try again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm uninstall azure-pipeline-agent -n azure-pipeline-agent
helm install azure-pipeline-agent . -n azure-pipeline-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How to Deploy Azure Pipeline Agent on EKS with Auto Scaling!</title>
      <dc:creator>Alex Galperin</dc:creator>
      <pubDate>Fri, 07 Feb 2025 19:11:07 +0000</pubDate>
      <link>https://dev.to/alex_galperin_0cecc4a9bc2/how-to-deploy-azure-pipeline-agent-on-eks-with-auto-scaling-49ln</link>
      <guid>https://dev.to/alex_galperin_0cecc4a9bc2/how-to-deploy-azure-pipeline-agent-on-eks-with-auto-scaling-49ln</guid>
      <description>&lt;p&gt;To deploy self-hosted Azure DevOps agents on Amazon EKS with KEDA-based auto-scaling, follow this step-by-step guide.&lt;br&gt;
requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;External Secrets Operator ( &lt;a href="https://external-secrets.io" rel="noopener noreferrer"&gt;https://external-secrets.io&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;KEDA ( &lt;a href="https://keda.sh/docs/2.16/scalers/azure-pipelines/" rel="noopener noreferrer"&gt;https://keda.sh/docs/2.16/scalers/azure-pipelines/&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Create the IAM Role and IAM&amp;nbsp;Policy.&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here are the AWS CLI commands to IAM Role:&lt;br&gt;
Replace&lt;br&gt;
&lt;code&gt;&amp;lt;ACCOUNT_ID&amp;gt;&lt;/code&gt; → Your AWS Account ID.&lt;br&gt;
&lt;code&gt;&amp;lt;AWS_REGION&amp;gt;&lt;/code&gt; → Your AWS region (e.g., us-east-1).&lt;br&gt;
&lt;code&gt;&amp;lt;OIDC_ID&amp;gt;&lt;/code&gt; → Your EKS OIDC ID (get it using the command below).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws iam create-role --role-name AzureDevOpsEKSRole \
    --assume-role-policy-document '{
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Federated": "arn:aws:iam::&amp;lt;ACCOUNT_ID&amp;gt;:oidc-provider/oidc.eks.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/id/&amp;lt;OIDC_ID&amp;gt;"
                },
                "Action": "sts:AssumeRoleWithWebIdentity",
                "Condition": {
                    "StringEquals": {
                        "oidc.eks.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/id/&amp;lt;OIDC_ID&amp;gt;:sub": "system:serviceaccount:&amp;lt;NAMESPACE&amp;gt;:azure-devops-agent"
                    }
                }
            }
        ]
    }'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are the AWS CLI commands to create IAM policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws iam create-policy \
    --policy-name ecr-secrets-policy \
    --policy-document '{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecr:GetDownloadUrlForLayer",
                "ecr:BatchGetImage",
                "ecr:GetAuthorizationToken",
                "ecr:DescribeRepositories",
                "ecr:ListImages",
                "ecr:BatchCheckLayerAvailability",
                "ecr:PutImage",
                "ecr:InitiateLayerUpload",
                "ecr:UploadLayerPart",
                "ecr:CompleteLayerUpload",
                "ecr:CreateRepository"
            ],
            "Resource": ["arn:aws:ecr:&amp;lt;AWS_REGION&amp;gt;:&amp;lt;ACCOUNT_ID&amp;gt;:repository/*"]
        },
        {
            "Effect": "Allow",
            "Action": "ecr:GetAuthorizationToken",
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "secretsmanager:GetSecretValue",
                "secretsmanager:DescribeSecret"
            ],
            "Resource": ["arn:aws:secretsmanager:&amp;lt;AWS_REGION&amp;gt;:&amp;lt;ACCOUNT_ID&amp;gt;:secret/*"]
        }
    ]
}'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are the AWS CLI commands to attach the policy to IAM Role:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Attach policy to role
aws iam attach-role-policy \
    --role-name AzureDevOpsEKSRole \
    --policy-arn arn:aws:iam::&amp;lt;ACCOUNT_ID&amp;gt;:policy/ecr-secrets-policy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Create Docker Image and push to AWS&amp;nbsp;ECR!&lt;/strong&gt;&lt;br&gt;
Here are the AWS CLI commands to create docker image and push to AWS ECR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ecr get-login-password --region &amp;lt;AWS_REGION&amp;gt; | docker login --username AWS --password-stdin &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com
docker build -t azure-pipeline-agent .
docker tag azure-pipeline-agent:latest &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/azure-pipeline-agent:latest
docker push &amp;lt;ACCOUNT_ID&amp;gt;.dkr.ecr.&amp;lt;AWS_REGION&amp;gt;.amazonaws.com/azure-pipeline-agent:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Create a Secret for the PAT Token&lt;/strong&gt;&lt;br&gt;
Generate a PAT (Personal Access Token) in Azure DevOps with Agent Pools (Read &amp;amp; Manage) permissions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Store the PAT Token in AWS Secrets Manager&lt;/strong&gt;&lt;br&gt;
Instead of storing the Azure DevOps Personal Access Token (PAT) directly in Kubernetes, we'll store it securely in AWS Secrets Manager and retrieve it dynamically.&lt;br&gt;
Here are the AWS CLI commands to store it securely in AWS Secrets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws secretsmanager create-secret --name azure-pipelines-secret \
--secret-string '{
  "AZP_URL": "https://dev.azure.com/YOUR_ORG",
  "AZP_TOKEN": "your_personal_access_token",
  "AZP_AGENT_NAME": "AWS-EKS-Agent-Pool"
}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Create an Agent Pool in Azure DevOps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;Azure DevOps&lt;/strong&gt; → &lt;strong&gt;Organization Settings&lt;/strong&gt; → &lt;strong&gt;Agent Pools&lt;/strong&gt;.&lt;br&gt;
Click Add Pool.&lt;br&gt;
Choose a name, e.g., AWS-EKS-Agent-Pool.&lt;br&gt;
Select Self-hosted and click Create.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Install Helm To EKS!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clone &lt;a href="https://github.com/alexg84/azure-pipeline-agent" rel="noopener noreferrer"&gt;https://github.com/alexg84/azure-pipeline-agent&lt;/a&gt; and navigate to Your Helm Chart Directory.&lt;br&gt;
Create the azure-pipeline-agent Namespace and ensure the namespace exists before deploying the Helm chart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create namespace azure-pipeline-agent
kubectl get namespaces
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /azure-pipeline-agent/agent
helm dependency build
helm install azure-pipeline-agent . -n azure-pipeline-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 7: Check Helm Release Status&lt;/strong&gt;&lt;br&gt;
Run the following command to check if Helm successfully installed the chart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm list -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the deployment is successful, you should see an entry like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                    NAMESPACE               REVISION    STATUS      CHART                 APP VERSION
azure-pipeline-agent    azure-pipeline-agent    1           deployed    my-chart-0.1.0        1.0.0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the STATUS is failed, use the following command to inspect what went wrong:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm status azure-pipeline-agent -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that the pods are running correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output (example):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                                    READY   STATUS    RESTARTS   AGE
azure-pipeline-agent-7f5d8f6dfd-abc12   1/1     Running   0          2m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the pods are not running, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe pod &amp;lt;POD_NAME&amp;gt; -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl logs &amp;lt;POD_NAME&amp;gt; -n azure-pipeline-agent

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If something is wrong, check Helm and Kubernetes events:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get events -n azure-pipeline-agent --sort-by=.metadata.creationTimestamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If needed, delete the deployment and try again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm uninstall azure-pipeline-agent -n azure-pipeline-agent
helm install azure-pipeline-agent . -n azure-pipeline-agent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
