fbpx

Launch specifications allow you to configure multiple workload types on the same ocean cluster.
With Ocean launch specs you can configure sets of labels and taints (k8s) or attributes (ECS) to go along with a custom AMI, Instance Profile , Security Groups, and User Data script that will be used for the nodes/container instances that will serve your labeled workloads.
If a pod/task have no node-selector labels / attributes configured, the default AMI and user data configured on the Ocean cluster will be used.

Configuration:
  1. Log in to Spotinst Console
  2. Navigate to your Ocean Cluster
  3. Click on the Actions menu and select Launch Specifications
  4. Click Add Launch Specification
  5. Name your Launch Specification (for ECS)
  6. Add the labels/attributes which identify your Nodes/Container Instances
  7. Set the User Data script and make sure to label you instances according to your labels selection:
    1. For Kubernetes User Data, refer to the following tutorial.
    2. For ECS User Data, refer to the example 2 in following article.
  8. Optional: Set custom AMI, Instance Profile, and Security Groups for the launch specification

 

Example

Use case: Running a Windows-based node in a Linux-based cluster
In the given scenario, the default Ocean AMI will include a Linux OS, for a specific Pod – ‘WinPod’ a Windows image is required.
To ensure that the pod WinPod is using a Windows image you will need to perform the following steps:

  1. Configure your WinPod Pod with a dedicated nodeSelector
    1. i.e:
      apiVersion: v1
      kind: Pod
      metadata:
      name: WinPod
      spec:
        containers:
        - name: WinPodCon
          image: WinPodCon
          imagePullPolicy: IfNotPresent
        nodeSelector:
          runOnWin: true
  2. Configure your Ocean cluster with a launch specification that serves the WinPod nodeSelector label
    1. Log in to Spotinst Console
    2. Navigate to your Ocean Cluster
    3. Click on the Actions menu and select Launch Specifications
    4. Click Add Specification
      1. Add the the following label:
        1. Key: runOnWin
        2. Value: true
      2. Set the User Data script and make sure to label you Nodes with the “runOnWin”: “true” label
      3. Set the custom launch specification AMI to Windows OS

 If a pod requires a GPU instance, please add the relevant GPU AMI in the custom launch spec section. Ocean will spin up instances accordingly.
Specific labels are not required in this case.

Example:

resources:
        limits:
          nvidia.com/gpu: 1

You don’t need to add any extra label for GPU support, you can just use taints such that only your GPU based pods select a specific launch specification which contains the required GPU AMI.