티스토리 뷰

카테고리 없음

hi im heetae

채희태 2025. 9. 20. 20:31
728x90

terraform apply전 할것

우분투 설치

도커 설치

awscli설치 연동

sudo su

 

https://drive.google.com/drive/folders/1vzR6m_hESNYJ-EA4M-Kv5e_S0V-uOdRH?usp=sharing

 

2025_day1_gyeonggi-main - Google Drive

이 브라우저 버전은 더 이상 지원되지 않습니다. 지원되는 브라우저로 업그레이드하세요. 닫기

drive.google.com

 

bastion 연결

ssh -i ws25-bastion-key.pem -p 10100 ec2-user@<Bastion-Public-IP>

배포 전 유의사항
 CloudWatch의 Log Group이 삭제되어 있는가?
 rtb pcx는 taa 3번정도 하면 알아서 생김
배포 후 진행
 Bastion에 접속하여 RDS Table 생성
 artifact의 Green / Red 앱 모두 Secrets, Image 등의 빈 값을 제대로 채워넣기
 Artifact 디렉토리 전체 압축해서 bastion에 업로드하기.
 Green / Red Artifact(개별 dir) 압축해서 개별 S3에 업로드
 CodePipeline / ECS 확인하여 정상 배포됐는지 체크

 

https://drive.google.com/drive/folders/1gkXgZlCyGeeYlQLPd6bAvT6cHQz2B9uy?usp=sharing

 

2025_day1_gyeongbuk-main - Google Drive

이 브라우저 버전은 더 이상 지원되지 않습니다. 지원되는 브라우저로 업그레이드하세요. 닫기

drive.google.com

bastion-ec2
ssh -i <keypair>.pem ec2-user@<Bastion-Public-IP> -p 2025

ssh ec2-user@<Bastion-Public-IP> -p 2025

TAA 이후
 Firewall Routing 세팅 (세팅1참고)
 EKS Cluster 접근은 private으로 전환. no public.
 Bastion에 argocli, gh, awscli 세팅
 Bastion에 repo 넣은 후, 내부 파일들 과제지 지시대로 배치
 EKS에 ALB Ingress Controller, Fluentd, ArgoCD, Argo Repo Server 패치(세팅3참고) 적용
 Helm package 후, s3 업로드. 그리고 index, secrets 생성 (세팅2참고)
 Github에 values push하고, Argo App 배포.
App 배포 전
 helm chart의 version과 argo app의 target Revision이 일치하는지 확인.
 helm 배포 전 index 넣어주면 좋음. (세팅2참고)
채점 전 체크리스트
 VPC Endpoint에서 vpce-svc가 3개인지 확인.
 EKS Cluster가 Private 모드인지 확인.
 Bastion에서 ifconfig.me가 timeout 되는지 확인.
 S3, ec2-user 디렉토리에 과제지에서 명시한 파일이 적절하게 위치해있는지 확인.
 K8s pods에 app label이 잘 구성되어 있는지 확인.
 ELB가 잘 구성되었는지 확인. 만약 이상하다면, 비상 ingress 사용해서 어떻게든 되게 만들어야 함.
 OpenSearch index-pattern이 app-log이고, 템플릿대로 로그 수집되었는지, health는 안 받아오는지 확인해야 함.
 Container Insights가 정상인지 확인해야 함. -> CW에서 대시보드 확인.
세팅
(세팅1) Firewall Route 설정하기
igw RTB 생성
(igw-rtb) edge 연결로 igw 잡고, hub public subnet들의 cidr 값과 firewall vpce 매핑
(firewall-rtb) 0.0.0.0/0 - igw conn
(pub-rtb 2개 모두) 0.0.0.0/0을 AZ에 맞는 firewall vpce와 연동.
(세팅2) Helm Tips
Commands. 아래 s3a는 예시 repo name이므로 자유롭게 수정하셔도 됩니다.

# Helm packaging
helm package app/

