We have environment with Azure Kubernetes + Jenkins + GitLab. With existing setup once after merge request on GitLab, build is triggered in Jenkins and pods are deployed on Azure K8s (AKS). Now we have the requirement to have dynamic namespace for all pull request and uris to be tested for each branch. Later once it's merged we have to delete those dynamic namespace. Could you kindly guide me with setup or approach to get this achieved.
kubectl is your way to go. You just need to create a namespace and/or deployment with a unique hash (which you can extract from git commit hash for the PR):
kubectl create namespace NAMESPACE_NAME_COMMIT_HASH
I'm pretty sure you can cover all your requirements with a single testing namespace just by generating deployments+service+ingress with a unique commit hash in their names and deleting them in the end of pipeline. There will be no collision in the testing namespace unless your pods do not initiate some sort of intra-namespace communication between them, e.g. clustering etc.