Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions Ansible/argocd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
- name: Install ArgoCD on Dedicated Instance
hosts: argocd
become: yes
tasks:
# 시스템 업데이트 및 기본 패키지 설치
- name: Update system packages
dnf:
name: '*'
state: latest
update_only: yes

- name: Install required packages
dnf:
name:
- git
- curl
- wget
- docker
state: present

# Docker 서비스 활성화
- name: Start and enable Docker service
systemd:
name: docker
state: started
enabled: yes

- name: Add ec2-user to docker group
user:
name: ec2-user
groups: docker
append: yes

# ArgoCD CLI 설치
- name: Download ArgoCD CLI
get_url:
url: https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
dest: /usr/local/bin/argocd
mode: '0755'

# ArgoCD 서버 컨테이너 실행
- name: Run ArgoCD Server
docker_container:
name: argocd-server
image: quay.io/argoproj/argocd:latest
state: started
restart_policy: always
ports:
- "9000:8080" # HTTP
- "9443:8080" # HTTPS
volumes:
- /home/ec2-user/argocd:/home/argocd
env:
ARGOCD_SERVER_INSECURE: "true" # 개발 환경용, 프로덕션에서는 false로 설정

# 초기 비밀번호 저장
- name: Wait for ArgoCD to be ready
wait_for:
port: 9000
timeout: 300

- name: Store default admin password
aws_ssm_parameter_store:
name: /gitfolio/argocd/admin/password
value: "admin" # 기본 비밀번호, 나중에 변경 필요
string_type: SecureString
region: ap-northeast-2
8 changes: 8 additions & 0 deletions Ansible/instances.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,13 @@
"Service": "jenkins",
"Type": "ec2",
"Environment": "feature-cicd"
},
{
"Name": "Gitfolio Argocd",
"InstanceId": "i-0d90c5a4633f18ed1",
"IP": "10.0.108.124",
"Service": "argocd",
"Type": "ec2",
"Environment": "feature-cicd"
}
]
102 changes: 90 additions & 12 deletions Docker/back/docker-compose.back.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# 1번 모듈
services:
auth:
platform: linux/amd64
image: aida0/gitfolio_auth:test
image: 727646500036.dkr.ecr.ap-northeast-2.amazonaws.com/gitfolio/auth:dev
container_name: gitfolio_auth
ports:
- target: 8080
Expand All @@ -10,15 +11,11 @@ services:
- target: 8080
published: 443
protocol: tcp
- target: 8080
published: 5000
protocol: tcp
networks:
- back

member:
platform: linux/amd64
image: aida0/gitfolio_member:test
image: 727646500036.dkr.ecr.ap-northeast-2.amazonaws.com/gitfolio/member:dev
container_name: gitfolio_member
ports:
- target: 8080
Expand All @@ -27,13 +24,94 @@ services:
- target: 8080
published: 444
protocol: tcp
networks:
- back
networks:
back:
driver: bridge
attachable: true

#2번 모듈
services:
resume:
platform: linux/amd64
image: 727646500036.dkr.ecr.ap-northeast-2.amazonaws.com/gitfolio/resume:dev
container_name: gitfolio_resume
ports:
- target: 8080
published: 80
protocol: tcp
- target: 8080
published: 443
protocol: tcp
networks:
- back
payment:
platform: linux/amd64
image: 727646500036.dkr.ecr.ap-northeast-2.amazonaws.com/gitfolio/payment:dev
container_name: gitfolio_payment
ports:
- target: 8080
published: 5000
published: 81
protocol: tcp
- target: 8080
published: 444
protocol: tcp
networks:
- back
networks:
back:
driver: overlay
attachable: true

#3번모듈
services:
notification:
platform: linux/amd64
image: 727646500036.dkr.ecr.ap-northeast-2.amazonaws.com/gitfolio/notification:dev
container_name: gitfolio_notification
ports:
- target: 8080
published: 80
protocol: tcp
- target: 8080
published: 443
protocol: tcp
networks:
- back
zookeeper:
platform: linux/amd64
image: zookeeper:3.6
container_name: gitfolio_zookeeper
ports:
- target: 2181
published: 2181
protocol: tcp
volumes:
- zookeeper_data:/var/lib/zookeeper/data
networks:
- back
kafka:
platform: linux/amd64
image: confluentinc/cp-kafka:7.4.0
container_name: gitfolio_kafka
ports:
- target: 9092
published: 9092
protocol: tcp
- target: 29092
published: 29092
protocol: tcp
depends_on:
- zookeeper
volumes:
- kafka_data:/var/lib/kafka/data
networks:
- back

networks:
back:
driver: overlay
attachable: true
volumes:
zookeeper_data:
kafka_data:
networks:
back:
driver: overlay
attachable: true
4 changes: 4 additions & 0 deletions Terraform/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ output "nosql_id" {
description = "ID of the NoSQL instance"
value = local.shared ? module.gitfolio_nosql[*].nosql_id : null
}
output "jenkins_instance_id" {
description = "The ID of the Jenkins EC2 instance"
value = terraform.workspace == "feature-cicd" ? module.gitfolio_cicd[0].jenkins_instance_id : null
}
Loading