-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b0b03a
commit 1bdc594
Showing
2 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: Compatibility | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
images: | ||
name: Node Images | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Verify | ||
run: make verify | ||
|
||
- name: Install kind from current repository | ||
run: | | ||
sudo make install INSTALL_DIR=/usr/local/bin | ||
/usr/local/bin/kind version | ||
- name: Checkout Kubernetes | ||
uses: actions/checkout@v2 | ||
with: | ||
path: src/k8s.io/kubernetes | ||
repository: kubernetes/kubernetes | ||
ref: v1.20.0 | ||
|
||
- name: Install kubectl | ||
run: | | ||
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl | ||
chmod +x ./kubectl | ||
sudo mv ./kubectl /usr/local/bin/kubectl | ||
- name: Build kind base image from current repository | ||
run: | | ||
cd images/base | ||
docker build -t base:test . | ||
cd - | ||
- name: Build kind node image from current repository | ||
run: | | ||
KUBE_PATH="${{ github.workspace }}/src/k8s.io/kubernetes" | ||
/usr/local/bin/kind build node-image --kube-root ${KUBE_PATH} --base-image base:test --image node:test -v7 | ||
- name: Create cluster from current repository | ||
run: | | ||
/usr/local/bin/kind create cluster --name kind-pr --wait 1m --image node:test -v7 --retain | ||
- name: Create cluster with last stable version | ||
run: | | ||
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64 | ||
chmod +x ./kind | ||
cat <<EOF | ./kind create cluster -v7 --wait 1m --image node:test --retain --config=- | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
kubeadmConfigPatches: | ||
- | | ||
kind: InitConfiguration | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
"v": "4" | ||
EOF | ||
- name: Get Cluster status | ||
run: | | ||
# wait network is ready | ||
kubectl wait --for=condition=ready pods --namespace=kube-system -l k8s-app=kube-dns | ||
kubectl get nodes -o wide | ||
kubectl get pods -A | ||
- name: Load docker image | ||
run: | | ||
docker pull busybox | ||
./kind load docker-image busybox | ||
- name: Export logs | ||
if: ${{ always() }} | ||
run: | | ||
mkdir -p /tmp/kind/logs/kind | ||
mkdir -p /tmp/kind/logs/kind-pr | ||
sudo /usr/local/bin/kind export logs --name=kind-pr /tmp/kind/logs/kind-pr | ||
sudo ./kind export logs /tmp/kind/logs/kind | ||
sudo chown -R $USER:$USER /tmp/kind/logs | ||
- name: Upload logs | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: kind-logs-${{ github.run_id }} | ||
path: /tmp/kind/logs | ||
|
||
- name: Delete cluster | ||
run: kind delete cluster |