In this tutorial, you will learn how to update the Spotinst controller in your K8s cluster, in case an update is required:

Option 1: Kubernetes version below 1.9

In case you are using K8s version below 1.9, please run the following command:

kubectl apply -f http://spotinst-public.s3.amazonaws.com/integrations/kubernetes/cluster-controller/spotinst-kubernetes-cluster-controller.yaml

 

Option 2: Kubernetes version 1.9 and above

In case you are using K8’s version 1.9 and above, then you will need to install the GA version of the controller:

  1. Prior to upgrading the latest GA controller version, you would have to delete any non GA version controllers:
    a. Collect the details of all of the Spotinst deployments:

    kubectl get deploy --namespace kube-system

    b. Based on the above output, you will need to delete all of the Spotinst Deployments, please see the example below:

    kubectl delete deployment spotinst-kubernetes-cluster-controller -n kube-system
  2. Install the latest GA controller version:

    kubectl apply -f https://s3.amazonaws.com/spotinst-public/integrations/kubernetes/cluster-controller/spotinst-kubernetes-cluster-controller-ga.yaml

     

In case the controller is already installed, this action will start a roll in the cluster, which will launch a new pod and terminate the old one.
When the controller is booting up, it prints the version in the log.

Controller Auto Update

The Spotinst Kubernetes Controller supports auto update. Meaning, when a new version of the controller is available, it will automatically be updated.
By default, the auto-update is enabled.

As a best-practice, Spotinst highly recommends leaving Auto Update enabled, due to the fact that the update procedure is silent and requires no downtime. In addition to that, every controller version update improves stability and performance, collects new metrics, and supports new K8s versions.

Note: Automatic updates for the Spotinst-Controller are supported from Kubernetes version 1.12. In case you are using a lower version and would like to enjoy the auto-update feature, please use a higher version.

In case you wish to disable the auto-update, follow these instructions:

  1. Edit your Spotinst controller configMap.yaml file (spotinst-kubernetes-cluster-controller-config), as shown here.
  2. Add the following line to the file, under the data section:
    disable-auto-update: "true"
  3. Apply the changes via the following command:
    kubectl apply -f configMap.yaml