Seleziona le tue preferenze relative ai cookie

Utilizziamo cookie essenziali e strumenti simili necessari per fornire il nostro sito e i nostri servizi. Utilizziamo i cookie prestazionali per raccogliere statistiche anonime in modo da poter capire come i clienti utilizzano il nostro sito e apportare miglioramenti. I cookie essenziali non possono essere disattivati, ma puoi fare clic su \"Personalizza\" o \"Rifiuta\" per rifiutare i cookie prestazionali.

Se sei d'accordo, AWS e le terze parti approvate utilizzeranno i cookie anche per fornire utili funzionalità del sito, ricordare le tue preferenze e visualizzare contenuti pertinenti, inclusa la pubblicità pertinente. Per continuare senza accettare questi cookie, fai clic su \"Continua\" o \"Rifiuta\". Per effettuare scelte più dettagliate o saperne di più, fai clic su \"Personalizza\".

Esempi di Amazon EKS con Tools for PowerShell - AWS Esempi di codice SDK

Sono disponibili altri esempi AWS SDK nel repository AWS Doc SDK Examples. GitHub

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Sono disponibili altri esempi AWS SDK nel repository AWS Doc SDK Examples. GitHub

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Esempi di Amazon EKS con Tools for PowerShell

I seguenti esempi di codice mostrano come eseguire azioni e implementare scenari comuni utilizzando AWS Strumenti per PowerShell con Amazon EKS.

Le operazioni sono estratti di codice da programmi più grandi e devono essere eseguite nel contesto. Sebbene le operazioni mostrino come richiamare le singole funzioni del servizio, è possibile visualizzarle contestualizzate negli scenari correlati.

Ogni esempio include un collegamento al codice sorgente completo, dove puoi trovare istruzioni su come configurare ed eseguire il codice nel contesto.

Argomenti

Operazioni

Il seguente esempio di codice mostra come utilizzareAdd-EKSResourceTag.

Strumenti per PowerShell

Esempio 1: questo cmdlet associa i tag specificati a una risorsa con il ResourceArn specificato.

Add-EKSResourceTag -ResourceArn "arn:aws:eks:us-west-2:012345678912:cluster/PROD" -Tag @{Name = "EKSPRODCLUSTER"}
  • Per i dettagli sull'API, vedere in Cmdlet Reference. TagResourceAWS Strumenti per PowerShell

Il seguente esempio di codice mostra come utilizzareAdd-EKSResourceTag.

Strumenti per PowerShell

Esempio 1: questo cmdlet associa i tag specificati a una risorsa con il ResourceArn specificato.

Add-EKSResourceTag -ResourceArn "arn:aws:eks:us-west-2:012345678912:cluster/PROD" -Tag @{Name = "EKSPRODCLUSTER"}
  • Per i dettagli sull'API, vedere in Cmdlet Reference. TagResourceAWS Strumenti per PowerShell

Il seguente esempio di codice mostra come utilizzare. Get-EKSCluster

Strumenti per PowerShell

Esempio 1: questo cmdlet restituisce informazioni descrittive su un cluster Amazon EKS.

Get-EKSCluster -Name "PROD"

Output:

Arn : arn:aws:eks:us-west-2:012345678912:cluster/PROD CertificateAuthority : Amazon.EKS.Model.Certificate ClientRequestToken : CreatedAt : 12/25/2019 6:46:17 AM Endpoint : https://669608765450FBBE54D1D78A3D71B72C.gr8.us-west-2.eks.amazonaws.com Identity : Amazon.EKS.Model.Identity Logging : Amazon.EKS.Model.Logging Name : PROD PlatformVersion : eks.7 ResourcesVpcConfig : Amazon.EKS.Model.VpcConfigResponse RoleArn : arn:aws:iam::012345678912:role/eks-iam-role Status : ACTIVE Tags : {} Version : 1.14
  • Per i dettagli sull'API, consulta Cmdlet DescribeClusterReference AWS Strumenti per PowerShell .

Il seguente esempio di codice mostra come utilizzare. Get-EKSCluster

Strumenti per PowerShell

Esempio 1: questo cmdlet restituisce informazioni descrittive su un cluster Amazon EKS.

Get-EKSCluster -Name "PROD"

Output:

Arn : arn:aws:eks:us-west-2:012345678912:cluster/PROD CertificateAuthority : Amazon.EKS.Model.Certificate ClientRequestToken : CreatedAt : 12/25/2019 6:46:17 AM Endpoint : https://669608765450FBBE54D1D78A3D71B72C.gr8.us-west-2.eks.amazonaws.com Identity : Amazon.EKS.Model.Identity Logging : Amazon.EKS.Model.Logging Name : PROD PlatformVersion : eks.7 ResourcesVpcConfig : Amazon.EKS.Model.VpcConfigResponse RoleArn : arn:aws:iam::012345678912:role/eks-iam-role Status : ACTIVE Tags : {} Version : 1.14
  • Per i dettagli sull'API, consulta Cmdlet DescribeClusterReference AWS Strumenti per PowerShell .

Il seguente esempio di codice mostra come utilizzare. Get-EKSClusterList

Strumenti per PowerShell

Esempio 1: questo cmdlet elenca i cluster Amazon EKS presenti Account AWS nella regione specificata.

Get-EKSClusterList

Output:

PROD
  • Per i dettagli sull'API, vedere ListClustersin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Get-EKSClusterList

Strumenti per PowerShell

Esempio 1: questo cmdlet elenca i cluster Amazon EKS presenti Account AWS nella regione specificata.

Get-EKSClusterList

Output:

PROD
  • Per i dettagli sull'API, vedere ListClustersin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Get-EKSFargateProfile

Strumenti per PowerShell

Esempio 1: questo cmdlet restituisce informazioni descrittive su un profilo AWS Fargate.

Get-EKSFargateProfile -FargateProfileName "EKSFargate" -ClusterName "TEST"

Output:

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 : ACTIVE Subnets : {subnet-0cd976f08d5fbfaae, subnet-02f6ff500ff2067a0} Tags : {}

Il seguente esempio di codice mostra come utilizzare. Get-EKSFargateProfile

Strumenti per PowerShell

Esempio 1: questo cmdlet restituisce informazioni descrittive su un profilo AWS Fargate.

Get-EKSFargateProfile -FargateProfileName "EKSFargate" -ClusterName "TEST"

Output:

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 : ACTIVE Subnets : {subnet-0cd976f08d5fbfaae, subnet-02f6ff500ff2067a0} Tags : {}

Il seguente esempio di codice mostra come utilizzare. Get-EKSFargateProfileList

Strumenti per PowerShell

Esempio 1: questo cmdlet elenca i profili AWS Fargate associati al cluster specificato Account AWS nella regione specificata.

Get-EKSFargateProfileList -ClusterName "TEST"

Output:

EKSFargate EKSFargateProfile
  • Per i dettagli sull'API, vedere ListFargateProfilesin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Get-EKSFargateProfileList

Strumenti per PowerShell

Esempio 1: questo cmdlet elenca i profili AWS Fargate associati al cluster specificato Account AWS nella regione specificata.

Get-EKSFargateProfileList -ClusterName "TEST"

Output:

EKSFargate EKSFargateProfile
  • Per i dettagli sull'API, vedere ListFargateProfilesin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Get-EKSNodegroup

Strumenti per PowerShell

Esempio 1: questo cmdlet restituisce informazioni descrittive su un gruppo di nodi Amazon EKS.

Get-EKSNodegroup -NodegroupName "ProdEKSNodeGroup" -ClusterName "PROD"

Output:

AmiType : AL2_x86_64 ClusterName : PROD CreatedAt : 12/25/2019 10:16:45 AM DiskSize : 40 Health : Amazon.EKS.Model.NodegroupHealth InstanceTypes : {t3.large} Labels : {} ModifiedAt : 12/25/2019 10:16:45 AM NodegroupArn : arn:aws:eks:us-west-2:012345678912:nodegroup/PROD/ProdEKSNodeGroup/7eb79e47-82b6-04d9-e984-95110db6fa85 NodegroupName : ProdEKSNodeGroup NodeRole : arn:aws:iam::012345678912:role/NodeInstanceRole ReleaseVersion : 1.14.7-20190927 RemoteAccess : Resources : ScalingConfig : Amazon.EKS.Model.NodegroupScalingConfig Status : CREATING Subnets : {subnet-0d1a9fff35efa7691, subnet-0a3f4928edbc224d4} Tags : {} Version : 1.14
  • Per i dettagli sull'API, consulta Cmdlet DescribeNodegroupReference AWS Strumenti per PowerShell .

Il seguente esempio di codice mostra come utilizzare. Get-EKSNodegroup

Strumenti per PowerShell

Esempio 1: questo cmdlet restituisce informazioni descrittive su un gruppo di nodi Amazon EKS.

Get-EKSNodegroup -NodegroupName "ProdEKSNodeGroup" -ClusterName "PROD"

Output:

AmiType : AL2_x86_64 ClusterName : PROD CreatedAt : 12/25/2019 10:16:45 AM DiskSize : 40 Health : Amazon.EKS.Model.NodegroupHealth InstanceTypes : {t3.large} Labels : {} ModifiedAt : 12/25/2019 10:16:45 AM NodegroupArn : arn:aws:eks:us-west-2:012345678912:nodegroup/PROD/ProdEKSNodeGroup/7eb79e47-82b6-04d9-e984-95110db6fa85 NodegroupName : ProdEKSNodeGroup NodeRole : arn:aws:iam::012345678912:role/NodeInstanceRole ReleaseVersion : 1.14.7-20190927 RemoteAccess : Resources : ScalingConfig : Amazon.EKS.Model.NodegroupScalingConfig Status : CREATING Subnets : {subnet-0d1a9fff35efa7691, subnet-0a3f4928edbc224d4} Tags : {} Version : 1.14
  • Per i dettagli sull'API, consulta Cmdlet DescribeNodegroupReference AWS Strumenti per PowerShell .

Il seguente esempio di codice mostra come utilizzare. Get-EKSNodegroupList

Strumenti per PowerShell

Esempio 1: questo cmdlet elenca i gruppi di nodi Amazon EKS associati al cluster specificato Account AWS nella regione specificata.

Get-EKSNodegroupList -ClusterName PROD

Output:

ProdEKSNodeGroup
  • Per i dettagli sull'API, vedere ListNodegroupsin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Get-EKSNodegroupList

Strumenti per PowerShell

Esempio 1: questo cmdlet elenca i gruppi di nodi Amazon EKS associati al cluster specificato Account AWS nella regione specificata.

Get-EKSNodegroupList -ClusterName PROD

Output:

ProdEKSNodeGroup
  • Per i dettagli sull'API, vedere ListNodegroupsin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Get-EKSResourceTag

Strumenti per PowerShell

Esempio 1: questo cmdlet elenca i tag per una risorsa Amazon EKS.

Get-EKSResourceTag -ResourceArn "arn:aws:eks:us-west-2:012345678912:cluster/PROD"

Output:

Key Value --- ----- Name EKSPRODCLUSTER
  • Per i dettagli sull'API, consulta AWS Strumenti per PowerShell Cmdlet ListTagsForResourceReference.

Il seguente esempio di codice mostra come utilizzare. Get-EKSResourceTag

Strumenti per PowerShell

Esempio 1: questo cmdlet elenca i tag per una risorsa Amazon EKS.

Get-EKSResourceTag -ResourceArn "arn:aws:eks:us-west-2:012345678912:cluster/PROD"

Output:

Key Value --- ----- Name EKSPRODCLUSTER
  • Per i dettagli sull'API, consulta AWS Strumenti per PowerShell Cmdlet ListTagsForResourceReference.

Il seguente esempio di codice mostra come utilizzare. Get-EKSUpdate

Strumenti per PowerShell

Esempio 1: questo cmdlet restituisce informazioni descrittive su un aggiornamento del cluster Amazon EKS o del gruppo di nodi gestiti associato.

Get-EKSUpdate -Name "PROD" -UpdateId "ee708232-7d2e-4ed7-9270-d0b5176f0726"

Output:

CreatedAt : 12/25/2019 5:03:07 PM Errors : {} Id : ee708232-7d2e-4ed7-9270-d0b5176f0726 Params : {Amazon.EKS.Model.UpdateParam} Status : Successful Type : LoggingUpdate
  • Per i dettagli sull'API, consulta Cmdlet DescribeUpdateReference AWS Strumenti per PowerShell .

