Skip to content
27 changes: 27 additions & 0 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,33 @@ jobs:
name: integration-test
deployment: false
steps:
- name: Purge Docker
# GitHub-hosted Azure runners ship Docker pre-installed and active.
# Canonical K8s requires "A system with no previous installations
# of containerd/docker as this may cause conflicts"
# (see https://documentation.ubuntu.com/canonical-kubernetes
# /release-1.32/snap/tutorial/getting-started/).
# Completely purging Docker requires also
# deleting the Docker-specific `iptables-nft` rulesets
# created on installation.
timeout-minutes: 5
run: |
sudo apt-get remove --purge -y docker-ce docker-ce-cli containerd.io docker.io containerd 2>/dev/null || true
sudo nft flush ruleset
sudo ip link delete docker0 2>/dev/null || true
- name: Remove podman CNI bridge config
# Ubuntu 24.04 runners ship podman with a CNI bridge config
# (/etc/cni/net.d/87-podman-bridge.conflist) that sorts
# lexicographically before Cilium's config (05-cilium.conflist).
# When that file is present, containerd picks the podman bridge
# as the active CNI before Cilium is ready, bypassing the
# node.kubernetes.io/network-unavailable taint and scheduling
# pods onto the 10.88.0.0/16 bridge instead of the Cilium pod
# CIDR. Removing the file ensures Cilium is the only CNI plugin
# from the start.
timeout-minutes: 1
run: |
sudo rm -f /etc/cni/net.d/87-podman-bridge.conflist
- name: Checkout
timeout-minutes: 3
uses: actions/checkout@v6
Expand Down
9 changes: 4 additions & 5 deletions concierge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ juju:
model-defaults:
logging-config: <root>=INFO; unit=DEBUG
providers:
microk8s:
k8s:
enable: true
bootstrap: true
Comment thread
taurus-forever marked this conversation as resolved.
addons:
- dns
- hostpath-storage
- rbac
channel: 1.32-classic/stable
bootstrap-constraints:
root-disk: 5G
host:
snaps:
jhack:
Expand Down
22 changes: 17 additions & 5 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ backends:
# For example, with microk8s, using `concierge restore` takes twice as long as this (e.g. 6
# min instead of 3 min between every spread job)
juju destroy-model --force --no-wait --destroy-storage --no-prompt testing
juju kill-controller --no-prompt concierge-microk8s
juju kill-controller --no-prompt concierge-k8s
restore: |
rm -rf "$SPREAD_PATH"

Expand All @@ -82,9 +82,6 @@ backends:
sudo passwd -d runner

ADDRESS localhost

sudo mkdir -p /var/snap/microk8s/common/default-storage
sudo mount --bind /mnt /var/snap/microk8s/common/default-storage
# HACK: spread does not pass environment variables set on runner
# Manually pass specific environment variables
environment:
Expand Down Expand Up @@ -136,4 +133,19 @@ prepare-each: |
# Unable to set constraint on all models because of Juju bug:
# https://bugs.launchpad.net/juju/+bug/2065050
juju set-model-constraints arch="$(dpkg --print-architecture)"
# Only restore on lxd backend—no need to restore on CI

# k8s status --wait-ready returns as soon as 1 node is ready
# (see https://github.com/canonical/k8s-snap/issues/1789)
# but Cilium, CoreDNS, and storage may still be initialising
for res in deployment/cilium-operator deployment/coredns deployment/metrics-server daemonset/cilium daemonset/ck-storage-rawfile-csi-node statefulset/ck-storage-rawfile-csi-controller; do
if k8s kubectl -n kube-system get "$res" >/dev/null 2>&1; then
k8s kubectl -n kube-system rollout status "$res" --timeout=5m
else
echo "Skipping rollout status for missing $res"
fi
done

# Validate k8s DNS / API access
sudo k8s kubectl get nodes
sudo k8s kubectl get svc -A
sudo k8s kubectl get pods -A
2 changes: 1 addition & 1 deletion tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
check_call(["kubectl", "version", "--client=true"])
KUBECTL = "kubectl"
except FileNotFoundError:
KUBECTL = "microk8s kubectl"
KUBECTL = "sudo k8s kubectl"

logger = logging.getLogger(__name__)

Expand Down
Loading