fbpx

In case an update is required for the Spotinst Kubernetes Controller:

  • If you are using K8s version below 1.9, run the following command:
    kubectl apply -f http://spotinst-public.s3.amazonaws.com/integrations/kubernetes/cluster-controller/spotinst-kubernetes-cluster-controller.yaml
  • If you are using K8’s version 1.9 and above then you will have to install the GA version of the controller:
  1. Before upgrading to the latest GA controller version you would have to delete any non GA version controllers:
    a. Get the details of all the Spotinst deployment:

    kubectl get deploy --namespace kube-system

    b. Based on the above output you need to delete all the Spotinst Deployment, below is an example:

    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

     

If the controller is already installed, this will start a roll in the cluster that will launch a new pod and will terminate the old one.
When the controller starts it prints the version in the log.

The 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.

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

  1. Download the Spotinstcontroller YAML file using this link:
    https://s3.amazonaws.com/spotinst-public/integrations/kubernetes/cluster-controller/spotinst-kubernetes-cluster-controller.yaml
  2. Edit the file and add the DISABLE_AUTO_UPDATE variable as true under the Deployment resource as follows:
kind: Deployment
apiVersion: apps/v1beta1
metadata:
  labels:
    k8s-app: spotinst-kubernetes-cluster-controller
  name: spotinst-kubernetes-cluster-controller
  namespace: kube-system
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      k8s-app: spotinst-kubernetes-cluster-controller
  template:
    metadata:
      labels:
        k8s-app: spotinst-kubernetes-cluster-controller
    spec:
      containers:
      - name: spotinst-kubernetes-cluster-controller
        imagePullPolicy: Always
        image: spotinst/kubernetes-cluster-controller:1.0.12
        volumeMounts:
        - name: spotinst-kubernetes-cluster-controller-certs
          mountPath: /certs
        - name: tmp-volume
          mountPath: /tmp
        env:
           - name: SPOTINST_TOKEN
             valueFrom:
               configMapKeyRef:
                 name: spotinst-kubernetes-cluster-controller-config
                 key: spotinst.token
           - name: SPOTINST_ACCOUNT
             valueFrom:
               configMapKeyRef:
                 name: spotinst-kubernetes-cluster-controller-config
                 key: spotinst.account
           - name: CLUSTER_IDENTIFIER
             valueFrom:
               configMapKeyRef:
                 name: spotinst-kubernetes-cluster-controller-config
                 key: spotinst.cluster-identifier
           - name: DISABLE_AUTO_UPDATE
             value: "true"
      volumes:
      - name: spotinst-kubernetes-cluster-controller-certs
        secret:
          secretName: spotinst-kubernetes-cluster-controller-certs
      - name: tmp-volume
        emptyDir: {}
      serviceAccountName: spotinst-kubernetes-cluster-controller
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule