Skip to content

Commit

Permalink
WIP: more k8s updates
Browse files Browse the repository at this point in the history
Signed-off-by: Mikko Ylinen <[email protected]>
  • Loading branch information
mythi committed Sep 4, 2024
1 parent 71c4dfc commit 23babd1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 32 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/ansible/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ kubeadm_pkgs:
centos:
- conntrack
- socat
k8s_version: v1.24.0
k8s_version: v1.30.1
test_pkgs:
ubuntu:
- jq
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/ansible/install_containerd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- name: Re-create containerd config
shell: |
mkdir -p /etc/containerd/
containerd config default > /etc/containerd/config.toml
containerd config default | sed -e 's/\(SystemdCgroup =\).*/\1 true/g' | tee /etc/containerd/config.toml
args:
executable: /bin/bash
- name: Restart containerd service
Expand Down
30 changes: 18 additions & 12 deletions tests/e2e/ansible/install_kubeadm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
become: yes
vars:
cni_home: "/opt/cni"
cni_version: "v1.1.1"
cni_version: "v1.5.1"
flannel_home: "/opt/flannel"
flannel_version: "v0.19.1"
flannel_version: "v0.25.6"
kubeadm_cri_runtime_socket: "/run/containerd/containerd.sock"
kubeadm_conf_dir: "/etc/kubeadm"
kubelet_bin: "/usr/local/bin/kubelet"
kubelet_service_dir: "/etc/systemd/system/kubelet.service.d"
kubelet_service_file: "/etc/systemd/system/kubelet.service"
# Use 'cgroupfs' with containerd, 'systemd' with crio?
kubelet_cgroup_driver: "cgroupfs"
kubelet_cgroup_driver: "systemd"
tasks:
- name: Install kubeadm required packages
package:
Expand Down Expand Up @@ -53,17 +52,24 @@
creates: /usr/local/bin/crictl
dest: /usr/local/bin
remote_src: yes
- name: Install kube binaries
- name: Download kube binaries
get_url:
url: https://storage.googleapis.com/kubernetes-release/release/{{ k8s_version }}/bin/linux/{{ target_arch }}/{{ item }}
dest: /usr/local/bin
mode: '+x'
url: https://dl.k8s.io/{{ k8s_version }}/kubernetes-node-linux-{{ target_arch }}.tar.gz
dest: /tmp/kubernetes-node-linux.tar.gz
retries: 3
delay: 10
with_items:
- kubeadm
- kubelet
- kubectl
- name: Install kube binaries
unarchive:
src: /tmp/kubernetes-node-linux.tar.gz
dest: /usr/local/bin
remote_src: yes
extra_opts:
- --strip-components
- 3
#include:
# - kubeadm
# - kubectl
# - kubelet
- name: Remove zram-generator-defaults in Fedora
ansible.builtin.yum:
name: zram-generator-defaults
Expand Down
18 changes: 1 addition & 17 deletions tests/e2e/ansible/templates/kubeadm.conf.j2
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
# Copied and modified from https://github.com/kata-containers/tests/blob/main/integration/kubernetes/kubeadm/config.yaml
#
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
nodeRegistration:
criSocket: unix://{{ kubeadm_cri_runtime_socket }}
imagePullPolicy: IfNotPresent
kubeletExtraArgs:
allowed-unsafe-sysctls: kernel.msg*,kernel.shm.*,net.*
v: "4"
---
apiVersion: kubeadm.k8s.io/v1beta3
kind: ClusterConfiguration
kubernetesVersion: {{ k8s_version }}
networking:
dnsDomain: cluster.local
podSubnet: 10.244.0.0/16
serviceSubnet: 10.96.0.0/12
apiServer:
extraArgs:
feature-gates: PodOverhead=true
timeoutForControlPlane: 4m0s
imageRepository: k8s.gcr.io
scheduler:
extraArgs:
feature-gates: PodOverhead=true
imageRepository: registry.k8s.io
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
cgroupDriver: {{ kubelet_cgroup_driver }}
featureGates:
PodOverhead: true
systemReserved:
cpu: 500m
memory: 256Mi
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/cluster/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ main() {
# Untaint the node so that pods can be scheduled on it.
for role in master control-plane; do
kubectl taint nodes "$SAFE_HOST_NAME" \
"node-role.kubernetes.io/$role:NoSchedule-"
"node-role.kubernetes.io/$role:NoSchedule-" || true
done

kubectl label node "$SAFE_HOST_NAME" node.kubernetes.io/worker=
Expand Down

0 comments on commit 23babd1

Please sign in to comment.