Skip to content

Commit

Permalink
add podman ci
Browse files Browse the repository at this point in the history
add basic ci to test that kind can create clusters with podman
as provider.
  • Loading branch information
Antonio Ojea committed Aug 18, 2020
1 parent 1ebcd6f commit e339686
Showing 1 changed file with 137 additions and 0 deletions.
137 changes: 137 additions & 0 deletions .github/workflows/podman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Podman

on:
workflow_dispatch:
pull_request:
branches:
- master

jobs:

podman:
name: Podman
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
ipFamily: [ipv4, ipv6]
exclude:
# exclude IPv6
- ipFamily: ipv6
env:
JOB_NAME: "podman-${{ matrix.ipFamily }}"
KIND_EXPERIMENTAL_PROVIDER: "podman"
IP_FAMILY: ${{ matrix.ipFamily }}
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Verify
run: make verify

- name: Install kind
run: sudo make install INSTALL_DIR=/usr/local/bin

- name: Install podman
run: |
. /etc/os-release
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
sudo apt-get update -qq
sudo apt-get -qq -y install podman
# Install network
sudo mkdir -p /etc/cni/net.d
curl -qsSL https://raw.githubusercontent.com/containers/libpod/master/cni/87-podman-bridge.conflist | sudo tee /etc/cni/net.d/87-podman-bridge.conf
curl -qsSL https://github.com/containernetworking/plugins/releases/download/v0.8.6/cni-plugins-linux-amd64-v0.8.6.tgz --output /tmp/cni.tgz
sudo mkdir -p /usr/libexec/cni
sudo tar -C /usr/libexec/cni -xvzf /tmp/cni.tgz
- name: Create cluster
run: |
cat <<EOF | sudo KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster -v7 --wait 1m --retain --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
ipFamily: ${IP_FAMILY}
EOF
# TODO: implement this
- name: Load docker image
run: sudo KIND_EXPERIMENTAL_PROVIDER=podman kind load docker-image busybox:2
continue-on-error: true

- name: Export logs
run: sudo KIND_EXPERIMENTAL_PROVIDER=podman kind export logs

- name: Delete cluster
run: sudo KIND_EXPERIMENTAL_PROVIDER=podman kind delete cluster

podman-multinode:
name: Podman-Multinode
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
ipFamily: [ipv4, ipv6]
exclude:
# exclude IPv6
- ipFamily: ipv6
env:
JOB_NAME: "podman-multinode-${{ matrix.ipFamily }}"
KIND_EXPERIMENTAL_PROVIDER: "podman"
IP_FAMILY: ${{ matrix.ipFamily }}
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Verify
run: make verify

- name: Install kind
run: sudo make install INSTALL_DIR=/usr/local/bin

- name: Install podman
run: |
. /etc/os-release
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
sudo apt-get update -qq
sudo apt-get -qq -y install podman
# Install network
sudo mkdir -p /etc/cni/net.d
curl -qsSL https://raw.githubusercontent.com/containers/libpod/master/cni/87-podman-bridge.conflist | sudo tee /etc/cni/net.d/87-podman-bridge.conf
curl -qsSL https://github.com/containernetworking/plugins/releases/download/v0.8.6/cni-plugins-linux-amd64-v0.8.6.tgz --output /tmp/cni.tgz
sudo mkdir -p /usr/libexec/cni
sudo tar -C /usr/libexec/cni -xvzf /tmp/cni.tgz
- name: Create cluster
run: |
cat <<EOF | sudo KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster -v7 --wait 1m --retain --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
ipFamily: ${IP_FAMILY}
nodes:
- role: control-plane
- role: control-plane
- role: control-plane
- role: worker
- role: worker
EOF
# TODO: implement this
- name: Load docker image
run: sudo KIND_EXPERIMENTAL_PROVIDER=podman kind load docker-image busybox:2
continue-on-error: true

- name: Export logs
run: sudo KIND_EXPERIMENTAL_PROVIDER=podman kind export logs

- name: Delete cluster
run: sudo KIND_EXPERIMENTAL_PROVIDER=podman kind delete cluster

0 comments on commit e339686

Please sign in to comment.