Skip to content

Commit

Permalink
update security workshop
Browse files Browse the repository at this point in the history
- modify istio-setup-telemetry.sh to show the port forward configuration
- insert no script to delete NLB IP
  • Loading branch information
thomassuedbroecker committed Mar 2, 2021
1 parent 8b4a8a5 commit c7216a3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
36 changes: 36 additions & 0 deletions security/IKS/iks-rm-nlb-ips.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

export ISTIOINGRESSIP=$(kubectl get svc -n istio-system | grep istio-ingressgateway | awk '{print $3}')
export STATUS=""

function deleteNLBIPs(){
array=("001" "002" "003")
for i in "${array[@]}"
do
echo ""
echo "------------------------------------------------------------------------"
echo "Check $i"
while :
do
FIND=$i
HOSTNAME=$(ibmcloud ks nlb-dns ls --cluster $MYCLUSTER | grep $FIND | awk '{print $1}')
echo "hostname: $HOSTNAME"
if [ "$STATUS" = "$HOSTNAME" ]; then
echo "$(date +'%F %H:%M:%S') Status: $FIND is not avaiable"
echo "------------------------------------------------------------------------"
break
else
ibmcloud ks nlb-dns rm classic --cluster $MYCLUSTER --ip $ISTIOINGRESSIP --nlb-host $HOSTNAME
echo "$(date +'%F %H:%M:%S') Status: $FIND($HOSTNAME) deleted"
echo "------------------------------------------------------------------------"
break
fi
sleep 5
done
done
}

ibmcloud ks nlb-dns ls --cluster $MYCLUSTER
deleteNLBIPs


3 changes: 2 additions & 1 deletion security/IKS/istio-setup-telemetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ function showCommands () {
echo "kubectl port-forward svc/prometheus 3000:9090 -n istio-system"
echo "-----------------------Jaeger------------------------------------------------"
echo "kubectl port-forward svc/jaeger-query 3000:16686 -n istio-system"

echo "-----------------------Kiali------------------------------------------------"
echo "kubectl port-forward svc/kiali 3000:20001 -n istio-system"
}

setuptelemetry
Expand Down

0 comments on commit c7216a3

Please sign in to comment.