Skip to content

Commit

Permalink
Merge pull request #22 from caiocsgomes/feature-argo-first-setup
Browse files Browse the repository at this point in the history
Adding argocd bootstrap workflow
  • Loading branch information
caiocsgomes authored Jun 9, 2024
2 parents 806bff4 + 3a258a4 commit 9541ac5
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/argo-cd-botstrap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# TODO: trigger this as a dispatch after apply is finished
# TODO: Add argocd as an app using kubectl
name: "Bootstrap Argo CD"

on:
workflow_run:
workflows: [terrafprm-apply]
types:
- completed
jobs:
argo_cd:
runs-on: ubuntu-latest
environment: prod
steps:
- name: configure aws credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ secrets.AWS_REGION }}
- id: install-aws-cli
uses: unfor19/install-aws-cli-action@v1
with:
version: 2 # default
verbose: false # default
arch: amd64 # allowed values: amd64, arm64
- name: verify aws profile
run: |
aws sts get-caller-identity
aws configure list
- name: install kubectl
uses: azure/k8s-set-context@v1
with:
install-kubectl: true
version: '1.29'
- name: configure kubectl
run: |
aws eks update-kubeconfig --name ${{ secrets.EKS_CLUSTER_NAME }} --region ${{ secrets.AWS_REGION }}
- name: install argocd
run: |
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
10 changes: 5 additions & 5 deletions terraform/environments/prod/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ data "aws_eks_cluster_auth" "default" {
name = module.eks.cluster_name
}

provider "kubernetes" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.default.token
}
# provider "kubernetes" {
# host = module.eks.cluster_endpoint
# cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
# token = data.aws_eks_cluster_auth.default.token
# }

module "eks" {
source = "terraform-aws-modules/eks/aws"
Expand Down

0 comments on commit 9541ac5

Please sign in to comment.