summaryrefslogtreecommitdiff
path: root/roles/kubernetes/base
diff options
context:
space:
mode:
Diffstat (limited to 'roles/kubernetes/base')
-rw-r--r--roles/kubernetes/base/defaults/main.yml2
-rw-r--r--roles/kubernetes/base/tasks/main.yml25
2 files changed, 12 insertions, 15 deletions
diff --git a/roles/kubernetes/base/defaults/main.yml b/roles/kubernetes/base/defaults/main.yml
index 2b69fb5e..07a37504 100644
--- a/roles/kubernetes/base/defaults/main.yml
+++ b/roles/kubernetes/base/defaults/main.yml
@@ -1,4 +1,2 @@
---
-kubernetes_cri_tools_pkg_version: "{{ ([0, 1] | map('extract', kubernetes_version.split('.'))) | join('.') }}.0-00"
-
kubernetes_cri_sandbox_image: "registry.k8s.io/pause:3.9"
diff --git a/roles/kubernetes/base/tasks/main.yml b/roles/kubernetes/base/tasks/main.yml
index d2f7ef81..614f7685 100644
--- a/roles/kubernetes/base/tasks/main.yml
+++ b/roles/kubernetes/base/tasks/main.yml
@@ -20,27 +20,26 @@
include_role:
name: apt-repo/kubernetes
-- name: generate apt pin files for kubelet and cri-tools
- loop:
- - name: kubelet
- version: "{{ kubernetes_version }}-00"
- - name: cri-tools
- version: "{{ kubernetes_cri_tools_pkg_version }}"
- loop_control:
- label: "{{ item.name }} == {{ item.version }}"
+- name: generate apt pin file for kubelet
copy:
- dest: "/etc/apt/preferences.d/{{ item.name }}.pref"
+ dest: "/etc/apt/preferences.d/kubelet.pref"
content: |
- Package: {{ item.name }}
- Pin: version {{ item.version }}
+ Package: kubelet
+ Pin: version {{ kubernetes_version }}-*
Pin-Priority: 1001
+## TODO: remove once all servers have been converted
+- name: remove apt pin file for cri-tools
+ file:
+ path: "/etc/apt/preferences.d/cri-tools.pref"
+ state: absent
+
- name: install kubelet and common packages
apt:
name:
- bridge-utils
- - "cri-tools={{ kubernetes_cri_tools_pkg_version }}"
- - "kubelet={{ kubernetes_version }}-00"
+ - cri-tools
+ - "kubelet={{ kubernetes_version }}-*"
state: present
allow_downgrade: yes