# Install Helm-s3 plugin
helm plugin install https://github.com/hypnoglow/helm-s3.git

# Init S3 helm repo
helm s3 init s3://<bucket-name>/app

# Add helm repo (S3 protocol)
helm repo add s3a s3://<bucket-name>/app

# Pull s3a repo
helm pull s3a/app --version "1.0.0"

# Push helm chart to s3 repo
helm s3 push app-1.0.0.tgz s3a # --force if u get err

# Generate helm chart index
helm repo index . --url s3://<bucket-name>/app
aws s3 cp index.yaml s3://<bucket-name>/app

# Regenerate helm chart index
helm s3 reindex s3a
만약 Helm chart 업데이트 했는데 반영 안되면 App 리스트 페이지에서 Hard refresh 할 수 있음.

(세팅3) Argo Repo Server Patch 적용하기
cd app-files/k8s
kubectl -n argocd patch deployment argocd-repo-server --patch-file patch-argo-reposerver.yaml
(세팅4) OpenSearch 딸깍하기
opensearch-create-examplelog.sh 한번 실행 후, OpenSearch에서 index pattern 생성하면 됨.
그러면 11번 모두 정답 나오게 됨.

(세팅5) 죽어도 CW Container Insights 활성화하기 힘들다면?
그럴 때는 achimchan 계정 dummyeks 레포 eks.yaml eksctl로 생성하면 됨.

 

https://drive.google.com/drive/folders/1u4VSpN8FuSGhIiRSGJIgCrIup8TpSR6R?usp=sharing

 

2025_day1_gwangju-main - Google Drive

이 브라우저 버전은 더 이상 지원되지 않습니다. 지원되는 브라우저로 업그레이드하세요. 닫기

drive.google.com

 

bastion-ec2
chmod 400 <keypair>.pem
ssh -i <keypair>.pem ec2-user@<Bastion-Public-IP> -p 2222


배포 순서
 Github에 gj2025-repository 각 브랜치 따라서 Push
 terraform apply -auto-approve
 Bastion aws configure && kubeconfig update
 ALB 설치 매뉴얼에 따라 ALB Ingress Controller 설치 (D1)
 skills 네임스페이스 생성 (k create ns skills)
 External Secrets Operator 설치 (./install-external-secrets.sh)
 Secrets 배포 (kubectl apply -f k8s/external-secrets.yaml)
 ArgoCD 설치 및 접속 설정 (./argocd.sh)
 Argo Rollouts 설치 (./argo-rollouts.sh)
 ArgoCD Ingress 배포
 ArgoCD CLI 설치
 애플리케이션 배포
App 배포 후 진행
 Network firewall ISSUE 해결 (D2 참고)
주의사항
AWS ID가 하드코딩된 경우가 있음. 이 경우 오류나지 않도록 주의.
무조건 Apply 전에 vsc search 돌릴 것.
가끔 eks-cluster-sg-gj2025-eks-cluster-*에 hub vpc traffic allow 조건이 없는 경우가 있음. 이 때는 SG에서 hub vpc traffic 허용하면 됨.
Docs
D1. ALB Ingress Controller
GitHub 문서 참고: https://github.com/sigmd-com/eks-references/tree/main/3_networking/alb_ingress_controller IAM Policy에서 ec2:DescribeRouteTable Perm이 필요함. 그냥 wildcard perm 주던가 권한 추가하던가 알아서 하면 됩니다.

D2. Kubectl 변조
만약 Network firewall을 고치지 못했다면, Kubectl 변조 스크립트를 사용하면 됩니다.
반드시 root 권한으로 실행해야 합니다.

chmod +x ./alter-kubectl.sh
sudo ./alter-kubectl.sh

https://2025-korea-tp.s3.us-east-1.amazonaws.com/index.html

 

2025 클라우드컴퓨팅 선정과제

 

2025-korea-tp.s3.us-east-1.amazonaws.com

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2026/02   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
글 보관함
250x250