Skip to content

Commit 6aec54a

Browse files
authored
feat: add kubernetes v1.31.2 (#2578)
Signed-off-by: joyceliu <[email protected]>
1 parent 80c9a73 commit 6aec54a

File tree

12 files changed

+117
-39
lines changed

12 files changed

+117
-39
lines changed

builtin/capkk/roles/install/cri/defaults/main.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ cri:
66
# the endpoint of containerd
77
cri_socket: |
88
{{- if .cri.container_manager | eq "containerd" }}
9-
unix:///var/run/containerd.sock
9+
unix:///var/run/containerd/containerd.sock
10+
{{- else if and (.cri.container_manager | eq "docker") (.kube_version | semverCompare ">=v1.24.0") }}
11+
unix:///var/run/cri-dockerd.sock
12+
{{- else if and (.cri.container_manager | eq "docker") (.kube_version | semverCompare "<v1.24.0") }}
13+
unix:///var/run/docker.sock
1014
{{- end }}
1115
containerd:
1216
data_root: /var/lib/containerd

builtin/capkk/roles/install/cri/tasks/install_containerd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{ .tmp_dir }}/containerd-{{ .containerd_version | default "" | trimPrefix "v" }}-linux-{{ .binary_type.stdout }}.tar.gz
2727
- name: Unpackage containerd binary
2828
command: |
29-
tar -xvf {{ .tmp_dir }}/containerd-{{ .containerd_version | default "" | trimPrefix "v" }}-linux-{{ .binary_type.stdout }}.tar.gz -C /usr/local/bin/
29+
tar -xvf {{ .tmp_dir }}/containerd-{{ .containerd_version | default "" | trimPrefix "v" }}-linux-{{ .binary_type.stdout }}.tar.gz --strip-components=1 -C /usr/local/bin/
3030
- name: Generate containerd config file
3131
template:
3232
src: containerd.config

builtin/capkk/roles/install/cri/tasks/install_cridockerd.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@
1010
- name: Sync cri-dockerd Binary to remote
1111
copy:
1212
src: |
13-
{{ .binary_dir }}/cri-dockerd/{{ .cridockerd_version }}/{{ .binary_type.stdout }}/cri-dockerd-{{ .cridockerd_version }}-linux-{{ .binary_type.stdout }}.tar.gz
13+
{{ .binary_dir }}/cri-dockerd/{{ .cridockerd_version }}/{{ .binary_type.stdout }}/cri-dockerd-{{ .cridockerd_version | default "" | trimPrefix "v" }}.{{ .binary_type.stdout }}.tgz
1414
dest: |
15-
{{ .tmp_dir }}/cri-dockerd-{{ .cridockerd_version }}-linux-{{ .binary_type.stdout }}.tar.gz
16-
- name: Generate cri-dockerd config file
17-
template:
18-
src: cri-dockerd.config
19-
dest: /etc/cri-dockerd.yaml
15+
{{ .tmp_dir }}/cri-dockerd-{{ .cridockerd_version | default "" | trimPrefix "v" }}.{{ .binary_type.stdout }}.tgz
2016
- name: Unpackage cri-dockerd binary
2117
command: |
22-
tar -xvf {{ .tmp_dir }}/cri-dockerd-{{ .cridockerd_version }}-linux-{{ .binary_type.stdout }}.tar.gz -C /usr/local/bin/
18+
tar -xvf {{ .tmp_dir }}/cri-dockerd-{{ .cridockerd_version | default "" | trimPrefix "v" }}.{{ .binary_type.stdout }}.tgz --strip-components=1 -C /usr/local/bin/
2319
- name: Generate cri-dockerd Service file
2420
template:
2521
src: cri-dockerd.service

builtin/capkk/roles/install/cri/templates/containerd.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version = 2
22

3-
root = {{ .cri.containerd.data_root | default "/var/lib/containerd" }}
3+
root = "{{ .cri.containerd.data_root | default "/var/lib/containerd" }}"
44
state = "/run/containerd"
55

66
[grpc]
@@ -40,7 +40,7 @@ state = "/run/containerd"
4040
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
4141
runtime_type = "io.containerd.runc.v2"
4242
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
43-
SystemdCgroup = {{ if .cri.cgroup_driver | eq "systemd") }}true{{ else }}false{{ end }}
43+
SystemdCgroup = {{ if .cri.cgroup_driver | eq "systemd" }}true{{ else }}false{{ end }}
4444
[plugins."io.containerd.grpc.v1.cri".cni]
4545
bin_dir = "/opt/cni/bin"
4646
conf_dir = "/etc/cni/net.d"

