Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Support Enable/Disable NiFi Zookeeper client Zookeeper Ensemble Tracker #99

Support Enable/Disable NiFi Zookeeper client Zookeeper Ensemble Tracker

Support Enable/Disable NiFi Zookeeper client Zookeeper Ensemble Tracker #99

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 Old Certificate "$OLDCERTSTART"
cmctl -n alpha renew nifi-0
# Remove below block of code when issue NIFI-11536 is fixed
# i.e. in version 1.23 https://issues.apache.org/jira/browse/NIFI-11536
#########################################################################
kubectl -n alpha rollout restart statefulset/nifi
kubectl -n alpha rollout status --watch statefulset/nifi --timeout=5m
sleep 5m
#########################################################################
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 New 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