본문 바로가기

공부/AWS66

[AWS EKS] CoreDNS Addon을 FARGATE로 띄우기 (w. Terraform) # 0. 서론eks의 모든 노드들을 카펜터로 띄우기 시작했다.카펜터가 아닌 노드가 없기 때문에 karpenter 자체는 fargate로 띄워야만 했다.여기까지는 managed node group > karpenter로 마이그레이션하다가 알게 된 것이고.. 카펜터만 띄우는 설정으로 새로 클러스터를 띄우다보니 coredns가 karpenter보다 먼저 떠야 한다는 것을 알게 되었다.(카펜터도 내부 dns에 의존하는 무언가가 있나보다. 더 자세히 알아보진 않았다.) 따라서 karpenter와 마찬가지로 coredns도 fargate로 띄우도록 설정을 변경하게 되었다.이 때 필요한 과정을 terraform으로 설명하겠다. # 1. coredns fargate profile 생성locals { cluster_n.. 2024. 4. 28.
[AWS EKS] 클러스터 보안그룹 vs 추가 보안그룹 (Cluster SG vs Additional SG) # 결론클러스터 보안그룹과 추가 보안그룹은 다르다.클러스터 보안그룹 (EKS 생성 시 자동 생성되며, self rule도 자동으로 생성되어 있음) 은 eks api로 만든 컴퓨팅 리소스 (fargate, managed ec2 node group) 들에 적용된다.즉,컨트롤플레인의 cross-eni : 클러스터 보안그룹 & 추가 보안그룹 사용fargate, managed node group 노드 : 클러스터 보안그룹 사용자체 런치템플릿 사용한 managed node group, self managed 노드 : 커스텀 보안그룹 사용 (내가 지정하는걸로) # 일단 용어정리클러스터 보안그룹 : eks 클러스터 생성 시 자동으로 생성되는 "Cluster security group"추가 보안그룹 : eks 클러스터 .. 2024. 4. 28.
[AWS/EC2/Quota] You have requested more vCPU capacity than your current vCPU limit of 64 allows for the instance bucket that the specified instance type belongs to. p4d.24xlarge EC2를 만들 일이 있었는데, 아래와 같은 에러가 났다. Instance launch failed You have requested more vCPU capacity than your current vCPU limit of 64 allows for the instance bucket that the specified instance type belongs to. Please visit http://aws.amazon.com/contact-us/ec2-request to request an adjustment to this limit. Instance launch failed You have requested more vCPU capacity than your current vCPU.. 2024. 4. 11.
[AWS SNS/꼼수] Confirm되지 않은 Email Subscription 의 ARN 알아내기 # 상황 SNS Topic과 Email 구독 등을 만들어보고, 테라포밍을 진행하려고 한다. 이 때 이미 만들어진 리소스들은 import를 해야하고, SNS Subscription 의 import를 위해서는 ARN을 알아야 한다. 그러나 안타깝게도 아직 confirm되지 않은 구독은 ARN을 확인할 수 없다. 그러나 그냥 Request confirmation (컨펌 해달라고 메일 또 보내는건듯) 을 눌러보면... 위에 ARN이 뜬다.. 별거 아니지만 나름 꿀팁(?) 이라 정리.... 끝 2023. 11. 20.
[Lambda/Python/Slack] 가볍게 슬랙 메세지 보내기 Slack App을 만들고, Incoming Webhook을 원하는 채널에 생성해둔다. import json import urllib3 SLACK_URL = "https://hooks.slack.com/services/.../.../..." MESSAGE = "Lambda Trigger Test" def lambda_handler(event, context): message = { 'text': MESSAGE } http = urllib3.PoolManager() response = http.request('POST', SLACK_URL, body=json.dumps(message).encode('utf-8'), headers={'Content-Type': 'application/json'}) if re.. 2023. 5. 30.
[AWS] ELB Target Group - IP & Instance Type 억까 https://docs.aws.amazon.com/ko_kr/elasticloadbalancing/latest/network/load-balancer-target-groups.html#registered-targets Network Load Balancer 대상 그룹 - Elastic Load Balancing Network Load Balancer 대상 그룹 각 대상 그룹은 하나 이상의 등록된 대상에 요청을 라우팅하는 데 사용됩니다. 리스너를 생성할 때 기본 작업에 대한 대상 그룹을 지정합니다. 트래픽은 리스너 규칙 docs.aws.amazon.com IP & Instance Type : C1, CC1, CC2, CG1, CG2, CR1, G1, G2, HI1, HS1, M1, M2, M3, T1 인스.. 2023. 5. 24.
[MSK Connector] Bigquery용 Connector 구성 BigQuery용 MSK Connector를 만드는 레퍼런스가 거의 없어서 챗지피티 도움을 많이 받았다. GCP Key File을 AWS Secret Manager에 등록해둔 후 Connector에서 해당 시크릿을 읽어오는 식으로 만들면 된다. Connector configuration file connector.class=com.wepay.kafka.connect.bigquery.BigQuerySinkConnector autoCreateTables=true tasks.max=2 topics={TOPIC명} project={PROJECT명} gcp.secret={SECRET MANAGER ARN} defaultDataset={DATASET명} MSK Connector용 IAM Role에 해당 시크릿을 D.. 2023. 5. 9.
[AWS] Session Manager 중앙 집중식 로깅 구현 : SSM Session Manager Cross Account S3 Logging Session Manager Logging은 세션 접속한 동안의 명령까지도 모두 로깅으로 남는다. Multi Account AWS 환경에서 각 계정의 Session Manager Logging을 로깅 계정의 S3로 쌓도록 설정해보자. Encrypt 설정은 하지 않는다. 하게 되면 S3 Bucket 정책 등이 달라져야 할 것이다. # Architecture # 1. SSM Logging 설정 Console에서 하는 법 Systems Manager > Session Manager > Preferences 에서 설정 가능 (CLI, IaC등 API로는 불가) Bucket 이름과 Prefix를 지정해준다 API(CLI or IaC)로 하는 법 SSM-SessionManagerRunShell 문서를 직접 수정 C.. 2022. 8. 28.
[AWS] ElastiCache RI API로 구매하기 (AWSCLI, Python boto3) AWS Console에서 ElastiCache RI 구입 시엔 아래와 같이 Engine, Node type, Term, Offering Type만 지정해주면 된다 (node ID : 그냥 이름 정할거면 정하라는 것) 그러나 CLI나 SDK로 다량구매를 하고싶어 찾아보니,,,, https://docs.aws.amazon.com/ko_kr/AmazonElastiCache/latest/red-ug/reserved-nodes-purchasing.html 예약 노드 구입 - Amazon ElastiCache for Redis 예, 구매를 선택하면 선택한 예약 노드에 요금이 부과됩니다. 요금이 부과되지 않도록 하려면 [Cancel]을 선택합니다. docs.aws.amazon.com engine이나 node type.. 2022. 5. 29.
[AWS 리소스 초기화] aws-nuke in MAC aws-nuke 란? AWS 내의 리소스들을 한꺼번에 날릴 수 있는 오픈소스 https://github.com/rebuy-de/aws-nuke GitHub - rebuy-de/aws-nuke: Nuke a whole AWS account and delete all its resources. Nuke a whole AWS account and delete all its resources. - GitHub - rebuy-de/aws-nuke: Nuke a whole AWS account and delete all its resources. github.com MAC에서 사용하기 여러 방법이 있지만,,,더 편하게 사용하기 위해 MacPorts를 받았다 https://www.macports.org/install.. 2022. 5. 19.