Several fixes in this commit:
* Added 'namespace' argument, default to 'eshop'.
* Every Helm command (`helm install` and `helm ls` used with `helm delete`) will honor the namespace parameter. This way this script is no longer destructive with the Kubernetes cluster. Usage() has been updated accordingly.
* Custom registry image push didn't honor `--docker-username` and `--docker-password`. A `docker login` has been added to fix the situation.
* AKS DNS discovery was not working properly due to case sensitivity with the JMESPath to the HTTPApplicationRouteZoneName. A small two-entries array with iterative loop has been added ton ensure either way the AKS http routing DNS retrieval is successful.
* Helm charts were enabled to use Kubernetes Ingress, but the `Ingress.spec.rules.host[]` was not honored with the `$dns` variable. This has been fixed in the `helm install` commands and now the script deploys the Ingress as expected.
dns="$(az aks show -n $aks_name -g $aks_rg --query $q -o tsv)"
if[[ -n $dns]];then break;fi
done
if[[ -z $dns]];then
echo"Error: when getting DNS of AKS $aks_name (in resource group $aks_rg). Please ensure AKS has httpRouting enabled AND Azure CLI is logged in and is of version 2.0.37 or higher."
exit1
fi
$dns=${dns//[\"]/""}
echo"DNS base found is $dns. Will use $aks_name.$dns for the app!"
fi
@ -186,8 +196,12 @@ fi
if[[$clean]];then
echo"Cleaning previous helm releases..."
helm delete --purge $(helm ls -q)
echo"Previous releases deleted"
if[[ -z $(helm ls -q --namespace $namespace)]];then
echo"No previous releases found"
else
helm delete --purge $(helm ls -q --namespace $namespace)
echo"Previous releases deleted"
fi
fi
echo"#################### Begin $app_name installation using Helm ####################"
@ -198,7 +212,7 @@ if [[ !$skip_infrastructure ]]; then