Il seguente esempio di codice mostra come utilizzare. Get-EKSUpdate

Strumenti per PowerShell

Esempio 1: questo cmdlet restituisce informazioni descrittive su un aggiornamento del cluster Amazon EKS o del gruppo di nodi gestiti associato.

Get-EKSUpdate -Name "PROD" -UpdateId "ee708232-7d2e-4ed7-9270-d0b5176f0726"

Output:

CreatedAt : 12/25/2019 5:03:07 PM Errors : {} Id : ee708232-7d2e-4ed7-9270-d0b5176f0726 Params : {Amazon.EKS.Model.UpdateParam} Status : Successful Type : LoggingUpdate
  • Per i dettagli sull'API, consulta Cmdlet DescribeUpdateReference AWS Strumenti per PowerShell .

Il seguente esempio di codice mostra come utilizzare. Get-EKSUpdateList

Strumenti per PowerShell

Esempio 1: questo cmdlet elenca gli aggiornamenti associati a un cluster Amazon EKS o a un gruppo di nodi gestiti nella tua regione Account AWS, nella regione specificata.

Get-EKSUpdateList -Name "PROD"

Output:

ee708232-7d2e-4ed7-9270-d0b5176f0726
  • Per i dettagli sull'API, consulta AWS Strumenti per PowerShell Cmdlet ListUpdatesReference.

Il seguente esempio di codice mostra come utilizzare. Get-EKSUpdateList

Strumenti per PowerShell

Esempio 1: questo cmdlet elenca gli aggiornamenti associati a un cluster Amazon EKS o a un gruppo di nodi gestiti nella tua regione Account AWS, nella regione specificata.

Get-EKSUpdateList -Name "PROD"

Output:

ee708232-7d2e-4ed7-9270-d0b5176f0726
  • Per i dettagli sull'API, consulta AWS Strumenti per PowerShell Cmdlet ListUpdatesReference.

Il seguente esempio di codice mostra come utilizzare. New-EKSCluster

Strumenti per PowerShell

Esempio 1: Questo esempio crea un nuovo cluster chiamato 'prod'.

New-EKSCluster -Name prod -ResourcesVpcConfig @{SubnetIds=@("subnet-0a1b2c3d","subnet-3a2b1c0d");SecurityGroupIds="sg-6979fe18"} -RoleArn "arn:aws:iam::012345678901:role/eks-service-role"

Output:

Arn : arn:aws:eks:us-west-2:012345678901:cluster/prod CertificateAuthority : Amazon.EKS.Model.Certificate ClientRequestToken : CreatedAt : 12/10/2018 9:25:31 PM Endpoint : Name : prod PlatformVersion : eks.3 ResourcesVpcConfig : Amazon.EKS.Model.VpcConfigResponse RoleArn : arn:aws:iam::012345678901:role/eks-service-role Status : CREATING Version : 1.10
  • Per i dettagli sull'API, vedere CreateClusterin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. New-EKSCluster

Strumenti per PowerShell

Esempio 1: Questo esempio crea un nuovo cluster chiamato 'prod'.

New-EKSCluster -Name prod -ResourcesVpcConfig @{SubnetIds=@("subnet-0a1b2c3d","subnet-3a2b1c0d");SecurityGroupIds="sg-6979fe18"} -RoleArn "arn:aws:iam::012345678901:role/eks-service-role"

Output:

Arn : arn:aws:eks:us-west-2:012345678901:cluster/prod CertificateAuthority : Amazon.EKS.Model.Certificate ClientRequestToken : CreatedAt : 12/10/2018 9:25:31 PM Endpoint : Name : prod PlatformVersion : eks.3 ResourcesVpcConfig : Amazon.EKS.Model.VpcConfigResponse RoleArn : arn:aws:iam::012345678901:role/eks-service-role Status : CREATING Version : 1.10
  • Per i dettagli sull'API, vedere CreateClusterin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. New-EKSFargateProfile

Strumenti per PowerShell

Esempio 1: questo cmdlet crea un profilo AWS Fargate per il tuo cluster Amazon EKS. È necessario disporre di almeno un profilo Fargate in un cluster per poter pianificare i pod sull'infrastruttura Fargate.

