Use DeleteFargateProfile com um AWS SDK ou CLI - AWS Exemplos de código do SDK

Há mais exemplos de AWS SDK disponíveis no repositório AWS Doc SDK Examples GitHub .

As traduções são geradas por tradução automática. Em caso de conflito entre o conteúdo da tradução e da versão original em inglês, a versão em inglês prevalecerá.

Use DeleteFargateProfile com um AWS SDK ou CLI

Os exemplos de códigos a seguir mostram como usar DeleteFargateProfile.

CLI
AWS CLI

Exemplo 1: Criar perfil EKS Fargate para um seletor com um namespace

O delete-fargate-profile exemplo a seguir cria um perfil EKS Fargate para um seletor com um namespace.

aws eks delete-fargate-profile \ --cluster-name my-eks-cluster \ --fargate-profile-name my-fargate-profile

Saída:

{ "fargateProfile": { "fargateProfileName": "my-fargate-profile", "fargateProfileArn": "arn:aws:eks:us-east-2:111122223333:fargateprofile/my-eks-cluster/my-fargate-profile/1ac72bb3-3fc6-2631-f1e1-98bff53bed62", "clusterName": "my-eks-cluster", "createdAt": "2024-03-19T11:48:39.975000-04:00", "podExecutionRoleArn": "arn:aws:iam::111122223333:role/role-name", "subnets": [ "subnet-09d912bb63ef21b9a", "subnet-04ad87f71c6e5ab4d", "subnet-0e2907431c9988b72" ], "selectors": [ { "namespace": "default", "labels": { "foo": "bar" } } ], "status": "DELETING", "tags": {} } }

Para obter mais informações, consulte Perfil do AWS Fargate - Excluindo um Fargate no Guia do usuário do Amazon EKS.

PowerShell
Ferramentas para PowerShell

Exemplo 1: Esse cmdlet exclui um perfil do AWS Fargate. Quando você exclui um perfil do Fargate, todos os pods em execução no Fargate que foram criados com o perfil são excluídos.

Remove-EKSFargateProfile -FargateProfileName "EKSFargate" -ClusterName "TEST"

Saída:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-EKSFargateProfile (DeleteFargateProfile)" on target "EKSFargate". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y ClusterName : TEST CreatedAt : 12/26/2019 12:34:47 PM FargateProfileArn : arn:aws:eks:us-east-2:012345678912:fargateprofile/TEST/EKSFargate/42b7a119-e16b-a279-ce97-bdf303adec92 FargateProfileName : EKSFargate PodExecutionRoleArn : arn:aws:iam::012345678912:role/AmazonEKSFargatePodExecutionRole Selectors : {Amazon.EKS.Model.FargateProfileSelector} Status : DELETING Subnets : {subnet-0cd976f08d5fbfaae, subnet-02f6ff500ff2067a0} Tags : {}
  • Para obter detalhes da API, consulte DeleteFargateProfileem Referência de AWS Tools for PowerShell cmdlet.