Skip to content

Commit 6873c47

Browse files
ci: add minimal reproducer workflow for MicroK8s strict socket bug
Standalone GitHub Actions workflow that demonstrates the "socket: permission denied" bug affecting MicroK8s strict confinement on ubuntu-24.04 runners. Installs microk8s 1.31-strict/stable and checks pod logs for the socket error. Intended for use in an upstream bug report. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c806fdc commit 6873c47

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: "Reproducer: MicroK8s strict socket permission denied"
2+
3+
# Minimal reproducer for socket: permission denied in MicroK8s strict confinement
4+
# on GitHub Actions ubuntu-24.04 runners.
5+
#
6+
# Pods running inside MicroK8s (strict) cannot create sockets, causing all
7+
# pods that need network access (coredns, calico-kube-controllers, metallb,
8+
# etc.) to crash with "socket: permission denied".
9+
#
10+
# This started around early February 2026, likely due to a GitHub Actions
11+
# runner image update (kernel 6.14.0-1017-azure).
12+
13+
on:
14+
workflow_dispatch:
15+
push:
16+
branches:
17+
- debug/metallb-timeout
18+
19+
jobs:
20+
reproducer:
21+
name: MicroK8s strict socket reproducer
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- name: System info
25+
run: |
26+
echo "=== Runner environment ==="
27+
uname -a
28+
cat /etc/os-release
29+
free -h
30+
nproc
31+
echo "=== AppArmor status ==="
32+
sudo aa-status --verbose 2>&1 | head -30 || true
33+
echo "=== Seccomp ==="
34+
grep -i seccomp /boot/config-$(uname -r) 2>/dev/null || true
35+
36+
- name: Install MicroK8s (strict)
37+
run: |
38+
sudo snap install microk8s --channel=1.31-strict/stable
39+
sudo microk8s status --wait-ready --timeout 120
40+
41+
- name: Show initial pod status
42+
run: |
43+
echo "=== Pod status ==="
44+
sudo microk8s kubectl get pods -A -o wide
45+
echo ""
46+
echo "=== Node status ==="
47+
sudo microk8s kubectl get nodes -o wide
48+
49+
- name: Wait and check for socket errors
50+
run: |
51+
echo "Waiting 60s for pods to attempt networking..."
52+
sleep 60
53+
54+
echo "=== Pod status after 60s ==="
55+
sudo microk8s kubectl get pods -A -o wide
56+
echo ""
57+
58+
# Check coredns logs for socket error
59+
echo "=== CoreDNS logs ==="
60+
coredns_pod=$(sudo microk8s kubectl get pods -n kube-system -l k8s-app=kube-dns -o name 2>/dev/null | head -1)
61+
if [ -n "$coredns_pod" ]; then
62+
sudo microk8s kubectl logs -n kube-system "$coredns_pod" --all-containers 2>&1 || true
63+
sudo microk8s kubectl logs -n kube-system "$coredns_pod" --all-containers --previous 2>&1 || true
64+
fi
65+
echo ""
66+
67+
# Check calico-kube-controllers logs
68+
echo "=== Calico kube-controllers logs ==="
69+
calico_pod=$(sudo microk8s kubectl get pods -n kube-system -l k8s-app=calico-kube-controllers -o name 2>/dev/null | head -1)
70+
if [ -n "$calico_pod" ]; then
71+
sudo microk8s kubectl logs -n kube-system "$calico_pod" --all-containers 2>&1 || true
72+
sudo microk8s kubectl logs -n kube-system "$calico_pod" --all-containers --previous 2>&1 || true
73+
fi
74+
echo ""
75+
76+
# Check events
77+
echo "=== Cluster events ==="
78+
sudo microk8s kubectl get events -A --sort-by='.lastTimestamp' 2>&1 | tail -30
79+
80+
- name: Verify the bug
81+
run: |
82+
echo "Checking for 'socket: permission denied' in pod logs..."
83+
found=false
84+
85+
for pod in $(sudo microk8s kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{"\n"}{end}' 2>/dev/null); do
86+
ns="${pod%%/*}"
87+
name="${pod#*/}"
88+
logs=$(sudo microk8s kubectl logs -n "$ns" "$name" --all-containers --previous 2>/dev/null || true)
89+
if echo "$logs" | grep -q "socket: permission denied"; then
90+
echo "FOUND in $pod (previous):"
91+
echo "$logs" | grep "socket: permission denied" | head -3
92+
found=true
93+
fi
94+
logs=$(sudo microk8s kubectl logs -n "$ns" "$name" --all-containers 2>/dev/null || true)
95+
if echo "$logs" | grep -q "socket: permission denied"; then
96+
echo "FOUND in $pod (current):"
97+
echo "$logs" | grep "socket: permission denied" | head -3
98+
found=true
99+
fi
100+
done
101+
102+
if [ "$found" = true ]; then
103+
echo ""
104+
echo "=== BUG CONFIRMED ==="
105+
echo "Pods in MicroK8s strict confinement cannot create sockets."
106+
echo "This prevents coredns, calico, metallb, and any other pod"
107+
echo "that needs network access from functioning."
108+
exit 1
109+
else
110+
echo "Bug not reproduced - pods did not report socket: permission denied"
111+
fi

0 commit comments

Comments
 (0)