New-EKSFargateProfile -FargateProfileName EKSFargateProfile -ClusterName TEST -Subnet "subnet-02f6ff500ff2067a0", "subnet-0cd976f08d5fbfaae" -PodExecutionRoleArn arn:aws:iam::012345678912:role/AmazonEKSFargatePodExecutionRole -Selector @{Namespace="default"}

Output:

ClusterName : TEST CreatedAt : 12/26/2019 12:38:21 PM FargateProfileArn : arn:aws:eks:us-east-2:012345678912:fargateprofile/TEST/EKSFargateProfile/20b7a11b-8292-41c1-bc56-ffa5e60f6224 FargateProfileName : EKSFargateProfile PodExecutionRoleArn : arn:aws:iam::012345678912:role/AmazonEKSFargatePodExecutionRole Selectors : {Amazon.EKS.Model.FargateProfileSelector} Status : CREATING Subnets : {subnet-0cd976f08d5fbfaae, subnet-02f6ff500ff2067a0} Tags : {}
  • Per i dettagli sull'API, vedere CreateFargateProfilein AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. New-EKSFargateProfile

Strumenti per PowerShell

Esempio 1: questo cmdlet crea un profilo AWS Fargate per il tuo cluster Amazon EKS. È necessario disporre di almeno un profilo Fargate in un cluster per poter pianificare i pod sull'infrastruttura Fargate.

New-EKSFargateProfile -FargateProfileName EKSFargateProfile -ClusterName TEST -Subnet "subnet-02f6ff500ff2067a0", "subnet-0cd976f08d5fbfaae" -PodExecutionRoleArn arn:aws:iam::012345678912:role/AmazonEKSFargatePodExecutionRole -Selector @{Namespace="default"}

Output:

ClusterName : TEST CreatedAt : 12/26/2019 12:38:21 PM FargateProfileArn : arn:aws:eks:us-east-2:012345678912:fargateprofile/TEST/EKSFargateProfile/20b7a11b-8292-41c1-bc56-ffa5e60f6224 FargateProfileName : EKSFargateProfile PodExecutionRoleArn : arn:aws:iam::012345678912:role/AmazonEKSFargatePodExecutionRole Selectors : {Amazon.EKS.Model.FargateProfileSelector} Status : CREATING Subnets : {subnet-0cd976f08d5fbfaae, subnet-02f6ff500ff2067a0} Tags : {}
  • Per i dettagli sull'API, vedere CreateFargateProfilein AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. New-EKSNodeGroup

Strumenti per PowerShell

Esempio 1: questo cmdlet crea un gruppo di nodi di lavoro gestito per un cluster Amazon EKS. È possibile creare solo un gruppo di nodi per il cluster che sia uguale alla versione corrente di Kubernetes per il cluster. Tutti i gruppi di nodi vengono creati con l'ultima versione AMI per la rispettiva versione Kubernetes secondaria del cluster.

New-EKSNodeGroup -NodeGroupName "ProdEKSNodeGroup" -AmiType "AL2_x86_64" -DiskSize 40 -ClusterName "PROD" -ScalingConfig_DesiredSize 2 -ScalingConfig_MinSize 2 -ScalingConfig_MaxSize 5 -InstanceType t3.large -NodeRole "arn:aws:iam::012345678912:role/NodeInstanceRole" -Subnet "subnet-0d1a9fff35efa7691","subnet-0a3f4928edbc224d4"

Output:

AmiType : AL2_x86_64 ClusterName : PROD CreatedAt : 12/25/2019 10:16:45 AM DiskSize : 40 Health : Amazon.EKS.Model.NodegroupHealth InstanceTypes : {t3.large} Labels : {} ModifiedAt : 12/25/2019 10:16:45 AM NodegroupArn : arn:aws:eks:us-west-2:012345678912:nodegroup/PROD/ProdEKSNodeGroup/7eb79e47-82b6-04d9-e984-95110db6fa85 NodegroupName : ProdEKSNodeGroup NodeRole : arn:aws:iam::012345678912:role/NodeInstanceRole ReleaseVersion : 1.14.7-20190927 RemoteAccess : Resources : ScalingConfig : Amazon.EKS.Model.NodegroupScalingConfig Status : CREATING Subnets : {subnet-0d1a9fff35efa7691, subnet-0a3f4928edbc224d4} Tags : {} Version : 1.14
  • Per i dettagli sull'API, vedere CreateNodegroupin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. New-EKSNodeGroup

