简体   繁体   中英

API Gateway Auth with K8s Ingress + Python

Since my previous Q about microservices cluster authentication, I got the following, more specific question. How can one implement API Gateway pattern in Kubernetes cluster to perform authentication with Python? So that any custom auth method can be used, and other microservices won't worry about this problem.

My requirement/wish list:

  1. Use Python code to authenticate a request, to handle logging in&out.
  2. Use K8s Ingress URL list or, at least, similar simple YAML interface, so that routing isn't embedded in a service code and can be rapidly updated.
  3. The solution should have not the worst performance.

Any kind of help is highly appreciated 🙌

As we mentioned in the comments.


NginX can deal with LDAP:

There is an article that explains the process and an official repo with an example explaining Python+LDAP+NginX for external authentication for k8s ingress.

Also there is a good unofficial example of this technique.


The NginX module ngx_http_auth_request_module support even simpler protocol, and here isdocs and an unofficial example .


Additional software can be used to solve the problem:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM