python3이상, boto3 설치 필요
import boto3
import time
aws_profile = "your aws profile"
aws_region = "your region"
session = boto3.Session(
profile_name=aws_profile,
region_name=aws_region
)
eks_client = session.client('eks')
cluster_name = 'your cluster name'
# 해당 클러스터의 모든 Fargate 프로필 이름 가져오기
response = eks_client.list_fargate_profiles(clusterName=cluster_name)
profiles = response['fargateProfileNames']
# 각 Fargate 프로필 삭제
for profile in profiles:
print(f"Deleting Fargate profile: {profile}")
eks_client.delete_fargate_profile(clusterName=cluster_name, fargateProfileName=profile)
# 삭제 상태 확인
while True:
try:
eks_client.describe_fargate_profile(clusterName=cluster_name, fargateProfileName=profile)
print(f"Waiting for {profile} to be deleted...")
time.sleep(10)
except eks_client.exceptions.ResourceNotFoundException:
print(f"{profile} deleted.")
break
print("All Fargate profiles have been deleted.")
'aws > k8s, eks study' 카테고리의 다른 글
Store manifest files to txt which have been deployed (0) | 2024.04.26 |
---|---|
명령어 입력창에 kube config 구별하여 표시하기 (0) | 2024.01.19 |
etcd commands (0) | 2023.08.28 |
kubectl을 이용한 배포방법 정리 (aggregation of deployment and restarting methods with kubectl in kubernetes) (0) | 2023.07.27 |
EKS Pod Failed: Evicted (0) | 2023.05.04 |