Skip to content

Commit f5fcbbe

Browse files
committed
Adding a label and a minikube test for wrnogsecrets-balancer (closes #26)
1 parent ff0a6e1 commit f5fcbbe

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Test minikube script (k8s)
4+
5+
# Controls when the workflow will run
6+
on:
7+
pull_request:
8+
branches: [ master ]
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
test-minikube:
16+
name: Test with minikube
17+
runs-on: ubuntu-latest
18+
# Steps represent a sequence of tasks that will be executed as part of the job
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Start minikube
22+
uses: medyagh/setup-minikube@master
23+
with:
24+
minikube-version: 1.27.0
25+
driver: docker
26+
kubernetes-version: v1.23.12
27+
- name: test script
28+
run: |
29+
eval $(minikube docker-env)
30+
./build-an-deploy.sh
31+
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
32+
kubectl logs deployments/wrongsecrets-balancer -f >> pod.log &
33+
echo "port forwarding"
34+
kubectl port-forward service/wrongsecrets-balancer 3000:3000 &
35+
echo "Awaiting the first forward to be ready"
36+
sleep 10
37+
curl http://localhost:3000
38+
echo "logs from pod to make sure:"
39+
cat pod.log

helm/wrongsecrets-ctf-party/templates/wrongsecrets-balancer/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ kind: Deployment
33
metadata:
44
name: wrongsecrets-balancer
55
labels:
6+
app: wrongsecrets-balancer
67
{{- include "wrongsecrets-ctf-party.labels" . | nindent 4 }}
78
spec:
89
replicas: {{ .Values.balancer.replicas }}
@@ -15,6 +16,7 @@ spec:
1516
checksum/config: {{ include (print $.Template.BasePath "/wrongsecrets-balancer/config-map.yaml") . | sha256sum }}
1617
checksum/secret: {{ include (print $.Template.BasePath "/wrongsecrets-balancer/secret.yaml") . | sha256sum }}
1718
labels:
19+
app: wrongsecrets-balancer
1820
{{- include "wrongsecrets-ctf-party.selectorLabels" . | nindent 8 }}
1921
spec:
2022
securityContext:

0 commit comments

Comments
 (0)