EKS / Client / update_cluster_config
update_cluster_config#
- EKS.Client.update_cluster_config(**kwargs)#
Updates an Amazon EKS cluster configuration. Your cluster continues to function during the update. The response output includes an update ID that you can use to track the status of your cluster update with
DescribeUpdate
”/>.You can use this API operation to enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By default, cluster control plane logs aren’t exported to CloudWatch Logs. For more information, see Amazon EKS Cluster control plane logs in the Amazon EKS User Guide .
Note
CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see CloudWatch Pricing.
You can also use this API operation to enable or disable public and private access to your cluster’s Kubernetes API server endpoint. By default, public access is enabled, and private access is disabled. For more information, see Amazon EKS cluster endpoint access control in the Amazon EKS User Guide .
You can also use this API operation to choose different subnets and security groups for the cluster. You must specify at least two subnets that are in different Availability Zones. You can’t change which VPC the subnets are from, the subnets must be in the same VPC as the subnets that the cluster was created with. For more information about the VPC requirements, see https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html in the Amazon EKS User Guide .
You can also use this API operation to enable or disable ARC zonal shift. If zonal shift is enabled, Amazon Web Services configures zonal autoshift for the cluster.
Cluster updates are asynchronous, and they should finish within a few minutes. During an update, the cluster status moves to
UPDATING
(this status transition is eventually consistent). When the update is complete (eitherFailed
orSuccessful
), the cluster status moves toActive
.See also: AWS API Documentation
Request Syntax
response = client.update_cluster_config( name='string', resourcesVpcConfig={ 'subnetIds': [ 'string', ], 'securityGroupIds': [ 'string', ], 'endpointPublicAccess': True|False, 'endpointPrivateAccess': True|False, 'publicAccessCidrs': [ 'string', ] }, logging={ 'clusterLogging': [ { 'types': [ 'api'|'audit'|'authenticator'|'controllerManager'|'scheduler', ], 'enabled': True|False }, ] }, clientRequestToken='string', accessConfig={ 'authenticationMode': 'API'|'API_AND_CONFIG_MAP'|'CONFIG_MAP' }, upgradePolicy={ 'supportType': 'STANDARD'|'EXTENDED' }, zonalShiftConfig={ 'enabled': True|False }, computeConfig={ 'enabled': True|False, 'nodePools': [ 'string', ], 'nodeRoleArn': 'string' }, kubernetesNetworkConfig={ 'serviceIpv4Cidr': 'string', 'ipFamily': 'ipv4'|'ipv6', 'elasticLoadBalancing': { 'enabled': True|False } }, storageConfig={ 'blockStorage': { 'enabled': True|False } } )
- Parameters:
name (string) –
[REQUIRED]
The name of the Amazon EKS cluster to update.
resourcesVpcConfig (dict) –
An object representing the VPC configuration to use for an Amazon EKS cluster.
subnetIds (list) –
Specify subnets for your Amazon EKS nodes. Amazon EKS creates cross-account elastic network interfaces in these subnets to allow communication between your nodes and the Kubernetes control plane.
(string) –
securityGroupIds (list) –
Specify one or more security groups for the cross-account elastic network interfaces that Amazon EKS creates to use that allow communication between your nodes and the Kubernetes control plane. If you don’t specify any security groups, then familiarize yourself with the difference between Amazon EKS defaults for clusters deployed with Kubernetes. For more information, see Amazon EKS security group considerations in the Amazon EKS User Guide .
(string) –
endpointPublicAccess (boolean) –
Set this value to
false
to disable public access to your cluster’s Kubernetes API server endpoint. If you disable public access, your cluster’s Kubernetes API server can only receive requests from within the cluster VPC. The default value for this parameter istrue
, which enables public access for your Kubernetes API server. For more information, see Amazon EKS cluster endpoint access control in the Amazon EKS User Guide .endpointPrivateAccess (boolean) –
Set this value to
true
to enable private access for your cluster’s Kubernetes API server endpoint. If you enable private access, Kubernetes API requests from within your cluster’s VPC use the private VPC endpoint. The default value for this parameter isfalse
, which disables private access for your Kubernetes API server. If you disable private access and you have nodes or Fargate pods in the cluster, then ensure thatpublicAccessCidrs
includes the necessary CIDR blocks for communication with the nodes or Fargate pods. For more information, see Amazon EKS cluster endpoint access control in the Amazon EKS User Guide .publicAccessCidrs (list) –
The CIDR blocks that are allowed access to your cluster’s public Kubernetes API server endpoint. Communication to the endpoint from addresses outside of the CIDR blocks that you specify is denied. The default value is
0.0.0.0/0
. If you’ve disabled private endpoint access, make sure that you specify the necessary CIDR blocks for every node and FargatePod
in the cluster. For more information, see Amazon EKS cluster endpoint access control in the Amazon EKS User Guide .(string) –
logging (dict) –
Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By default, cluster control plane logs aren’t exported to CloudWatch Logs. For more information, see Amazon EKS cluster control plane logs in the Amazon EKS User Guide .
Note
CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see CloudWatch Pricing.
clusterLogging (list) –
The cluster control plane logging configuration for your cluster.
(dict) –
An object representing the enabled or disabled Kubernetes control plane logs for your cluster.
types (list) –
The available cluster control plane log types.
(string) –
enabled (boolean) –
If a log type is enabled, that log type exports its control plane logs to CloudWatch Logs. If a log type isn’t enabled, that log type doesn’t export its control plane logs. Each individual log type can be enabled or disabled independently.
clientRequestToken (string) –
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
This field is autopopulated if not provided.
accessConfig (dict) –
The access configuration for the cluster.
authenticationMode (string) –
The desired authentication mode for the cluster.
upgradePolicy (dict) –
You can enable or disable extended support for clusters currently on standard support. You cannot disable extended support once it starts. You must enable extended support before your cluster exits standard support.
supportType (string) –
If the cluster is set to
EXTENDED
, it will enter extended support at the end of standard support. If the cluster is set toSTANDARD
, it will be automatically upgraded at the end of standard support.Learn more about EKS Extended Support in the EKS User Guide.
zonalShiftConfig (dict) –
Enable or disable ARC zonal shift for the cluster. If zonal shift is enabled, Amazon Web Services configures zonal autoshift for the cluster.
Zonal shift is a feature of Amazon Application Recovery Controller (ARC). ARC zonal shift is designed to be a temporary measure that allows you to move traffic for a resource away from an impaired AZ until the zonal shift expires or you cancel it. You can extend the zonal shift if necessary.
You can start a zonal shift for an EKS cluster, or you can allow Amazon Web Services to do it for you by enabling zonal autoshift. This shift updates the flow of east-to-west network traffic in your cluster to only consider network endpoints for Pods running on worker nodes in healthy AZs. Additionally, any ALB or NLB handling ingress traffic for applications in your EKS cluster will automatically route traffic to targets in the healthy AZs. For more information about zonal shift in EKS, see Learn about Amazon Application Recovery Controller (ARC) Zonal Shift in Amazon EKS in the Amazon EKS User Guide .
enabled (boolean) –
If zonal shift is enabled, Amazon Web Services configures zonal autoshift for the cluster.
computeConfig (dict) –
Update the configuration of the compute capability of your EKS Auto Mode cluster. For example, enable the capability.
enabled (boolean) –
Request to enable or disable the compute capability on your EKS Auto Mode cluster. If the compute capability is enabled, EKS Auto Mode will create and delete EC2 Managed Instances in your Amazon Web Services account.
nodePools (list) –
Configuration for node pools that defines the compute resources for your EKS Auto Mode cluster. For more information, see EKS Auto Mode Node Pools in the EKS User Guide.
(string) –
nodeRoleArn (string) –
The ARN of the IAM Role EKS will assign to EC2 Managed Instances in your EKS Auto Mode cluster. This value cannot be changed after the compute capability of EKS Auto Mode is enabled. For more information, see the IAM Reference in the EKS User Guide.
kubernetesNetworkConfig (dict) –
The Kubernetes network configuration for the cluster.
serviceIpv4Cidr (string) –
Don’t specify a value if you select
ipv6
for ipFamily. The CIDR block to assign Kubernetes service IP addresses from. If you don’t specify a block, Kubernetes assigns addresses from either the10.100.0.0/16
or172.20.0.0/16
CIDR blocks. We recommend that you specify a block that does not overlap with resources in other networks that are peered or connected to your VPC. The block must meet the following requirements:Within one of the following private IP address blocks:
10.0.0.0/8
,172.16.0.0/12
, or192.168.0.0/16
.Doesn’t overlap with any CIDR block assigned to the VPC that you selected for VPC.
Between
/24
and/12
.
Warning
You can only specify a custom CIDR block when you create a cluster. You can’t change this value after the cluster is created.
ipFamily (string) –
Specify which IP family is used to assign Kubernetes pod and service IP addresses. If you don’t specify a value,
ipv4
is used by default. You can only specify an IP family when you create a cluster and can’t change this value once the cluster is created. If you specifyipv6
, the VPC and subnets that you specify for cluster creation must have bothIPv4
andIPv6
CIDR blocks assigned to them. You can’t specifyipv6
for clusters in China Regions.You can only specify
ipv6
for1.21
and later clusters that use version1.10.1
or later of the Amazon VPC CNI add-on. If you specifyipv6
, then ensure that your VPC meets the requirements listed in the considerations listed in Assigning IPv6 addresses to pods and services in the Amazon EKS User Guide. Kubernetes assigns servicesIPv6
addresses from the unique local address range(fc00::/7)
. You can’t specify a customIPv6
CIDR block. Pod addresses are assigned from the subnet’sIPv6
CIDR.elasticLoadBalancing (dict) –
Request to enable or disable the load balancing capability on your EKS Auto Mode cluster. For more information, see EKS Auto Mode load balancing capability in the EKS User Guide.
enabled (boolean) –
Indicates if the load balancing capability is enabled on your EKS Auto Mode cluster. If the load balancing capability is enabled, EKS Auto Mode will create and delete load balancers in your Amazon Web Services account.
storageConfig (dict) –
Update the configuration of the block storage capability of your EKS Auto Mode cluster. For example, enable the capability.
blockStorage (dict) –
Request to configure EBS Block Storage settings for your EKS Auto Mode cluster.
enabled (boolean) –
Indicates if the block storage capability is enabled on your EKS Auto Mode cluster. If the block storage capability is enabled, EKS Auto Mode will create and delete EBS volumes in your Amazon Web Services account.
- Return type:
dict
- Returns:
Response Syntax
{ 'update': { 'id': 'string', 'status': 'InProgress'|'Failed'|'Cancelled'|'Successful', 'type': 'VersionUpdate'|'EndpointAccessUpdate'|'LoggingUpdate'|'ConfigUpdate'|'AssociateIdentityProviderConfig'|'DisassociateIdentityProviderConfig'|'AssociateEncryptionConfig'|'AddonUpdate'|'VpcConfigUpdate'|'AccessConfigUpdate'|'UpgradePolicyUpdate'|'ZonalShiftConfigUpdate'|'AutoModeUpdate', 'params': [ { 'type': 'Version'|'PlatformVersion'|'EndpointPrivateAccess'|'EndpointPublicAccess'|'ClusterLogging'|'DesiredSize'|'LabelsToAdd'|'LabelsToRemove'|'TaintsToAdd'|'TaintsToRemove'|'MaxSize'|'MinSize'|'ReleaseVersion'|'PublicAccessCidrs'|'LaunchTemplateName'|'LaunchTemplateVersion'|'IdentityProviderConfig'|'EncryptionConfig'|'AddonVersion'|'ServiceAccountRoleArn'|'ResolveConflicts'|'MaxUnavailable'|'MaxUnavailablePercentage'|'ConfigurationValues'|'SecurityGroups'|'Subnets'|'AuthenticationMode'|'PodIdentityAssociations'|'UpgradePolicy'|'ZonalShiftConfig'|'ComputeConfig'|'StorageConfig'|'KubernetesNetworkConfig', 'value': 'string' }, ], 'createdAt': datetime(2015, 1, 1), 'errors': [ { 'errorCode': 'SubnetNotFound'|'SecurityGroupNotFound'|'EniLimitReached'|'IpNotAvailable'|'AccessDenied'|'OperationNotPermitted'|'VpcIdNotFound'|'Unknown'|'NodeCreationFailure'|'PodEvictionFailure'|'InsufficientFreeAddresses'|'ClusterUnreachable'|'InsufficientNumberOfReplicas'|'ConfigurationConflict'|'AdmissionRequestDenied'|'UnsupportedAddonModification'|'K8sResourceNotFound', 'errorMessage': 'string', 'resourceIds': [ 'string', ] }, ] } }
Response Structure
(dict) –
update (dict) –
An object representing an asynchronous update.
id (string) –
A UUID that is used to track the update.
status (string) –
The current status of the update.
type (string) –
The type of the update.
params (list) –
A key-value map that contains the parameters associated with the update.
(dict) –
An object representing the details of an update request.
type (string) –
The keys associated with an update request.
value (string) –
The value of the keys submitted as part of an update request.
createdAt (datetime) –
The Unix epoch timestamp at object creation.
errors (list) –
Any errors associated with a
Failed
update.(dict) –
An object representing an error when an asynchronous operation fails.
errorCode (string) –
A brief description of the error.
SubnetNotFound: We couldn’t find one of the subnets associated with the cluster.
SecurityGroupNotFound: We couldn’t find one of the security groups associated with the cluster.
EniLimitReached: You have reached the elastic network interface limit for your account.
IpNotAvailable: A subnet associated with the cluster doesn’t have any available IP addresses.
AccessDenied: You don’t have permissions to perform the specified operation.
OperationNotPermitted: The service role associated with the cluster doesn’t have the required access permissions for Amazon EKS.
VpcIdNotFound: We couldn’t find the VPC associated with the cluster.
errorMessage (string) –
A more complete description of the error.
resourceIds (list) –
An optional field that contains the resource IDs associated with the error.
(string) –
Exceptions