CLI로 UpdateClusterConfig 사용 - AWS SDK 코드 예제

AWS SDK 예제 GitHub 리포지토리에 더 많은 AWS문서 SDK 예제가 있습니다.

CLI로 UpdateClusterConfig 사용

다음 코드 예시는 UpdateClusterConfig의 사용 방법을 보여 줍니다.

CLI
AWS CLI

클러스터 엔드포인트 액세스를 업데이트하려면

이 예시 명령은 클러스터를 업데이트하여 엔드포인트 퍼블릭 액세스를 비활성화하고 프라이빗 엔드포인트 액세스를 활성화합니다.

명령:

aws eks update-cluster-config --name example \ --resources-vpc-config endpointPublicAccess=false,endpointPrivateAccess=true

출력:

{ "update": { "id": "ec883c93-2e9e-407c-a22f-8f6fa6e67d4f", "status": "InProgress", "type": "EndpointAccessUpdate", "params": [ { "type": "EndpointPublicAccess", "value": "false" }, { "type": "EndpointPrivateAccess", "value": "true" } ], "createdAt": 1565806986.506, "errors": [] } }

클러스터에 대한 로깅을 활성화하려면

이 예시 명령은 example 클러스터에 대한 모든 클러스터 컨트롤 플레인 로깅 유형을 활성화합니다.

명령:

aws eks update-cluster-config --name example \ --logging '{"clusterLogging":[{"types":["api","audit","authenticator","controllerManager","scheduler"],"enabled":true}]}'

출력:

{ "update": { "id": "7551c64b-1d27-4b1e-9f8e-c45f056eb6fd", "status": "InProgress", "type": "LoggingUpdate", "params": [ { "type": "ClusterLogging", "value": "{\"clusterLogging\":[{\"types\":[\"api\",\"audit\",\"authenticator\",\"controllerManager\",\"scheduler\"],\"enabled\":true}]}" } ], "createdAt": 1565807210.37, "errors": [] } }
PowerShell
Tools for PowerShell V4

예제 1: Amazon EKS 클러스터 구성을 업데이트합니다. 업데이트 중에도 클러스터가 계속 작동합니다.

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

출력:

CreatedAt : 12/25/2019 5:03:07 PM Errors : {} Id : ee708232-7d2e-4ed7-9270-d0b5176f0726 Params : {Amazon.EKS.Model.UpdateParam} Status : InProgress Type : LoggingUpdate
  • API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V4)UpdateClusterConfig를 참조하세요.

Tools for PowerShell V5

예제 1: Amazon EKS 클러스터 구성을 업데이트합니다. 업데이트 중에도 클러스터가 계속 작동합니다.

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

출력:

CreatedAt : 12/25/2019 5:03:07 PM Errors : {} Id : ee708232-7d2e-4ed7-9270-d0b5176f0726 Params : {Amazon.EKS.Model.UpdateParam} Status : InProgress Type : LoggingUpdate
  • API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V5)UpdateClusterConfig를 참조하세요.