-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Github action CI integration test (#2)
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.
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
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 |