Keeping pace with Kubernetes
Tags: kubernetes, releases, updates, k8s
Published: 2022-12-13 21:48:03

As people are generally aware, most evolution in tech follows a rapid pace, and none more so than the Kubernetes project (and the surrounding ecosystem).

In mid-2021, the Kubernetes Release Team [announced](https://kubernetes.io/blog/2021/07/20/new-kubernetes-release-cadence/) that they will be releasing a new version of Kubernetes every 4 months, and will be supporting each release of Kubernetes for 12-14 months from release. This effectively means that Kubernetes has an N-2 support cycle (current release, and the two immediately prior to it.

Each release of Kubernetes comes with an associated raft of API deprecations, releases, and additions (see https://kubernetes.io/docs/reference/using-api/deprecation-guide/). These can range from relatively minor API version changes (e.g. a beta API becomes GA - usually available in parallel for 3 releases/12 months) to pretty substantial code or process changes (which require re-writes/re-architecting and have been available for 6+ releases).

One such milestone release was Kubernetes 1.22 - which took significant work for the Lagoon team to achieve compliance with (see the blog at https://dev.to/uselagoon/lagoon-kubernetes-122-ek8). In this release, announcing compatibility with 1.22, we also added a “minimum supported version” of 1.19, in order to be able to utilize the parallel API releases. 

With the release of 1.24, 1.25 (and shortly 1.26), there come similar (if not as impacting) challenges with Lagoon components.  For this reason, we will be implementing similar “minimum supported version” constraints on the Lagoon releases supporting these Kubernetes releases.

When timing our Lagoon releases, however, we have some ability to define our own schedule (within certain bounds!).

Looking at the timing for Kubernetes 1.24 alone:

- It was released on May 3rd, 2022
- It became “Generally Available” in Azure AKS in July 2022 
- It became available in the “Regular Channel” in Google GKE in November 2022
- It became available on AWS EKS in November 2022 
- Official EOL is July 28th, 2023
- Azure AKS will end support in July 2023 
- Google GKE will end support in September 2023
- Amazon EKS will end support in January 2024

While Kubernetes has no officially published API deprecations for 1.24, there is actually one thing that does catch us out, in that service accounts no longer get secrets automatically defined for them (which we use to control builds, tasks etc) - so we will have to rewrite some of our controller code to handle the generation of time-scoped tokens instead.

Given the only recent availability of 1.24 across the clusters we support and manage - this hasn’t been a pressing issue for us. But together with the EOL of 1.20 support in all the major providers, it also presents an opportunity for us to be more agile in adopting the parallel API availability and reducing the upgrade burden for new releases.

The most recent version of Lagoon (v2.11.0 and the additional lagoon-remote and lagoon-logging components) already supports Kubernetes 1.24.

The Lagoon team is proposing to release a version of Lagoon in early January that:
> - Fully supports Kubernetes 1.24 (as it is now GA on all platforms)
> - Supports a minimum Kubernetes 1.21 (even though it’s almost EOL)
> - Introduces the API upgrades available in 1.21 (CronJob and PodDisruptionBudget)

Generally, going forwards:
> - We will make Lagoon available for use on the Kubernetes versions available on the leading managed Kubernetes platforms that (we know) are running Lagoon in production (EKS, GKE, AKS).
> - Lagoon components will have a minimum Kubernetes version to allow us to use the more modern features. We'll try to keep it close to N-3 to allow the lag from providers.
> - Users of Lagoon should pay close attention to the Lagoon release notes, and ensure that not only Lagoon but also the underlying Kubernetes installations are regularly updated.
> - We’ll be publishing more comprehensive helmchart-specific changelogs via our repository on artifacthub - https://artifacthub.io/packages/search?org=uselagoon&sort=relevance&page=1 

Please reach out to the team if you want us to cover any of this in more detail.




_Support/Release periods backgrounds:_

- [Kubernetes](https://kubernetes.io/releases/patch-releases/#support-period)
- [Amazon EKS](https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html#kubernetes-release-calendar)
- [Azure AKS](https://learn.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-kubernetes-release-calendar)
- [Google GKE](https://cloud.google.com/kubernetes-engine/docs/release-schedule)
- [Oracle OCI](https://docs.oracle.com/en-us/iaas/Content/ContEng/Concepts/contengaboutk8sversions.htm) 
- [IBM CKS](https://cloud.ibm.com/docs/containers?topic=containers-cs_versions)
- [Alibaba ACK](https://www.alibabacloud.com/help/en/container-service-for-kubernetes/latest/ack-releases-of-kubernetes)
- Openshift 4 has varied release calendars depending on which variant you are running, and on which provider - note that Openshift support in Lagoon isn’t always guaranteed, owing to some inconsistencies with the Kubernetes implementation, and the difficulties in testing.