Skip to content

Commit 65a875a

Browse files
committed
Change guest home directory to '/home/runner.guest'
1 parent fa347b6 commit 65a875a

5 files changed

Lines changed: 40 additions & 36 deletions

File tree

.github/workflows/main.yaml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
name: Main
33
on: [push, pull_request]
44
jobs:
5-
single-node:
6-
name: "Single node"
7-
strategy:
8-
fail-fast: false
9-
matrix:
10-
container_engine: [docker, nerdctl, podman]
11-
uses: ./.github/workflows/reusable-single-node.yaml
12-
with:
13-
container_engine: ${{ matrix.container_engine }}
5+
# We would never use usernetes on a single node
6+
#single-node:
7+
# name: "Single node"
8+
# strategy:
9+
# fail-fast: false
10+
# matrix:
11+
# container_engine: [docker, nerdctl, podman]
12+
# uses: ./.github/workflows/reusable-single-node.yaml
13+
# with:
14+
# container_engine: ${{ matrix.container_engine }}
1415

1516
multi-node:
1617
name: "Multi node"
@@ -30,19 +31,3 @@ jobs:
3031
with:
3132
lima_template: ${{ matrix.lima_template }}
3233
container_engine: ${{ matrix.container_engine }}
33-
34-
# TODO: this test should create multiple instances of Usernetes on each of the hosts
35-
multi-node-custom-ports:
36-
name: "Multi node with custom service ports"
37-
uses: ./.github/workflows/reusable-multi-node.yaml
38-
with:
39-
lima_template: "template://ubuntu-24.04"
40-
container_engine: "docker"
41-
# Defaults to 6443
42-
kube_apiserver_port: "8080"
43-
# Defaults to 8472
44-
flannel_port: "9072"
45-
# Defaults to 10250
46-
kubelet_port: "20250"
47-
# Defaults to 2379
48-
etcd_port: "9090"

.github/workflows/reusable-single-node.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,3 @@ jobs:
8383
- run: make kubeconfig
8484
- run: kubectl taint nodes --all node-role.kubernetes.io/control-plane-
8585
- run: ./hack/test-smoke.sh
86-
- name: "Test data persistency after restarting the node"
87-
run: |
88-
make down
89-
make up
90-
sleep 30
91-
./hack/test-smoke.sh

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export PORT_KUBELET ?= 10250
77
export PORT_FLANNEL ?= 8472
88
export PORT_KUBE_APISERVER ?= 6443
99

10+
HERE := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
11+
1012
# HOSTNAME is the name of the physical host
1113
export HOSTNAME ?= $(shell hostname)
1214
# HOST_IP is the IP address of the physical host. Accessible from other hosts.
@@ -82,7 +84,7 @@ render: check-preflight
8284
.PHONY: up
8385
up: check-preflight
8486
# Podman creates cni files in a shared location, this ensures unique names that do not clobbed one another
85-
sed -i "s/default_network/$(HOSTNAME)/g" docker-compose.yaml
87+
sed -i "s/default_network/$(HOSTNAME)/g" $(HERE)/docker-compose.yaml
8688
$(COMPOSE) up --build -d
8789

8890
.PHONY: down
@@ -145,7 +147,7 @@ sync-external-ip:
145147
.PHONY: kubeadm-join
146148
kubeadm-join:
147149
# Our kernel is too old for usernetes, so we need this
148-
sed -i "s/--token/--ignore-preflight-errors=all --token/g" join-command
150+
sed -i "s/--token/--ignore-preflight-errors=all --token/g" $(HERE)/join-command
149151
$(NODE_SHELL) /bin/bash /usernetes/join-command
150152
@echo "# Run 'make sync-external-ip' on the control plane"
151153

hack/create-cluster-lima.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set -eux -o pipefail
1111
: "${PORT_FLANNEL:=8472}"
1212
: "${PORT_KUBELET:=10250}"
1313

14-
guest_home="/home/${USER}.linux"
14+
guest_home="/home/runner.guest"
1515

1616
if [ "$(id -u)" -le 1000 ]; then
1717
# In --plain mode, UID has to be >= 1000 to populate subuids
@@ -49,7 +49,8 @@ done
4949
${LIMACTL} shell host0 ${SERVICE_PORTS} CONTAINER_ENGINE="${CONTAINER_ENGINE}" make -C "${guest_home}/usernetes" kubeadm-init install-flannel kubeconfig join-command
5050

5151
# Let host1 join the cluster
52-
${LIMACTL} copy host0:~/usernetes/join-command host1:~/usernetes/join-command
52+
${LIMACTL} copy host0:${guest_home}/usernetes/join-command ./join-command
53+
${LIMACTL} copy ./join-command host1:${guest_home}/usernetes/join-command
5354
${LIMACTL} shell host1 ${SERVICE_PORTS} CONTAINER_ENGINE="${CONTAINER_ENGINE}" make -C "${guest_home}/usernetes" kubeadm-join
5455
${LIMACTL} shell host0 ${SERVICE_PORTS} CONTAINER_ENGINE="${CONTAINER_ENGINE}" make -C "${guest_home}/usernetes" sync-external-ip
5556

hack/test-smoke.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,38 @@ EOF
5656

5757
INFO "GET PODS"
5858
kubectl get pods
59+
kubectl get pods -n kube-system
5960
INFO "DESCRIBE PODS"
6061
kubectl describe pods
6162
for name in $(kubectl get pods -o json | jq -r .items[].metadata.name)
6263
do
6364
kubectl logs $name
65+
kubectl exec -it $name -- cat /etc/resolv.conf
6466
done
6567

68+
INFO "Patching CoreDNS to use 8.8.8.8"
69+
kubectl get configmap coredns -n kube-system -o yaml | \
70+
sed 's/forward . \/etc\/resolv.conf/forward . 8.8.8.8/' | \
71+
kubectl apply -f -
72+
73+
INFO "Restarting CoreDNS"
74+
kubectl delete pod -n kube-system -l k8s-app=kube-dns
75+
kubectl rollout status deployment coredns -n kube-system
76+
6677
INFO "Connecting to dnstest-{0,1,2}.dnstest.default.svc.cluster.local"
67-
kubectl run -i --rm --image=alpine --restart=Never dnstest-shell -- sh -exc 'for f in $(seq 0 2); do wget -O- http://dnstest-${f}.dnstest.default.svc.cluster.local; done'
78+
kubectl run -i --rm --image=busybox:1.28 --restart=Never dnstest-shell -- sh -exc '
79+
echo "--- Resolv.conf ---"
80+
cat /etc/resolv.conf
81+
82+
echo "--- Testing External DNS (google.com) ---"
83+
nslookup google.com || echo "External DNS Failed"
84+
85+
echo "--- Testing Internal DNS (dnstest-0) ---"
86+
nslookup dnstest-0.dnstest || echo "Internal DNS Failed"
6887
88+
for f in 0 1 2; do
89+
wget -qO- http://dnstest-${f}.dnstest.default.svc.cluster.local
90+
done'
6991
INFO "Deleting Service \"dnstest\""
7092
kubectl delete service dnstest
7193
INFO "Deleting StatefulSet \"dnstest\""

0 commit comments

Comments
 (0)