# args: <log-dir> <file-prexix>
__PA_store_docker_logs() {
if [ $RUNMODE == "KUBE" ]; then
# args: <log-dir> <file-prexix>
__PA_store_docker_logs() {
if [ $RUNMODE == "KUBE" ]; then
##Create a unique path for the pv each time to prevent a previous volume to be reused
export POLICY_AGENT_PV_PATH="padata-"$(date +%s)
export POLICY_AGENT_CONTAINER_MNT_DIR
##Create a unique path for the pv each time to prevent a previous volume to be reused
export POLICY_AGENT_PV_PATH="padata-"$(date +%s)
export POLICY_AGENT_CONTAINER_MNT_DIR
if [ $1 == "PROXY" ]; then
export AGENT_HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_CONFIG_PORT #Set if proxy is started
if [ $1 == "PROXY" ]; then
export AGENT_HTTP_PROXY_CONFIG_PORT=$HTTP_PROXY_CONFIG_PORT #Set if proxy is started
# Keep the initial worker node in case the pod need to be "restarted" - must be made to the same node due to a volume mounted on the host
if [ $retcode_i -eq 0 ]; then
# Keep the initial worker node in case the pod need to be "restarted" - must be made to the same node due to a volume mounted on the host
if [ $retcode_i -eq 0 ]; then
if [ -z "$__PA_WORKER_NODE" ]; then
echo -e $YELLOW" Cannot find worker node for pod for $POLICY_AGENT_APP_NAME, persistency may not work"$EYELLOW
fi
if [ -z "$__PA_WORKER_NODE" ]; then
echo -e $YELLOW" Cannot find worker node for pod for $POLICY_AGENT_APP_NAME, persistency may not work"$EYELLOW
fi
fi
__kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest PA
echo " Deleting the replica set - a new will be started when the app is started"
fi
__kube_scale_all_resources $KUBE_NONRTRIC_NAMESPACE autotest PA
echo " Deleting the replica set - a new will be started when the app is started"
else
echo -e $BOLD" Setting nodeSelector kubernetes.io/hostname=$__PA_WORKER_NODE to deployment for $POLICY_AGENT_APP_NAME. Pod will always run on this worker node: $__PA_WORKER_NODE"$BOLD
echo -e $BOLD" The mounted volume is mounted as hostPath and only available on that worker node."$BOLD
else
echo -e $BOLD" Setting nodeSelector kubernetes.io/hostname=$__PA_WORKER_NODE to deployment for $POLICY_AGENT_APP_NAME. Pod will always run on this worker node: $__PA_WORKER_NODE"$BOLD
echo -e $BOLD" The mounted volume is mounted as hostPath and only available on that worker node."$BOLD