builtin/core/defaults/config/v1.23.15.yaml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,49 @@ spec:
1010
kube_version: v1.23.15
1111
# helm binary
1212
helm_version: v3.14.2
13-
# cni_plugins binary
14-
# cni_plugins_version: v1.2.0
15-
# calicoctl binary
16-
calico_version: v3.28.2
1713
# etcd binary
1814
etcd_version: v3.5.6
15+
# ========== image registry ==========
16+
# keepalived image tag. Used for load balancing when there are multiple image registry nodes.
17+
# keepalived_version: stable
18+
# ========== image registry: harbor ==========
1919
# harbor image tag
2020
# harbor_version: v2.10.1
2121
# docker-compose binary
2222
# dockercompose_version: v2.24.6
23+
# ========== image registry: registry ==========
2324
# registry image tag
2425
# registry_version: 2.8.3
25-
# keepalived image tag
26-
# keepalived_version: stable
26+
# ========== cri ==========
2727
# crictl binary
2828
crictl_version: v1.23.0
29+
# ========== cri: docker ==========
2930
# docker binary
3031
docker_version: 24.0.6
32+
# cridockerd. Required when kube_version is greater than 1.24
33+
# cridockerd_version: v0.3.10
34+
# ========== cri: containerd ==========
35+
# containerd binary
36+
# containerd_version: v1.7.0
37+
# runc binary
38+
# runc_version: v1.1.11
39+
# ========== cni ==========
40+
# cni_plugins binary
41+
# cni_plugins_version: v1.2.0
42+
# ========== cni: calico ==========
43+
# calicoctl binary
44+
calico_version: v3.28.2
45+
# ========== cni: cilium ==========
3146
# cilium helm
32-
# cilium_version: 1.15.4
47+
# cilium_version: 1.15.4
48+
# ========== cni: kubeovn ==========
3349
# kubeovn helm
34-
# kubeovn_version: 0.1.0
50+
# kubeovn_version: 0.1.0
51+
# ========== cni: hybridnet ==========
3552
# hybridnet helm
36-
# hybridnet_version: 0.6.8
37-
# containerd binary
38-
# containerd_version: v1.7.0
39-
# runc binary
40-
# runc_version: v1.1.11
41-
# cridockerd
42-
# cridockerd_version: v0.3.10
53+
# hybridnet_version: 0.6.8
54+
# ========== storageclass ==========
55+
# ========== storageclass: nfs ==========
4356
# nfs provisioner helm version
4457
# nfs_provisioner_version: 4.0.18
4558
kubernetes:
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
apiVersion: kubekey.kubesphere.io/v1
2+
kind: Config
3+
spec:
4+
# zone for kk. how to download files
5+
# kkzone: cn
6+
# work_dir is the directory where the artifact is extracted.
7+
# work_dir: /var/lib/kubekey/
8+
# the version of kubernetes to be installed.
9+
# should be greater than or equal to kube_version_min_required.
10+
kube_version: v1.31.2
11+
# helm binary
12+
helm_version: v3.16.4
13+
# etcd binary
14+
etcd_version: v3.5.16
15+
# ========== image registry ==========
16+
# keepalived image tag. Used for load balancing when there are multiple image registry nodes.
17+
# keepalived_version: stable
18+
# ========== image registry: harbor ==========
19+
# harbor image tag
20+
# harbor_version: v2.10.1
21+
# docker-compose binary
22+
# dockercompose_version: v2.24.6
23+
# ========== image registry: registry ==========
24+
# registry image tag
25+
# registry_version: 2.8.3
26+
# ========== cri ==========
27+
# crictl binary
28+
crictl_version: v1.31.1
29+
# ========== cri: docker ==========
30+
# docker binary
31+
# docker_version: 27.3.1
32+
# cridockerd. Required when kube_version is greater than 1.24
33+
# cridockerd_version: v0.3.15
34+
# ========== cri: containerd ==========
35+
# containerd binary
36+
containerd_version: v1.7.24
37+
# runc binary
38+
runc_version: v1.2.3
39+
# ========== cni ==========
40+
# cni_plugins binary
41+
# cni_plugins_version: v1.5.1
42+
# ========== cni: calico ==========
43+
# calicoctl binary
44+
calico_version: v3.29.2
45+
# ========== cni: cilium ==========
46+
# cilium helm
47+
# cilium_version: 1.16.0
48+
# ========== cni: kubeovn ==========
49+
# kubeovn helm
50+
# kubeovn_version: 0.1.0
51+
# ========== cni: hybridnet ==========
52+
# hybridnet helm
53+
# hybridnet_version: 0.6.8
54+
# ========== storageclass ==========
55+
# ========== storageclass: nfs ==========
56+
# nfs provisioner helm version
57+
# nfs_provisioner_version: 4.0.18
58+
kubernetes:
59+
controller_manager:
60+
extra_args:
61+
cluster-signing-duration: 87600h
62+
cri:
63+
sandbox_image_tag: 3.10
64+
# support: containerd,docker
65+
container_manager: containerd