Strumenti per PowerShell

Esempio 1: questo cmdlet crea un gruppo di nodi di lavoro gestito per un cluster Amazon EKS. È possibile creare solo un gruppo di nodi per il cluster che sia uguale alla versione corrente di Kubernetes per il cluster. Tutti i gruppi di nodi vengono creati con l'ultima versione AMI per la rispettiva versione Kubernetes secondaria del cluster.

New-EKSNodeGroup -NodeGroupName "ProdEKSNodeGroup" -AmiType "AL2_x86_64" -DiskSize 40 -ClusterName "PROD" -ScalingConfig_DesiredSize 2 -ScalingConfig_MinSize 2 -ScalingConfig_MaxSize 5 -InstanceType t3.large -NodeRole "arn:aws:iam::012345678912:role/NodeInstanceRole" -Subnet "subnet-0d1a9fff35efa7691","subnet-0a3f4928edbc224d4"

Output:

AmiType : AL2_x86_64 ClusterName : PROD CreatedAt : 12/25/2019 10:16:45 AM DiskSize : 40 Health : Amazon.EKS.Model.NodegroupHealth InstanceTypes : {t3.large} Labels : {} ModifiedAt : 12/25/2019 10:16:45 AM NodegroupArn : arn:aws:eks:us-west-2:012345678912:nodegroup/PROD/ProdEKSNodeGroup/7eb79e47-82b6-04d9-e984-95110db6fa85 NodegroupName : ProdEKSNodeGroup NodeRole : arn:aws:iam::012345678912:role/NodeInstanceRole ReleaseVersion : 1.14.7-20190927 RemoteAccess : Resources : ScalingConfig : Amazon.EKS.Model.NodegroupScalingConfig Status : CREATING Subnets : {subnet-0d1a9fff35efa7691, subnet-0a3f4928edbc224d4} Tags : {} Version : 1.14
  • Per i dettagli sull'API, vedere CreateNodegroupin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Remove-EKSCluster

Strumenti per PowerShell

Esempio 1: questo cmdlet elimina il piano di controllo del cluster Amazon EKS.

Remove-EKSCluster -Name "DEV-KUBE-CL"

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-EKSCluster (DeleteCluster)" on target "DEV-KUBE-CL". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y Arn : arn:aws:eks:us-west-2:012345678912:cluster/DEV-KUBE-CL CertificateAuthority : Amazon.EKS.Model.Certificate ClientRequestToken : CreatedAt : 12/25/2019 9:33:25 AM Endpoint : https://02E6D31E3E4F8C15D7BE7F58D527776A.yl4.us-west-2.eks.amazonaws.com Identity : Amazon.EKS.Model.Identity Logging : Amazon.EKS.Model.Logging Name : DEV-KUBE-CL PlatformVersion : eks.7 ResourcesVpcConfig : Amazon.EKS.Model.VpcConfigResponse RoleArn : arn:aws:iam::012345678912:role/eks-iam-role Status : DELETING Tags : {} Version : 1.14
  • Per i dettagli sull'API, consulta Cmdlet DeleteClusterReference AWS Strumenti per PowerShell .

Il seguente esempio di codice mostra come utilizzare. Remove-EKSCluster

Strumenti per PowerShell

Esempio 1: questo cmdlet elimina il piano di controllo del cluster Amazon EKS.

Remove-EKSCluster -Name "DEV-KUBE-CL"

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-EKSCluster (DeleteCluster)" on target "DEV-KUBE-CL". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y Arn : arn:aws:eks:us-west-2:012345678912:cluster/DEV-KUBE-CL CertificateAuthority : Amazon.EKS.Model.Certificate ClientRequestToken : CreatedAt : 12/25/2019 9:33:25 AM Endpoint : https://02E6D31E3E4F8C15D7BE7F58D527776A.yl4.us-west-2.eks.amazonaws.com Identity : Amazon.EKS.Model.Identity Logging : Amazon.EKS.Model.Logging Name : DEV-KUBE-CL PlatformVersion : eks.7 ResourcesVpcConfig : Amazon.EKS.Model.VpcConfigResponse RoleArn : arn:aws:iam::012345678912:role/eks-iam-role Status : DELETING Tags : {} Version : 1.14
  • Per i dettagli sull'API, consulta Cmdlet DeleteClusterReference AWS Strumenti per PowerShell .

