fbpx

We are now ready to create our cluster!

Here’s how to get started:

Option 1: Create A New Cluster

  1. Download the Spotinst’s KOPS binary
  2. Verify the required scripts from prerequisites are available. if not, Download the updated scripts and open the archive file.
  3. Set your required cluster variables in the downloaded 00-env.sh.
  4. Execute 01-create.sh.

 

Option 2: Migrate an existing cluster managed by AWS Auto Scaling Groups to Spotinst Ocean

    1. To perform the migration with no downtime, migrate the masters one-by-one:
      1. For each master:
        1. Drain the node (kubectl drain <node>)
        2. Scale down the Auto Scaling Group by one instance
        3. Import the Auto Scaling Group into Spotinst Elastigroup. Make sure to specify the following during Elastigroup creation:
          1. The Elastigroup’s name equals by default to the Auto Scaling Group name, don’t change its name. 
          2. Masters are recommended to run as On-Demand instances. Switch to the General tab, and under Advanced set the Spot Percentage to 0.
      2. Repeat the steps with the next master node, until all nodes are running in Spotinst, and all masters Auto Scaling Groups were downscaled to zero. If all masters were running in the same Auto Scaling Group prior to the import, in step a.3 increase the capacity of your master Elastigroup instead of creating another one.
    2. Enable Spotinst support by toggling the feature flag:

      export KOPS_FEATURE_FLAGS="+Spotinst,SpotinstOcean"

      Make sure that Spotinst environment variables are defined: SPOTINST_TOKENand SPOTINST_ACCOUNT

    3. In a case of multiple worker nodes Instance Groups:
      1. Set the Ocean default launch specification label on your primary Instance Group.
      2. Import the primary Instance Group associated Auto Scaling Group to Spotinst.
        1. This can be done via the Console or via API.
      3. run KOPS Update
        1. Kops will now identify and create the missing launch specifications on your Ocean Cluster.
      4. Gradually scale down your Auto Scaling Groups
        1. Ocean will automatically provision the required instances to ensure your pods are scheduled.
    4. In a case of a single Instance Group:
        1. Import your Auto Scaling Group to Spotinst
          1. This can be done via the Console or via API.
        2. Gradually scale down your Auto Scaling Groups
          1. Ocean will automatically provision the required instances to ensure your pods are scheduled.
      1. Clean up (optional):
        1. Delete all Auto Scaling Groups.
        2. Delete all Launch Configurations.