This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 228
115 lines (113 loc) · 4.33 KB
/
test-site-to-site.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Test-Site-to-Site
on:
push:
pull_request:
jobs:
test-oidc:
name: Test NiFi Helm Chart Secure Site-to-Site
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Minikube
uses: manusa/actions-setup-minikube@v2.7.2
with:
minikube version: 'v1.28.0'
kubernetes version: 'v1.25.4'
github token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get install -y jq
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add dysnix https://dysnix.github.io/charts/
helm repo update
helm dep up
- name: Install cert-manager
run: tests/05-install-cert-manager.bash
- name: Install ALPHA and BRAVO instances of NiFi
run: tests/06-site-to-site.bash
- name: Check deployment status
run: |
kubectl -n alpha rollout status --watch statefulset/nifi --timeout=5m
kubectl -n bravo rollout status --watch statefulset/nifi --timeout=5m
- name: Wait for BRAVO NiFi web server to start
run: |
for n in [ 0 1 2 3 4 5 6 7 8 9 ]
do
if kubectl -n bravo logs pod/nifi-0 -c app-log | grep 'JettyServer NiFi has started'
then
exit 0
fi
sleep 30
done
echo NiFi did not start for 300 seconds!
echo ===ALPHA SERVER LOGS===
kubectl -n alpha logs pod/nifi-0 -c server
echo ===ALPHA APP LOGS===
kubectl -n alpha logs pod/nifi-0 -c app-log
echo ===ALPHA USER LOGS===
kubectl -n alpha logs pod/nifi-0 -c user-log
echo ===BRAVO SERVER LOGS===
kubectl -n bravo logs pod/nifi-0 -c server
echo ===BRAVO APP LOGS===
kubectl -n bravo logs pod/nifi-0 -c app-log
echo ===BRAVO USER LOGS===
kubectl -n bravo logs pod/nifi-0 -c user-log
exit 1
- name: Wait for items on BravoInput
run: |
for n in [ 0 1 2 3 4 5 6 7 8 9 ]
do
ITEMS=$(kubectl -n bravo exec nifi-0 -c server -- curl -s http://localhost:9092/metrics/ | grep 'name="BravoInput"' | grep ^nifi_amount_items_output | cut -f2 -d' ')
echo Got $ITEMS items so far
if [ $ITEMS != "0.0" ]
then
exit 0
fi
sleep 30
done
echo Got no items for 300 seconds!
echo ===ALPHA SERVER LOGS===
kubectl -n alpha logs pod/nifi-0 -c server
echo ===ALPHA APP LOGS===
kubectl -n alpha logs pod/nifi-0 -c app-log
echo ===ALPHA USER LOGS===
kubectl -n alpha logs pod/nifi-0 -c user-log
echo ===BRAVO SERVER LOGS===
kubectl -n bravo logs pod/nifi-0 -c server
echo ===BRAVO APP LOGS===
kubectl -n bravo logs pod/nifi-0 -c app-log
echo ===BRAVO USER LOGS===
kubectl -n bravo logs pod/nifi-0 -c user-log
exit 1
- name: Confirm certificate rotation
run: |
OLDCERTSTART=$(kubectl -n alpha exec nifi-0 -c server -- curl -kv https://localhost:8443 2>&1 | /bin/grep start)
echo Certificate "$OLDCERTSTART"
cmctl -n alpha renew nifi-0
for n in [ 0 1 2 3 4 5 6 7 8 9 ]
do
NEWCERTSTART=$(kubectl -n alpha exec nifi-0 -c server -- curl -kv https://localhost:8443 2>&1 | /bin/grep start)
echo Certificate "$NEWCERTSTART"
if [ \""$OLDCERTSTART"\" != \""$NEWCERTSTART"\" ]
then
exit 0
fi
sleep 30
done
echo Certificate did not update for 300 seconds!
echo ===ALPHA SERVER LOGS===
kubectl -n alpha logs pod/nifi-0 -c server
echo ===ALPHA APP LOGS===
kubectl -n alpha logs pod/nifi-0 -c app-log
echo ===ALPHA USER LOGS===
kubectl -n alpha logs pod/nifi-0 -c user-log
echo ===BRAVO SERVER LOGS===
kubectl -n bravo logs pod/nifi-0 -c server
echo ===BRAVO APP LOGS===
kubectl -n bravo logs pod/nifi-0 -c app-log
echo ===BRAVO USER LOGS===
kubectl -n bravo logs pod/nifi-0 -c user-log
exit 1