> For the complete documentation index, see [llms.txt](https://portfolio.litovchenko.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://portfolio.litovchenko.net/projects/argocd+terraform-eks.md).

# ArgoCD+Terraform=EKS

{% embed url="<https://github.com/serglit72/argocd-devops.git>" %}
GitHub Repository for App Deployments, Manifests (Used for Application for Applications pattern)
{% endembed %}

{% embed url="<https://github.com/serglit72/argocd-eks.git>" %}
GitHub Repository for  EKS cluster configuration using Terraform&#x20;
{% endembed %}

<figure><img src="/files/wiYg5QP5jGPGKkwyJDYh" alt=""><figcaption><p>Application for Applications deployment patter</p></figcaption></figure>

#### Prerequisites

Before deploying ArgoCD, you must have the following:

* An AWS account with permissions to create EKS clusters and associated resources
* `kubectl` and `aws` CLI tools installed and configured
* A domain name and SSL certificate for the ArgoCD server (optional)
* eksctl installed NOTE! eksctl created a kubectl config file in \~/.kube or added the new cluster's configuration within an existing config file in \~/.kube.

Create a EKS using file "eks\_cluster\_dev.yaml"

```
eksctl create cluster -f eks_cluster_dev.yaml
```

Repeat tasks for PROD claster when ready:

```
eksctl create cluster -f eks_cluster_prod.yaml
```

#### Deployment Steps

1. Go to the "cluster\_conf" folder and run eksctl commands to create EKS clusters:

Create EKS clusters in the desired environment (dev, stage, or prod)

```
cd cluster_conf
eksctl create cluster -f eks_cluster_dev.yaml
```

it takes 5-10 mins to get it ready.

2. Configure `kubectl` to use the new cluster. To switch to another cluster use the corresponding cluster name

```
aws eks update-kubeconfig --name dev
```

3. Deploy the ArgoCD server and API components

```
cd terraform
terraform init
terraform plan
terraform apply
```

4. Once deployed go to get Password for ArgoCD (repeat it for DEV, STAGE and PROD env)

```
kubectl get secret -n argocd argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
```

In output: v7zsMfACEB6TBllN #example KfeEDzCCv4-BBLLq

5. Configure the ArgoCD server with the desired settings (SSH keys generating)

```
cd terraform 
mkdir keys
cd keys && ssh-keygen

<output: > Generating public/private rsa key pair.
Enter file in which to save the key (/Users/serg/.ssh/id_rsa): argocd
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in argocd
Your public key has been saved in argocd.pub
......
```

Then copy PUBLIC KEY to GitHub repo in Settings / Deploy keys

```
cd keys && cat argocd.pub
```

And PRIVATE KEY to ArgoCD Settings/Repository/Connect (for ALL environments will be set up the SAME Private Key)

6. (Optional) Set up a domain name and SSL certificate for the ArgoCD server


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://portfolio.litovchenko.net/projects/argocd+terraform-eks.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.
