Skip to content

Commit ea736d2

Browse files
committed
Add container WF for minikube
1 parent a6340ea commit ea736d2

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

.github/workflows/minikube-k8s-test.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ permissions:
1414
contents: read
1515
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1616
jobs:
17-
test-minikube:
18-
name: Test with minikube
17+
test-minikube-build:
18+
name: Test with minikube (build)
1919
runs-on: ubuntu-latest
2020
# Steps represent a sequence of tasks that will be executed as part of the job
2121
steps:
@@ -39,3 +39,28 @@ jobs:
3939
curl http://localhost:3000/balancer/
4040
echo "logs from pod to make sure:"
4141
cat pod.log
42+
test-minikube-containers:
43+
name: Test with minikube (containers)
44+
runs-on: ubuntu-latest
45+
# Steps represent a sequence of tasks that will be executed as part of the job
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Start minikube
49+
uses: medyagh/setup-minikube@master
50+
with:
51+
minikube-version: 1.31.2
52+
driver: docker
53+
kubernetes-version: v1.28.1
54+
- name: test script
55+
run: |
56+
eval $(minikube docker-env)
57+
./build-and-deploy-container.sh
58+
while [[ $(kubectl get pods -l app=wrongsecrets-balancer -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != *"True"* ]]; do echo "waiting for wrongsecrets-balancer" && sleep 2; done
59+
kubectl logs deployments/wrongsecrets-balancer -f >> pod.log &
60+
echo "port forwarding"
61+
kubectl port-forward service/wrongsecrets-balancer 3000:3000 &
62+
echo "Awaiting the first forward to be ready"
63+
sleep 10
64+
curl http://localhost:3000/balancer/
65+
echo "logs from pod to make sure:"
66+
cat pod.log

0 commit comments

Comments
 (0)