<p>I'm reading through <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/access-authn-authz/authentication/</a>, but it is not giving any concrete commands and it is mostly focusing when we want to create everything from scratch. It's also explaining auth for engineers using Kubernetes.</p>
<p>I have an existing deployment and service (with exposed external IP) and would like to create the simplest possible authentication (preferably token based) for an external user accessing the exposed IP. I can't add authentication to the services since I don't have access to their code. If somebody could help me with some commands I would be grateful.</p>

user2085124
<p>The documentation which referred is for authentication with k8s (for api accesses). This is not for application layer authentication.</p>
<p>However I can suggest one way to implement application layer authentication without changing the service at all. You can redirect the traffic to nginx (or any other reverse proxy) which can perform the authentication and redirect the authenticated user to service directly. It can also perform some kind of authorization too.</p>
<p>There are various resources available which can help you choose various authentication mechanism available in nginx such as password file based mechanism (<a href="https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/" rel="nofollow noreferrer">link</a>) or JWT based authentication (<a href="https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-jwt-authentication/" rel="nofollow noreferrer">link</a>)</p>
