I have a integration Kubernetes cluster in AWS, and I want to conduct end-to-end tests on that cluster.
I currently use Deployments and Services.
The proposed approach is to use Ingress and configure it to use cookie injection for ensuring access to web page that implements the following logic:
When special header is recognized in request -> allow the agent to enter the webpage (used for automated tests)
When special header is not recognized in request -> display popup for basic http authentication (used for normal users).
I also want to use a single entry point for both cases (the same url).
I've been browsing official documentation, but didn't find the specified use case, nor did I find any examples that might be close to what I want to achieve.
I'm interested if anyone has used similar approach or something that might be similar in use.
Many thanks!
It sounds like either configuration-snippet or a full-blown custom template may do what you want, along with the nginx if
and add_header
using something like:
if ($http_user_agent ~ "My Sekrit Agent/666") {
add_header Authentication "Basic dXNlcm5hbWU6cGFzc3dvcmQ=";
}