builtin/core/roles/install/cri/defaults/main.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ cri:
88
# the endpoint of containerd
99
cri_socket: |
1010
{{- if .cri.container_manager | eq "containerd" }}
11-
unix:///var/run/containerd.sock
11+
unix:///var/run/containerd/containerd.sock
12+
{{- else if and (.cri.container_manager | eq "docker") (.kube_version | semverCompare ">=v1.24.0") }}
13+
unix:///var/run/cri-dockerd.sock
14+
{{- else if and (.cri.container_manager | eq "docker") (.kube_version | semverCompare "<v1.24.0") }}
15+
unix:///var/run/docker.sock
1216
{{- end }}
1317
containerd:
1418
data_root: /var/lib/containerd

builtin/core/roles/install/cri/tasks/install_containerd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{ .tmp_dir }}/containerd-{{ .containerd_version | default "" | trimPrefix "v" }}-linux-{{ .binary_type.stdout }}.tar.gz
2727
- name: Unpackage containerd binary
2828
command: |
29-
tar -xvf {{ .tmp_dir }}/containerd-{{ .containerd_version | default "" | trimPrefix "v" }}-linux-{{ .binary_type.stdout }}.tar.gz -C /usr/local/bin/
29+
tar -xvf {{ .tmp_dir }}/containerd-{{ .containerd_version | default "" | trimPrefix "v" }}-linux-{{ .binary_type.stdout }}.tar.gz --strip-components=1 -C /usr/local/bin/
3030
- name: Generate containerd config file
3131
template:
3232
src: containerd.config

builtin/core/roles/install/cri/tasks/install_cridockerd.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@
1010
- name: Sync cri-dockerd Binary to remote
1111
copy:
1212
src: |
13-
{{ .binary_dir }}/cri-dockerd/{{ .cridockerd_version }}/{{ .binary_type.stdout }}/cri-dockerd-{{ .cridockerd_version | default "" | trimPrefix "v" }}-{{ .binary_type.stdout }}.tgz
13+
{{ .binary_dir }}/cri-dockerd/{{ .cridockerd_version }}/{{ .binary_type.stdout }}/cri-dockerd-{{ .cridockerd_version | default "" | trimPrefix "v" }}.{{ .binary_type.stdout }}.tgz
1414
dest: |
15-
{{ .tmp_dir }}/cri-dockerd-{{ .cridockerd_version | default "" | trimPrefix "v" }}-{{ .binary_type.stdout }}.tgz
16-
- name: Generate cri-dockerd config file
17-
template:
18-
src: cri-dockerd.config
19-
dest: /etc/cri-dockerd.yaml
15+
{{ .tmp_dir }}/cri-dockerd-{{ .cridockerd_version | default "" | trimPrefix "v" }}.{{ .binary_type.stdout }}.tgz
2016
- name: Unpackage cri-dockerd binary
2117
command: |
22-
tar -xvf {{ .tmp_dir }}/cri-dockerd-{{ .cridockerd_version | default "" | trimPrefix "v" }}-{{ .binary_type.stdout }}.tgz -C /usr/local/bin/
18+
tar -xvf {{ .tmp_dir }}/cri-dockerd-{{ .cridockerd_version | default "" | trimPrefix "v" }}.{{ .binary_type.stdout }}.tgz --strip-components=1 -C /usr/local/bin/
2319
- name: Generate cri-dockerd Service file
2420
template:
2521
src: cri-dockerd.service

0 commit comments

Comments
 (0)