Il seguente esempio di codice mostra come utilizzare. Remove-EKSFargateProfile

Strumenti per PowerShell

Esempio 1: questo cmdlet elimina un profilo AWS Fargate. Quando si elimina un profilo Fargate, tutti i pod in esecuzione su Fargate creati con il profilo vengono eliminati.

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

Output:

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 : {}
  • Per i dettagli sull'API, vedere DeleteFargateProfilein AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Remove-EKSFargateProfile

Strumenti per PowerShell

Esempio 1: questo cmdlet elimina un profilo AWS Fargate. Quando si elimina un profilo Fargate, tutti i pod in esecuzione su Fargate creati con il profilo vengono eliminati.

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

Output:

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 : {}
  • Per i dettagli sull'API, vedere DeleteFargateProfilein AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Remove-EKSNodegroup

Strumenti per PowerShell

Esempio 1: questo cmdlet elimina un gruppo di nodi Amazon EKS per un cluster.

Remove-EKSNodegroup -NodegroupName "ProdEKSNodeGroup" -ClusterName "PROD"

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-EKSNodegroup (DeleteNodegroup)" on target "ProdEKSNodeGroup". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y AmiType : AL2_x86_64 ClusterName : PROD CreatedAt : 12/25/2019 10:16:45 AM DiskSize : 40 Health : Amazon.EKS.Model.NodegroupHealth InstanceTypes : {t3.large} Labels : {} ModifiedAt : 12/25/2019 11:01:16 AM NodegroupArn : arn:aws:eks:us-west-2:012345678912:nodegroup/PROD/ProdEKSNodeGroup/7eb79e47-82b6-04d9-e984-95110db6fa85 NodegroupName : ProdEKSNodeGroup NodeRole : arn:aws:iam::012345678912:role/NodeInstanceRole ReleaseVersion : 1.14.7-20190927 RemoteAccess : Resources : Amazon.EKS.Model.NodegroupResources ScalingConfig : Amazon.EKS.Model.NodegroupScalingConfig Status : DELETING Subnets : {subnet-0d1a9fff35efa7691, subnet-0a3f4928edbc224d4} Tags : {} Version : 1.14
  • Per i dettagli sull'API, consulta Cmdlet DeleteNodegroupReference AWS Strumenti per PowerShell .

Il seguente esempio di codice mostra come utilizzare. Remove-EKSNodegroup

Strumenti per PowerShell

Esempio 1: questo cmdlet elimina un gruppo di nodi Amazon EKS per un cluster.

Remove-EKSNodegroup -NodegroupName "ProdEKSNodeGroup" -ClusterName "PROD"

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-EKSNodegroup (DeleteNodegroup)" on target "ProdEKSNodeGroup". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y AmiType : AL2_x86_64 ClusterName : PROD CreatedAt : 12/25/2019 10:16:45 AM DiskSize : 40 Health : Amazon.EKS.Model.NodegroupHealth InstanceTypes : {t3.large} Labels : {} ModifiedAt : 12/25/2019 11:01:16 AM NodegroupArn : arn:aws:eks:us-west-2:012345678912:nodegroup/PROD/ProdEKSNodeGroup/7eb79e47-82b6-04d9-e984-95110db6fa85 NodegroupName : ProdEKSNodeGroup NodeRole : arn:aws:iam::012345678912:role/NodeInstanceRole ReleaseVersion : 1.14.7-20190927 RemoteAccess : Resources : Amazon.EKS.Model.NodegroupResources ScalingConfig : Amazon.EKS.Model.NodegroupScalingConfig Status : DELETING Subnets : {subnet-0d1a9fff35efa7691, subnet-0a3f4928edbc224d4} Tags : {} Version : 1.14
  • Per i dettagli sull'API, consulta Cmdlet DeleteNodegroupReference AWS Strumenti per PowerShell .

