-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Frank Kloeker <[email protected]>
- Loading branch information
Showing
1 changed file
with
79 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,79 @@ | ||
# This workflow installs 1 instance of sparrow and | ||
# verify the API output | ||
|
||
name: End2End Testing | ||
on: | ||
push: | ||
paths: | ||
- 'chart/**' | ||
|
||
jobs: | ||
end2end: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Set up K3S | ||
uses: debianmaster/actions-k3s@master | ||
id: k3s | ||
with: | ||
version: 'v1.26.9-k3s1' | ||
- name: Check Cluster | ||
run: | | ||
kubectl get nodes | ||
- name: Check Coredns Deployment | ||
run: | | ||
kubectl -n kube-system rollout status deployment/coredns --timeout=60s | ||
STATUS=$(kubectl -n kube-system get deployment coredns -o jsonpath={.status.readyReplicas}) | ||
if [[ $STATUS -ne 1 ]] | ||
then | ||
echo "Deployment coredns not ready" | ||
kubectl -n kube-system get events | ||
exit 1 | ||
else | ||
echo "Deployment coredns OK" | ||
fi | ||
- name: Check Metricsserver Deployment | ||
run: | | ||
kubectl -n kube-system rollout status deployment/metrics-server --timeout=60s | ||
STATUS=$(kubectl -n kube-system get deployment metrics-server -o jsonpath={.status.readyReplicas}) | ||
if [[ $STATUS -ne 1 ]] | ||
then | ||
echo "Deployment metrics-server not ready" | ||
kubectl -n kube-system get events | ||
exit 1 | ||
else | ||
echo "Deployment metrics-server OK" | ||
fi | ||
- name: Setup Helm | ||
run: | | ||
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | ||
helm version | ||
- name: Install Sparrow | ||
run: | | ||
helm upgrade -i sparrow \ | ||
--atomic \ | ||
--timeout 300s \ | ||
--set sparrow.loaderType=file \ | ||
chart | ||
- name: Check Pods | ||
run: | | ||
kubectl get pods | ||
- name: Wait for Sparrow | ||
run: | | ||
sleep 60 | ||
- name: Check Sparrow | ||
run: | | ||
kubectl create job curl --image=mtr.devops.telekom.de/mcsps/curl:7.65.3 -- curl -f -v -H 'Content-Type: application/json' http://sparrow:8080/v1/metrics/health | ||
kubectl wait --for=condition=complete job/curl | ||
STATUS=$(kubectl get job curl -o jsonpath={.status.succeeded}) | ||
if [[ $STATUS -ne 1 ]] | ||
then | ||
echo "Job failed" | ||
kubectl logs -ljob-name=curl | ||
kubectl delete job curl | ||
exit 1 | ||
else | ||
echo "Job OK" | ||
kubectl delete job curl | ||
fi |