k8s_cluster#
State module for managing Ocean AWS k8s cluster.
- async idem_spotinst.states.spotinst.ocean.aws.k8s_cluster.present(hub, ctx, name: str, controller_cluster_id: str, region: str, compute: Dict = None, resource_id: str = None, capacity: Dict = None, logging: Dict = None, scheduling: Dict = None, security: Dict = None, strategy: Dict = None, auto_scaler=None, update_policy: Dict = None) Dict[str, Any] [source]#
Create a Ocean k8s Cluster.
Refer the Spot Create Ocean Cluster documentation to get insight of functionality and input parameters
- Parameters:
name (str) – ocean cluster name.
resource_id (str, Optional) – The ocean cluster identifier.
auto_scaler (dict, Optional) – The automatic scaling mechanism used in Ocean for Kubernetes.
capacity (dict, Optional) – The overall capability of the Ocean cluster expressed as number of instances and specified with a minimum, a maximum, and a target number of running instances.
compute (dict, Optional) – Compute specifications for the Ocean cluster. This is required for greenfield and optional for brownfield.
controller_cluster_id (str) – Reporting identifier for the Ocean Controller.
logging (dict, Optional) – Logging configuration for ocean aws cluster.
region (str) – Region for the Ocean cluster to run in.
scheduling (dict, Optional) – An object used to define times for a task such as a shutdown to be activated.
security (dict, Optional) – Object for cluster security features.
strategy (dict, Optional) – An object defining the cluster strategy with regard to waiting periods and utilization of on-demand and reserved instances.
update_policy (dict, Optional) – Configures the cluster update policy. You can configure to start the roll on update and run it in defined batches.
- Request Syntax:
[spotinst.ocean.aws.k8s_cluster-state-id]: spotinst.ocean.aws.k8s_cluster.present: - name: 'string' - controller_cluster_id: 'string' - region: 'string' - update_policy: shouldRoll: boolean roll: batchSizePercentage: Integer comment: 'string' batchMinHealthyPercentage: Integer - compute: launchSpecification: keyPair: 'string' imageId: 'string' associatePublicIpAddress: boolean rootVolumeSize: Integer iamInstanceProfile: arn: 'string' userData: 'string' tags: - tagKey: 'string' tagValue: 'string' - tagKey: 'string' tagValue: 'string' securityGroupIds: - 'string' subnetIds: - 'string' instanceTypes: whitelist: - 'string' - strategy: fallbackToOd: boolean spotPercentage: Integer utilizeReservedInstances: boolean - auto_scaler: isEnabled: boolean isAutoConfig: boolean cooldown: Integer headroom: cpuPerUnit: Integer memoryPerUnit: Integer numOfUnits: Integer down: maxScaleDownPercentage: Integer - resourceLimits: maxMemoryGib: Integer maxVCpu: Integer - capacity: maximum: Integer minimum: Integer
- Returns:
Dict[str, Any]
Examples
ocean_cluster: spotinst.ocean.aws.k8s_cluster.present: - name: idem-test - controller_cluster_id: idem-test - region: ap-east-1 - update_policy: shouldRoll: false roll: batchSizePercentage: 30 comment: Idem cluster roll testing batchMinHealthyPercentage: 100 - compute: launchSpecification: keyPair: test-idem-key imageId: ami-06c9598a8dcd87e79 associatePublicIpAddress: False rootVolumeSize: 100 iamInstanceProfile: arn: arn:aws:iam::111222333:instance-profile/idem-instance-profile-test userData: | #!/bin/bash -xe /etc/eks/test-idem.sh tags: - tagKey: tag-ket-1 tagValue: tag-value-1 - tagKey: tag-ket-2 tagValue: tag-value-2 securityGroupIds: - sg-qbc111122223333 subnetIds: - subnet-0abc111222333 instanceTypes: whitelist: - c5.large - strategy: fallbackToOd: true spotPercentage: 100 utilizeReservedInstances: true - auto_scaler: isEnabled: True isAutoConfig: true cooldown: 300 headroom: cpuPerUnit: 1024 memoryPerUnit: 512 numOfUnits: 3 down: maxScaleDownPercentage: 60 resourceLimits: maxMemoryGib: 20000 maxVCpu: 100000 - capacity: maximum: 1000 minimum: 1
- async idem_spotinst.states.spotinst.ocean.aws.k8s_cluster.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any] [source]#
Deletes the specified Ocean cluster.
When this call completes, the cluster is no longer available for use.
Refer the Spot Delete Ocean Cluster documentation to get insight of functionality and input parameters
- Parameters:
- Request Syntax:
[k8s_cluster-resource-id]: spotinst.ocean.aws.k8s_cluster.absent: - name: 'string' - resource_id: 'string'
- Returns:
Dict[str, Any]
Examples
idem-test-k8s_cluster: spotinst.ocean.aws.k8s_cluster.absent: - name: idem-test-k8s_cluster - resource_id:idem-test-k8s_cluster
- async idem_spotinst.states.spotinst.ocean.aws.k8s_cluster.describe(hub, ctx) Dict[str, Dict[str, Any]] [source]#
Describe the resource in a way that can be recreated/managed with the corresponding “present” function.
Gets information about the ocean clusters.
Refer the Spot Listing Ocean Cluster documentation to get insight of functionality and input parameters
- Returns:
Dict[str, Dict[str, Any]]
Examples
$ idem describe spotinst.ocean.aws.k8s_cluster