Il seguente esempio di codice mostra come utilizzare. Remove-EKSResourceTag

Strumenti per PowerShell

Esempio 1: questo cmdlet elimina i tag specificati da una risorsa EKS.

Remove-EKSResourceTag -ResourceArn "arn:aws:eks:us-west-2:012345678912:cluster/PROD" -TagKey "Name"

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-EKSResourceTag (UntagResource)" on target "arn:aws:eks:us-west-2:012345678912:cluster/PROD". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
  • Per i dettagli sull'API, vedere UntagResourcein AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Remove-EKSResourceTag

Strumenti per PowerShell

Esempio 1: questo cmdlet elimina i tag specificati da una risorsa EKS.

Remove-EKSResourceTag -ResourceArn "arn:aws:eks:us-west-2:012345678912:cluster/PROD" -TagKey "Name"

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-EKSResourceTag (UntagResource)" on target "arn:aws:eks:us-west-2:012345678912:cluster/PROD". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
  • Per i dettagli sull'API, vedere UntagResourcein AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Update-EKSClusterConfig

Strumenti per PowerShell

Esempio 1: aggiorna una configurazione del cluster Amazon EKS. Il cluster continua a funzionare durante l'aggiornamento.

Update-EKSClusterConfig -Name "PROD" -Logging_ClusterLogging @{Types="api","audit","authenticator","controllerManager","scheduler",Enabled="True"}

Output:

CreatedAt : 12/25/2019 5:03:07 PM Errors : {} Id : ee708232-7d2e-4ed7-9270-d0b5176f0726 Params : {Amazon.EKS.Model.UpdateParam} Status : InProgress Type : LoggingUpdate
  • Per i dettagli sull'API, vedere UpdateClusterConfigin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Update-EKSClusterConfig

Strumenti per PowerShell

Esempio 1: aggiorna una configurazione del cluster Amazon EKS. Il cluster continua a funzionare durante l'aggiornamento.

Update-EKSClusterConfig -Name "PROD" -Logging_ClusterLogging @{Types="api","audit","authenticator","controllerManager","scheduler",Enabled="True"}

Output:

CreatedAt : 12/25/2019 5:03:07 PM Errors : {} Id : ee708232-7d2e-4ed7-9270-d0b5176f0726 Params : {Amazon.EKS.Model.UpdateParam} Status : InProgress Type : LoggingUpdate
  • Per i dettagli sull'API, vedere UpdateClusterConfigin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Update-EKSClusterVersion

Strumenti per PowerShell

Esempio 1: questo cmdlet aggiorna un cluster Amazon EKS alla versione Kubernetes specificata. Il cluster continua a funzionare durante l'aggiornamento.

Update-EKSClusterVersion -Name "PROD-KUBE-CL" -Version 1.14

Output:

CreatedAt : 12/26/2019 9:50:37 AM Errors : {} Id : ef186eff-3b3a-4c25-bcfc-3dcdf9e898a8 Params : {Amazon.EKS.Model.UpdateParam, Amazon.EKS.Model.UpdateParam} Status : InProgress Type : VersionUpdate
  • Per i dettagli sull'API, vedere UpdateClusterVersionin AWS Strumenti per PowerShell Cmdlet Reference.

Il seguente esempio di codice mostra come utilizzare. Update-EKSClusterVersion

Strumenti per PowerShell

Esempio 1: questo cmdlet aggiorna un cluster Amazon EKS alla versione Kubernetes specificata. Il cluster continua a funzionare durante l'aggiornamento.

Update-EKSClusterVersion -Name "PROD-KUBE-CL" -Version 1.14

Output:

CreatedAt : 12/26/2019 9:50:37 AM Errors : {} Id : ef186eff-3b3a-4c25-bcfc-3dcdf9e898a8 Params : {Amazon.EKS.Model.UpdateParam, Amazon.EKS.Model.UpdateParam} Status : InProgress Type : VersionUpdate
  • Per i dettagli sull'API, vedere UpdateClusterVersionin AWS Strumenti per PowerShell Cmdlet Reference.

PrivacyCondizioni del sitoPreferenze cookie
© 2025, Amazon Web Services, Inc. o società affiliate. Tutti i diritti riservati.