From 4c06aa98b5240b016096635c30ba4903c96a4dd2 Mon Sep 17 00:00:00 2001
From: Cristian Calin <6627509+cristicalin@users.noreply.github.com>
Date: Wed, 28 Apr 2021 21:30:51 +0300
Subject: [PATCH] crio: add supported versions 1.20 and 1.21 and align default
 with k8s version (#7562)

* crio: add supported versions 1.20 and 1.21 and align default with k8s version

* cri-o: drop versions 1.17 and 1.18 from version matrix

* update note on cri-o version alignment
---
 README.md                                      | 7 +++++--
 roles/container-engine/cri-o/defaults/main.yml | 6 +++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 413d631a8..33f76b8c7 100644
--- a/README.md
+++ b/README.md
@@ -132,7 +132,7 @@ Note: Upstart/SysV init based OS types are not supported.
   - [etcd](https://github.com/coreos/etcd) v3.4.13
   - [docker](https://www.docker.com/) v19.03 (see note)
   - [containerd](https://containerd.io/) v1.4.4
-  - [cri-o](http://cri-o.io/) v1.19 (experimental: see [CRI-O Note](docs/cri-o.md). Only on fedora, ubuntu and centos based OS)
+  - [cri-o](http://cri-o.io/) v1.20 (experimental: see [CRI-O Note](docs/cri-o.md). Only on fedora, ubuntu and centos based OS)
 - Network Plugin
   - [cni-plugins](https://github.com/containernetworking/plugins) v0.9.1
   - [calico](https://github.com/projectcalico/calico) v3.17.3
@@ -152,7 +152,10 @@ Note: Upstart/SysV init based OS types are not supported.
   - [coredns](https://github.com/coredns/coredns) v1.7.0
   - [ingress-nginx](https://github.com/kubernetes/ingress-nginx) v0.43.0
 
-Note: The list of available docker version is 18.09, 19.03 and 20.10. The recommended docker version is 19.03. The kubelet might break on docker's non-standard version numbering (it no longer uses semantic versioning). To ensure auto-updates don't break your cluster look into e.g. yum versionlock plugin or apt pin).
+## Container Runtime Notes
+
+- The list of available docker version is 18.09, 19.03 and 20.10. The recommended docker version is 19.03. The kubelet might break on docker's non-standard version numbering (it no longer uses semantic versioning). To ensure auto-updates don't break your cluster look into e.g. yum versionlock plugin or apt pin).
+- The cri-o version should be aligned with the respective kubernetes version (i.e. kube_version=1.20.x, crio_version=1.20)
 
 ## Requirements
 
diff --git a/roles/container-engine/cri-o/defaults/main.yml b/roles/container-engine/cri-o/defaults/main.yml
index 98d6b30a5..c52ca8e26 100644
--- a/roles/container-engine/cri-o/defaults/main.yml
+++ b/roles/container-engine/cri-o/defaults/main.yml
@@ -39,11 +39,11 @@ crio_stream_port: "10010"
 crio_required_version: "{{ kube_version | regex_replace('^v(?P<major>\\d+).(?P<minor>\\d+).(?P<patch>\\d+)$', '\\g<major>.\\g<minor>') }}"
 
 crio_kubernetes_version_matrix:
+  "1.21": "1.21"
+  "1.20": "1.20"
   "1.19": "1.19"
-  "1.18": "1.18"
-  "1.17": "1.17"
 
-crio_version: "{{ crio_kubernetes_version_matrix[crio_required_version] | default('1.19') }}"
+crio_version: "{{ crio_kubernetes_version_matrix[crio_required_version] | default('1.20') }}"
 
 # The crio_runtimes variable defines a list of OCI compatible runtimes.
 crio_runtimes:
-- 
GitLab