Commit d64d910d authored by Luis de la Cal's avatar Luis de la Cal
Browse files

- Major fixes in the implementation of the monitoring of KPIs in the Centralized Attack Detector.

- Added script to deploy a single component of scenario 3.
parent 35b9ecad
Loading
Loading
Loading
Loading
+25 −25
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ done
for COMPONENT in $TFS_COMPONENTS; do
    echo "Waiting for '$COMPONENT' component..."
    kubectl wait --namespace $TFS_K8S_NAMESPACE \
        --for='condition=available' --timeout=300s deployment/${COMPONENT}service
    --for='condition=available' --timeout=3s deployment/${COMPONENT}service
    printf "\n"
done

deploy_l3_component.sh

0 → 100755
+45 −0
Original line number Diff line number Diff line
component=$1

source "my_deploy.sh"

echo "Deploying $component..."

# check if component == "CAD"
if [ $component == "CAD" ]; then
    # find kubernetes pod that contains "centralizedattackdetectorservice"
    pod=$(kubectl --namespace $TFS_K8S_NAMESPACE get pods | grep l3-centralizedattackdetectorservice | awk '{print $1}')
    
    # delete pod
    kubectl --namespace $TFS_K8S_NAMESPACE delete pod $pod --force --grace-period=0
    
    # # wait for pod to be deleted
    # while [ $(kubectl --namespace $TFS_K8S_NAMESPACE get pods | grep l3-centralizedattackdetectorservice | wc -l) -gt 0 ]; do
    #     sleep 1
    # done
    
    # deploy l3_centralizedattackdetector component
    ./deploy_component.sh "l3_centralizedattackdetector"
fi

# check if component == "AM"
if [ $component == "AM" ]; then
    # find kubernetes pod that contains "l3-attackmitigatorservice"
    pod=$(kubectl --namespace $TFS_K8S_NAMESPACE get pods | grep l3-attackmitigatorservice | awk '{print $1}')
    
    # delete pod
    kubectl --namespace $TFS_K8S_NAMESPACE delete pod $pod --force --grace-period=0
    
    # # wait for pod to be deleted
    # while [ $(kubectl --namespace $TFS_K8S_NAMESPACE get pods | grep l3-attackmitigatorservice | wc -l) -gt 0 ]; do
    #     sleep 1
    # done
    
    # deploy l3_attackmitigator component
    ./deploy_component.sh "l3_attackmitigator"
fi

echo "Component $component deployed"

echo "Restarting DAD..."
sshpass -p "ubuntu" ssh -o StrictHostKeyChecking=no -n -f ubuntu@192.168.165.73 "sh -c 'nohup /home/ubuntu/TeraflowDockerDistributed/restart.sh > /dev/null 2>&1 &'"
echo "DAD restarted"
 No newline at end of file
+314 −184

File changed.

Preview size limit exceeded, changes collapsed.