OceanImport

Provides a Spotinst Ocean GKE import resource.

scheduled task

  • scheduled_task - (Optional) Set scheduling object.
    • shutdown_hours - (Optional) Set shutdown hours for cluster object.
      • is_enabled - (Optional) Flag to enable / disable the shutdown hours. Example: True
      • time_windows - (Required) Set time windows for shutdown hours. specify a list of ‘timeWindows’ with at least one time window Each string is in the format of - ddd:hh:mm-ddd:hh:mm ddd = day of week = Sun | Mon | Tue | Wed | Thu | Fri | Sat hh = hour 24 = 0 -23 mm = minute = 0 - 59. Time windows should not overlap. required on cluster.scheduling.isEnabled = True. API Times are in UTC Example: Fri:15:30-Wed:14:30
    • tasks - (Optional) The scheduling tasks for the cluster.
      • is_enabled - (Required) Describes whether the task is enabled. When true the task should run when false it should not run. Required for cluster.scheduling.tasks object.
      • cron_expression - (Required) A valid cron expression. For example : “ * * * * * “.The cron is running in UTC time zone and is in Unix cron format Cron Expression Validator Script. Only one of ‘frequency’ or ‘cronExpression’ should be used at a time. Required for cluster.scheduling.tasks object Example: 0 1 * * *
      • task_type - (Required) Valid values: “clusterRoll”. Required for cluster.scheduling.tasks object.
      • batch_size_percentage - (Optional) Value in % to set size of batch in roll. Valid values are 0-100 Example: 20.
import * as pulumi from "@pulumi/pulumi";
import pulumi
using Pulumi;

class MyStack : Stack
{
    public MyStack()
    {
    }

}

Autoscaler

  • autoscaler - (Optional) The Ocean Kubernetes Autoscaler object.
  • is_enabled - (Optional, Default: true) Enable the Ocean Kubernetes Autoscaler.
  • is_auto_config - (Optional, Default: true) Automatically configure and optimize headroom resources.
  • auto_headroom_percentage - Optionally set the auto headroom percentage, set a number between 0-200 to control the headroom % from the cluster. Relevant when isAutoConfig=true.
  • cooldown - (Optional, Default: null) Cooldown period between scaling actions.
  • headroom - (Optional) Spare resource capacity management enabling fast assignment of Pods without waiting for new resources to launch.
  • cpu_per_unit - (Optional) Optionally configure the number of CPUs to allocate the headroom. CPUs are denoted in millicores, where 1000 millicores = 1 vCPU.
  • memory_per_unit - (Optional) Optionally configure the amount of memory (MiB) to allocate the headroom.
  • gpu_per_unit - (Optional) How much GPU allocate for headroom unit.
  • num_of_units - (Optional) The number of units to retain as headroom, where each unit has the defined headroom CPU and memory.
  • down - (Optional) Auto Scaling scale down operations.
  • evaluation_periods - (Optional, Default: null) The number of evaluation periods that should accumulate before a scale down action takes place.
  • max_scale_down_percentage - (Optional) Would represent the maximum % to scale-down. Number between 1-100.
  • resource_limits - (Optional) Optionally set upper and lower bounds on the resource usage of the cluster.
  • max_vcpu - (Optional) The maximum cpu in vCpu units that can be allocated to the cluster.
  • max_memory_gib - (Optional) The maximum memory in GiB units that can be allocated to the cluster.
import * as pulumi from "@pulumi/pulumi";
import pulumi
using Pulumi;

class MyStack : Stack
{
    public MyStack()
    {
    }

}

Example Usage

