Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR - Fixes for k0s cicd #404

Merged
merged 12 commits into from
Oct 3, 2023
10 changes: 2 additions & 8 deletions .github/workflows/eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,12 @@ jobs:
run:
shell: bash
working-directory: ./cicd/eks

if: github.repository == 'loxilb-io/loxilb'
&& github.event.inputs.tagName == ''
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3

# Run this only on main repo
- name: Check Repo owner
if: github.repository != 'loxilb-io/loxilb'
run: |
gh run cancel ${{ github.run_id }}
gh run watch ${{ github.run_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
58 changes: 33 additions & 25 deletions .github/workflows/k0s-weave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,54 @@ on:
required: true
default: 'k0s-weave'
jobs:
build:
test-runner:
name: k0s-weave-sanity
runs-on: ubuntu-20.04
runs-on: self-hosted
if: github.repository == 'loxilb-io/loxilb'
&& github.event.inputs.tagName == ''
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-go@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '>=1.18.0'
- run: |
- name: Setup Local Env1
run: |
echo "KUBECONFIG=/var/lib/k0s/pki/admin.conf" >> $GITHUB_ENV
- run: sudo ip addr add 192.169.20.59/32 dev lo
- run: sudo apt-get -y install lksctp-tools
- run: sudo swapoff -a
- run: |
sudo mkdir -p /opt/cni/bin/
git clone https://github.com/containernetworking/plugins.git
cd plugins
./build_linux.sh
sudo cp -f bin/* /opt/cni/bin/
cd -
- run: sudo curl -sSLf https://get.k0s.sh | sudo sh
- run: sudo k0s install controller --enable-worker -c cicd/k0s-weave/k0s.yaml
- run: sudo k0s start
- run: |
- name: Setup lo
run: sudo ip addr add 192.169.20.59/32 dev lo || true
- name: Setup Packages
run: sudo apt-get -y install lksctp-tools || true
- name: Install k0s
run: sudo curl -sSLf https://get.k0s.sh | sudo sh
- name: Enable k0s worker
run: sudo k0s install controller --enable-worker -c cicd/k0s-weave/k0s.yaml
- name: Start k0s
run: sudo k0s start
- name: Setup Weave
run: |
sleep 120
sudo k0s kubectl apply -f https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s.yaml
- run: |
- name: Print running pods
run: |
sleep 60
sudo k0s kubectl get pods -A
- run: |
sleep 10
sudo k0s kubectl taint nodes --all node-role.kubernetes.io/master:NoSchedule-
sleep 60
sudo k0s kubectl get nodes
sudo k0s kubectl get pods -A
- run: |
- name: Run the test
run: |
cd cicd/k0s-weave/
./config.sh
./validation.sh
./rmconfig.sh
cd -
- name: Cleanup
if: success() || failure()
run: |
cd cicd/k0s-weave/ || true
./rmconfig.sh
cd -
sudo ip addr del 192.169.20.59/32 dev lo || true
4 changes: 3 additions & 1 deletion cicd/k0s-weave/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function wait_k0s_cluster_ready_full {
i=$(( $i + 1 ))
if [[ $i -ge 40 ]]; then
echo "Cluster is not ready.Giving up"
sudo k0s kubectl get svc
sudo k0s kubectl get pods -A
exit 1
fi
echo "Cluster is not ready...."
Expand Down Expand Up @@ -221,7 +223,7 @@ sleep 15
sudo k0s kubectl apply -f udp-svc-lb2.yml
sleep 15
sudo k0s kubectl apply -f sctp-svc-lb2.yml
sleep 30
sleep 30

# External LB service must be created by now
sudo k0s kubectl get svc
Expand Down
2 changes: 1 addition & 1 deletion loxilb-ebpf
Loading