Skip to content

Commit

Permalink
Add Github action CI integration test (#2)
Browse files Browse the repository at this point in the history
Signed-off-by: JenTing Hsiao <[email protected]>
  • Loading branch information
JenTing Hsiao authored Dec 4, 2020
1 parent 7e1d085 commit 87c714b
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
pull_request:
push:
branches:
- main

jobs:
integration-test:
runs-on: ubuntu-latest
steps:
- name: Set up Go ^1.15
uses: actions/setup-go@v2
with:
go-version: ^1.15

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

- name: Set up KIND cluster
uses: engineerd/[email protected]

- name: Install kustomize
run: |
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
sudo mv kustomize /usr/local/bin/kustomize
- name: Install
run: |
git clone -b v0.4.1 https://github.com/kubernetes-sigs/metrics-server.git
mkdir -p metrics-server/manifests/secure-metrics-server
cp secure-metrics-server.sh metrics-server/manifests/secure-metrics-server
cd metrics-server/manifests/secure-metrics-server
NODE_NAME=`kind get nodes`
CONTAINER_ID=`docker ps --filter "name=$NODE_NAME" -q`
docker cp $CONTAINER_ID:/etc/kubernetes/pki/ca.crt kubernetes-ca.crt
./secure-metrics-server.sh
cd ../
kustomize build secure-metrics-server | kubectl apply -f -
kubectl wait --for=condition=available deploy/metrics-server -n kube-system
- name: Test
run: |
kubectl wait --for=condition=available apiservice/v1beta1.metrics.k8s.io
kubectl get --raw /apis/metrics.k8s.io/v1beta1/nodes
kubectl get --raw /apis/metrics.k8s.io/v1beta1/pods
kubectl top nodes
kubectl top pods -n kube-system

0 comments on commit 87c714b

Please sign in to comment.