using Pulumi;
using SpotInst = Pulumi.SpotInst;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new SpotInst.Gke.OceanImport("example", new SpotInst.Gke.OceanImportArgs
        {
            BackendServices = 
            {
                new SpotInst.Gke.Inputs.OceanImportBackendServiceArgs
                {
                    LocationType = "regional",
                    NamedPorts = 
                    {
                        new SpotInst.Gke.Inputs.OceanImportBackendServiceNamedPortArgs
                        {
                            Name = "http",
                            Ports = 
                            {
                                "80",
                                "8080",
                            },
                        },
                    },
                    Scheme = "INTERNAL",
                    ServiceName = "example-backend-service",
                },
            },
            ClusterName = "example-cluster-name",
            DesiredCapacity = 0,
            Location = "us-central1-a",
            MaxSize = 2,
            MinSize = 0,
            Whitelists = 
            {
                "n1-standard-1",
                "n1-standard-2",
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_spotinst as spotinst

example = spotinst.gke.OceanImport("example",
    backend_services=[{
        "locationType": "regional",
        "namedPorts": [{
            "name": "http",
            "ports": [
                80,
                8080,
            ],
        }],
        "scheme": "INTERNAL",
        "serviceName": "example-backend-service",
    }],
    cluster_name="example-cluster-name",
    desired_capacity=0,
    location="us-central1-a",
    max_size=2,
    min_size=0,
    whitelists=[
        "n1-standard-1",
        "n1-standard-2",
    ])
import * as pulumi from "@pulumi/pulumi";
import * as spotinst from "@pulumi/spotinst";

const example = new spotinst.gke.OceanImport("example", {
    backendServices: [{
        locationType: "regional",
        namedPorts: [{
            name: "http",
            ports: [
                "80",
                "8080",
            ],
        }],
        scheme: "INTERNAL",
        serviceName: "example-backend-service",
    }],
    clusterName: "example-cluster-name",
    desiredCapacity: 0,
    location: "us-central1-a",
    maxSize: 2,
    minSize: 0,
    whitelists: [
        "n1-standard-1",
        "n1-standard-2",
    ],
});

Create a OceanImport Resource

def OceanImport(resource_name, opts=None, autoscaler=None, backend_services=None, cluster_name=None, desired_capacity=None, location=None, max_size=None, min_size=None, scheduled_tasks=None, whitelists=None, __props__=None);
func NewOceanImport(ctx *Context, name string, args OceanImportArgs, opts ...ResourceOption) (*OceanImport, error)
public OceanImport(string name, OceanImportArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args OceanImportArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args OceanImportArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args OceanImportArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

OceanImport Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The OceanImport resource accepts the following input properties:

ClusterName string

The GKE cluster name.

Location string

The zone the master cluster is located in.

Autoscaler Pulumi.SpotInst.Gke.Inputs.OceanImportAutoscalerArgs
BackendServices List<Pulumi.SpotInst.Gke.Inputs.OceanImportBackendServiceArgs>

Describes the backend service configurations.

DesiredCapacity int

The number of instances to launch and maintain in the cluster.

MaxSize int

The upper limit of instances the cluster can scale up to.

MinSize int

The lower limit of instances the cluster can scale down to.

ScheduledTasks List<Pulumi.SpotInst.Gke.Inputs.OceanImportScheduledTaskArgs>
Whitelists List<string>
ClusterName string

The GKE cluster name.

Location string

The zone the master cluster is located in.

Autoscaler OceanImportAutoscaler
BackendServices []OceanImportBackendService

Describes the backend service configurations.

DesiredCapacity int

The number of instances to launch and maintain in the cluster.

MaxSize int

The upper limit of instances the cluster can scale up to.

MinSize int

The lower limit of instances the cluster can scale down to.

ScheduledTasks []OceanImportScheduledTask
Whitelists []string
clusterName string

The GKE cluster name.

location string

The zone the master cluster is located in.

autoscaler OceanImportAutoscaler
backendServices OceanImportBackendService[]

Describes the backend service configurations.

desiredCapacity number

The number of instances to launch and maintain in the cluster.

maxSize number

The upper limit of instances the cluster can scale up to.

minSize number

The lower limit of instances the cluster can scale down to.

scheduledTasks OceanImportScheduledTask[]
whitelists string[]
cluster_name str

The GKE cluster name.

location str

The zone the master cluster is located in.

autoscaler Dict[OceanImportAutoscaler]
backend_services List[OceanImportBackendService]

Describes the backend service configurations.

desired_capacity float

The number of instances to launch and maintain in the cluster.

max_size float

The upper limit of instances the cluster can scale up to.

min_size float

The lower limit of instances the cluster can scale down to.

scheduled_tasks List[OceanImportScheduledTask]
whitelists List[str]

Outputs

All input properties are implicitly available as output properties. Additionally, the OceanImport resource produces the following output properties:

ClusterControllerId string
Id string
The provider-assigned unique ID for this managed resource.
ClusterControllerId string
Id string
The provider-assigned unique ID for this managed resource.
clusterControllerId string
id string
The provider-assigned unique ID for this managed resource.
cluster_controller_id str
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing OceanImport Resource

Get an existing OceanImport resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: OceanImportState, opts?: CustomResourceOptions): OceanImport
static get(resource_name, id, opts=None, autoscaler=None, backend_services=None, cluster_controller_id=None, cluster_name=None, desired_capacity=None, location=None, max_size=None, min_size=None, scheduled_tasks=None, whitelists=None, __props__=None);
func GetOceanImport(ctx *Context, name string, id IDInput, state *OceanImportState, opts ...ResourceOption) (*OceanImport, error)
public static OceanImport Get(string name, Input<string> id, OceanImportState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Autoscaler Pulumi.SpotInst.Gke.Inputs.OceanImportAutoscalerArgs
BackendServices List<Pulumi.SpotInst.Gke.Inputs.OceanImportBackendServiceArgs>

Describes the backend service configurations.

ClusterControllerId string
ClusterName string

The GKE cluster name.

DesiredCapacity int

The number of instances to launch and maintain in the cluster.

Location string

The zone the master cluster is located in.

MaxSize int

The upper limit of instances the cluster can scale up to.

MinSize int

The lower limit of instances the cluster can scale down to.

ScheduledTasks List<Pulumi.SpotInst.Gke.Inputs.OceanImportScheduledTaskArgs>
Whitelists List<string>
Autoscaler OceanImportAutoscaler
BackendServices []OceanImportBackendService

Describes the backend service configurations.

ClusterControllerId string
ClusterName string

The GKE cluster name.

DesiredCapacity int

The number of instances to launch and maintain in the cluster.

Location string

The zone the master cluster is located in.

MaxSize int

The upper limit of instances the cluster can scale up to.

MinSize int

The lower limit of instances the cluster can scale down to.

ScheduledTasks []OceanImportScheduledTask
Whitelists []string
autoscaler OceanImportAutoscaler
backendServices OceanImportBackendService[]

Describes the backend service configurations.

clusterControllerId string
clusterName string

The GKE cluster name.

desiredCapacity number

The number of instances to launch and maintain in the cluster.

location string

The zone the master cluster is located in.

maxSize number

The upper limit of instances the cluster can scale up to.

minSize number

The lower limit of instances the cluster can scale down to.

scheduledTasks OceanImportScheduledTask[]
whitelists string[]
autoscaler Dict[OceanImportAutoscaler]
backend_services List[OceanImportBackendService]

Describes the backend service configurations.

cluster_controller_id str
cluster_name str

The GKE cluster name.

desired_capacity float

The number of instances to launch and maintain in the cluster.

location str

The zone the master cluster is located in.

max_size float

The upper limit of instances the cluster can scale up to.

min_size float

The lower limit of instances the cluster can scale down to.

scheduled_tasks List[OceanImportScheduledTask]
whitelists List[str]

Supporting Types

OceanImportAutoscaler

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

AutoHeadroomPercentage int
Cooldown int
Down Pulumi.SpotInst.Gke.Inputs.OceanImportAutoscalerDownArgs
Headroom Pulumi.SpotInst.Gke.Inputs.OceanImportAutoscalerHeadroomArgs
IsAutoConfig bool
IsEnabled bool
ResourceLimits Pulumi.SpotInst.Gke.Inputs.OceanImportAutoscalerResourceLimitsArgs
AutoHeadroomPercentage int
Cooldown int
Down OceanImportAutoscalerDown
Headroom OceanImportAutoscalerHeadroom
IsAutoConfig bool
IsEnabled bool
ResourceLimits OceanImportAutoscalerResourceLimits
autoHeadroomPercentage number
cooldown number
down OceanImportAutoscalerDown
headroom OceanImportAutoscalerHeadroom
isAutoConfig boolean
isEnabled boolean
resourceLimits OceanImportAutoscalerResourceLimits
autoHeadroomPercentage float
cooldown float
down Dict[OceanImportAutoscalerDown]
headroom Dict[OceanImportAutoscalerHeadroom]
isAutoConfig bool
isEnabled bool
resource_limits Dict[OceanImportAutoscalerResourceLimits]

OceanImportAutoscalerDown

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

EvaluationPeriods int
MaxScaleDownPercentage double
EvaluationPeriods int
MaxScaleDownPercentage float64
evaluationPeriods number
maxScaleDownPercentage number
evaluationPeriods float
maxScaleDownPercentage float

OceanImportAutoscalerHeadroom

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

CpuPerUnit int
GpuPerUnit int
MemoryPerUnit int
NumOfUnits int
CpuPerUnit int
GpuPerUnit int
MemoryPerUnit int
NumOfUnits int
cpuPerUnit number
gpuPerUnit number
memoryPerUnit number
numOfUnits number
cpuPerUnit float
gpuPerUnit float
memoryPerUnit float
numOfUnits float

OceanImportAutoscalerResourceLimits

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

MaxMemoryGib int
MaxVcpu int
MaxMemoryGib int
MaxVcpu int
maxMemoryGib number
maxVcpu number
maxMemoryGib float
maxVcpu float

OceanImportBackendService

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

ServiceName string

The name of the backend service.

LocationType string

Sets which location the backend services will be active. Valid values: regional, global.

NamedPorts List<Pulumi.SpotInst.Gke.Inputs.OceanImportBackendServiceNamedPortArgs>
Scheme string

Use when location_type is regional. Set the traffic for the backend service to either between the instances in the vpc or to traffic from the internet. Valid values: INTERNAL, EXTERNAL.

ServiceName string

The name of the backend service.

LocationType string

Sets which location the backend services will be active. Valid values: regional, global.

NamedPorts []OceanImportBackendServiceNamedPort
Scheme string

Use when location_type is regional. Set the traffic for the backend service to either between the instances in the vpc or to traffic from the internet. Valid values: INTERNAL, EXTERNAL.

serviceName string

The name of the backend service.

locationType string

Sets which location the backend services will be active. Valid values: regional, global.

namedPorts OceanImportBackendServiceNamedPort[]
scheme string

Use when location_type is regional. Set the traffic for the backend service to either between the instances in the vpc or to traffic from the internet. Valid values: INTERNAL, EXTERNAL.

serviceName str

The name of the backend service.

locationType str

Sets which location the backend services will be active. Valid values: regional, global.

namedPorts List[OceanImportBackendServiceNamedPort]
scheme str

Use when location_type is regional. Set the traffic for the backend service to either between the instances in the vpc or to traffic from the internet. Valid values: INTERNAL, EXTERNAL.

OceanImportBackendServiceNamedPort

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Name string
Ports List<string>

A list of ports.

Name string
Ports []string

A list of ports.

name string
ports string[]

A list of ports.

name str
ports List[str]

A list of ports.

OceanImportScheduledTask

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

ShutdownHours Pulumi.SpotInst.Gke.Inputs.OceanImportScheduledTaskShutdownHoursArgs
Tasks List<Pulumi.SpotInst.Gke.Inputs.OceanImportScheduledTaskTaskArgs>
ShutdownHours OceanImportScheduledTaskShutdownHours
Tasks []OceanImportScheduledTaskTask
shutdownHours OceanImportScheduledTaskShutdownHours
tasks OceanImportScheduledTaskTask[]
shutdownHours Dict[OceanImportScheduledTaskShutdownHours]
tasks List[OceanImportScheduledTaskTask]

OceanImportScheduledTaskShutdownHours

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

TimeWindows List<string>
IsEnabled bool
TimeWindows []string
IsEnabled bool
timeWindows string[]
isEnabled boolean
timeWindows List[str]
isEnabled bool

OceanImportScheduledTaskTask

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

CronExpression string
IsEnabled bool
TaskType string
BatchSizePercentage int
CronExpression string
IsEnabled bool
TaskType string
BatchSizePercentage int
cronExpression string
isEnabled boolean
taskType string
batchSizePercentage number
cronExpression str
isEnabled bool
taskType str
batchSizePercentage float

Package Details

Repository
https://github.com/pulumi/pulumi-spotinst
License
Apache-2.0
Notes
This Pulumi package is based on the spotinst Terraform Provider.