Utilizzare UpdateClusterVersion con una CLI - Esempi di codice per SDK AWS

Sono disponibili altri esempi per SDK AWS nel repository GitHub della documentazione degli esempi per SDK AWS.

Utilizzare UpdateClusterVersion con una CLI

Gli esempi di codice seguenti mostrano come utilizzare UpdateClusterVersion.

CLI
AWS CLI

Come aggiornare un cluster Amazon EKS denominato “my-eks-cluster” alla versione Kubernetes specificata

L’esempio update-cluster-version seguente aggiorna un cluster Amazon EKS alla versione Kubernetes specificata.

aws eks update-cluster-version \ --name my-eks-cluster \ --kubernetes-version 1.27

Output:

{ "update": { "id": "e4091a28-ea14-48fd-a8c7-975aeb469e8a", "status": "InProgress", "type": "VersionUpdate", "params": [ { "type": "Version", "value": "1.27" }, { "type": "PlatformVersion", "value": "eks.16" } ], "createdAt": "2024-04-12T16:56:01.082000-04:00", "errors": [] } }

Per ulteriori informazioni, consulta Aggiornamento della versione Kubernetes del cluster Amazon EKS nella Guida per l’utente di Amazon EKS.

  • Per informazioni dettagliate sull’API, consulta UpdateClusterVersion in AWS CLI Command Reference.

PowerShell
Strumenti per PowerShell V4

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 informazioni dettagliate sull’API, consulta UpdateClusterVersion nella documentazione di riferimento dei cmdlet di AWS Strumenti per PowerShell (V4).

Strumenti per PowerShell V5

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 informazioni dettagliate sull’API, consulta UpdateClusterVersion nella documentazione di riferimento dei cmdlet di AWS Strumenti per PowerShell (V5).