how to upgrade kubernetes version when image is specified

3/1/2019

I'm kinda new here, so please be gentle with me.

I've inherited an old (ish) kops install procedure using Ansible scripts, which has a specific version of the "kope.io" image within the Instance Group creation

apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  creationTimestamp: null
  labels:
    kops.k8s.io/cluster: {{ k8s_cluster_name }}
  name: master-{{ vpc_region }}a
spec:
  associatePublicIp: false
  image: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-02-08
  machineType: "{{ master_instance_type }}"
  maxSize: 1
  minSize: 1
{% if use_spot %}
  maxPrice: "{{ spot_price }}"
{% endif %}
  nodeLabels:
    kops.k8s.io/instancegroup: master-{{ vpc_region }}a
  role: Master
  subnets:
  - {{ vpc_region }}a-private-subnet

As you can see the line image: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-02-08 pins me to a specific k8s version.

I want to rebuild with a newer version, but I'm not sure if I still need to specify this image, and if I do which image should I use?

I'd like to at least update this to 1.9.11, but ideally I think I should be going to the newest stable version. (1.13.0?) but I know a lot has changed since then, so it's likely things will break?

So much information by doing a Google search for this, but much of it is confusing or conflicting (or outdated. Any pointers much appreciated.

-- Steve Button
amazon-web-services
kops
kubernetes

1 Answer

3/1/2019

According to kops documentation you can specify an image and that will be used to provision the AMI that will build your instance group.

You can find out the latest kope.io images and their respective kubernetes versions at https://github.com/kubernetes/kops/blob/master/channels/stable

I'm not sure if you can work with different kope.io/k8s-x.xx versions than the ones you are provisioning, or if kops enforces the restrictions that are stated in the stable channel, but you can see that the different kope.io images should be configured to the different Kubernetes versions.

You should try your infrastructure in a test environment just to be safe and not lose data. You should keep in mind that if you need to use hostPath-based mountpoints, you should probably migrate those to the new cluster or use some sort of backup mechanism.

In any case, take a look at the kops compatibility matrix and see which kops version you should use for the upgrade you want. You may prefer to do upgrades to interim versions so that you can both upgrade the cluster and kops itself until you are up-to-date, in order to use procedures that have probably been more tested :)

-- ssice
Source: StackOverflow