[EKS] Fargate Profile

Hyun-Sung Kim·2025년 1월 3일

Kubernetes

목록 보기
4/24

EKS에서 Pod 배포를 EC2 node가 아닌, fargate에 스케쥴링 하기 위해서는 'Fargate Profile'을 사전에 구성해야 한다.

Fargate Profile 생성 (웹 콘솔)

  • Namespace 별로, Fargate Profile을 추가 생성

<구성 예시>

  • (System pod용) Fargate Profile 재 구성
    : namespace별로 pod가 배치되도록, Pod selector의 'Match label'을 각 namesapce의 이름에 따라 지정

  • Fargate Profile 이름 : xxx
  • Pod execution role : 해당 프로필을 통해 Pod를 실행할 수 있는 권한을 할당
  • Subnet : Private 서브넷만 선택

  • Namespace별 알맞은 match label 지정
\NameSpaceMatch label(key)Match label(value)
fp-mtsg-dnskube-systemk8s-appkube-dns
fp-mtsg-LBcontrolkube-systemapp.kubernetes.io/nameaws-load-balancer-controller
fp-mtsg-metrics-serverkube-systemk8s-appmetrics-server
fp-mtsg-monitoringfargate-container-insights
fp-mtsg-pca-issueraws-pca-issuerapp.kubernetes.io/instanceaws-pca-issuer
fp-mtsg-cert-managercert-managerapp.kubernetes.io/instancecert-manager
fp-mtsg-app-qaqak8s-appqa
fp-mtsg-app-rvrvk8s-apprv
fp-mtsg-app-live-bklive-bk
fp-mtsg-app-live-authlive-auth
fp-mtsg-app-live-exchlive-exchange

Fargate Profile 생성 (command)

# Fargate Profile 생성
    eksctl create fargateprofile --cluster my-cluster --name my-fargate-profile --namespace my-kubernetes-namespace --labels key=value
    
# Fargate Profile 조회
    eksctl get fargateprofile --cluster my-cluster

# Fargate Profile 조회 결과를 yaml 포맷으로 출력    
    eksctl get fargateprofile --cluster my-cluster -o yaml
  • command 적용 예
    • eksctl create fargateprofile --cluster eks-cluster-01 --name fp-dns --namespace kube-system --labels k8s-app=kube-dns
    • eksctl create fargateprofile --cluster eks-cluster-01 --name fp-LBcontrol --namespace kube-system --labels app.kubernetes.io/name=aws-load-balancer-controller
    • eksctl create fargateprofile --cluster eks-cluster-01 --name fp-metrics-server --namespace kube-system --labels k8s-app=metrics-server
    • eksctl create fargateprofile --cluster eks-cluster-01 --name fp-app-qa --namespace qa --labels k8s-app=qa
    • eksctl create fargateprofile --cluster eks-cluster-01 --name fp-app-live --namespace live --labels k8s-app=live


Fargate Profile 삭제

  • 기존에 자동으로 생성된 default Fargate Profile을 삭제하고 싶을 때, EKS 콘솔에서 작업하거나, eksctl 명령으로 진행 가능하다.

< EKS 콘솔 >

< command 구문 >

Fargate Profile 삭제

eksctl delete fargateprofile --cluster my-cluster --name my-fargate-profile

Fargate Profile 조회

eksctl get fargateprofile --cluster my-cluster

profile
Cloud Engineer

0개의 댓글