-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (58 loc) · 2.26 KB
/
microk8s-ppc64le.yaml
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
name: Setup MicroK8s with QEMU Emulating ppc64le
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
microk8s-setup:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up QEMU for ppc64le emulation
uses: docker/setup-qemu-action@v3
with:
platforms: linux/ppc64le
- name: Install Docker from official Docker repository
run: |
sudo apt-get update
sudo apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc
echo "deb [arch=ppc64el signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
- name: Enable QEMU emulation for ppc64le
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Install MicroK8s in emulated ppc64le environment
run: |
sudo apt-get update
sudo apt-get install -y snapd
sudo snap install microk8s --classic
- name: Enable MicroK8s Add-ons
run: |
sudo microk8s.enable dns storage
- name: Wait for MicroK8s to be ready
run: |
sudo microk8s status --wait-ready
- name: Verify ppc64le architecture in MicroK8s
run: |
MICROK8S_ARCH=$(sudo microk8s kubectl run --rm -i --tty busybox --image=busybox --restart=Never --command -- uname -m)
echo "MicroK8s architecture: $MICROK8S_ARCH"
if [ "$MICROK8S_ARCH" != "ppc64le" ]; then
echo "Emulation failed or wrong architecture. Expected ppc64le but got $MICROK8S_ARCH"
exit 1
fi
- name: Test MicroK8s Cluster
run: |
sudo microk8s kubectl get nodes
sudo microk8s kubectl run test-pod --image=nginx --restart=Never --dry-run=client -o yaml
sudo microk8s kubectl get pods