-
Notifications
You must be signed in to change notification settings - Fork 69
95 lines (90 loc) · 3.08 KB
/
reusable-multi-node.yaml
File metadata and controls
95 lines (90 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Multi Node
on:
workflow_call:
# allow reuse of this workflow in other files here
inputs:
lima_template:
description: lima template
type: string
default: "template://ubuntu-24.04"
lima_version:
description: lima version
type: string
# Pinned to v1.2, as a workaround for a regression of `limactl copy` in Lima v2.0
# https://github.com/lima-vm/lima/issues/4468
default: "v1.2.2"
container_engine:
description: container engine
type: string
default: "docker"
kubelet_port:
description: kubelet serving port
type: string
default: "10250"
flannel_port:
description: flannel vxlan port
type: string
default: "8472"
etcd_port:
description: etcd service port
type: string
default: "2379"
kube_apiserver_port:
description: Kubernetes API server port
# Using string, might be bug with number
# https://github.com/orgs/community/discussions/67182
type: string
default: "6443"
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions
permissions: read-all
jobs:
multi-node:
name: "Multi node (emulated using Lima)"
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
LIMA_TEMPLATE: "${{ inputs.lima_template }}"
CONTAINER_ENGINE: "${{ inputs.container_engine }}"
PORT_KUBE_APISERVER: "${{ inputs.kube_apiserver_port }}"
PORT_FLANNEL: "${{ inputs.flannel_port }}"
PORT_KUBELET: "${{ inputs.kubelet_port }}"
PORT_ETCD: "${{ inputs.etcd_port }}"
KUBECONFIG: ./kubeconfig
steps:
- uses: actions/checkout@v6
- uses: lima-vm/lima-actions/setup@v1
id: lima-actions-setup
with:
version: "${{ inputs.lima_version }}"
- name: "Cache ~/.cache/lima"
uses: actions/cache@v5
with:
path: ~/.cache/lima
key: lima-${{ steps.lima-actions-setup.outputs.version }}
- run: ./hack/create-cluster-lima.sh
- run: kubectl taint nodes --all node-role.kubernetes.io/control-plane- || true
- run: ./hack/test-smoke.sh
- if: failure()
name: "kubectl get nodes"
run: |
set -x
kubectl get nodes -o wide
kubectl get nodes -o yaml
limactl shell host0 df -h
limactl shell host1 df -h
- if: failure()
name: "kubectl get pods"
run: |
set -x
kubectl get pods -A -o yaml
limactl shell host0 journalctl --user --no-pager --since "10 min ago"
- name: "Test data persistency after restarting the node"
run: |
limactl stop host0
limactl stop host1
limactl start host0
limactl start host1
# The plain mode of Lima disables automatic port forwarding
ssh -q -f -N -L ${{ inputs.kube_apiserver_port }}:127.0.0.1:${{ inputs.kube_apiserver_port }} -F ~/.lima/host0/ssh.config lima-host0
sleep 30
./hack/test-smoke.sh