gpt4 book ai didi

ssl - 需要带有 SSL 教程的 Kubernetes 1.2 Ingress 裸机 Controller

转载 作者:太空宇宙 更新时间:2023-11-03 12:51:15 24 4
gpt4 key购买 nike

在获取 SSL 终止 Ingress 和在裸机(例如 Digital Ocean)上运行的基于 nginx 的 Controller 方面,我能找到的最接近的教程是:

https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx

但它留下了太多无法解释的假设。

我的入口要求很简单:

  • 所有主机的默认后端端口 80:
    • location ^~/.well-known/acme-challenge/ 的文件访问权允许我的 LetsEncrypt 证书续订工作
    • 404 在 location/.well-known/acme-challenge/
    • 301 在 location/
  • 基于子域的路由到端口 443 上的不同后端服务
  • 每个子域都指向不同的 SSL key /证书(由我的 LetsEncrypt 生成,我想是作为 secret 存储在 K8S 中??)

我认为需要的是:

  • 关于编写 Ingress 规则的完整文档
    • 我可以为每个后端单独配置 SSL 证书(在端口 443 上)吗?
    • /是主机的总称“路径”吗?
  • 更新 Ingress 规则
  • 我使用什么 nginx Controller ?恩金克斯? nginx-alpha? nginx-ingress docker 容器——每个 Controller 的文档在哪里?
    • 是否有一个基本 Controller 图像,我可以覆盖由来自 API 服务器的 Ingress 更改填充的 nginx.conf 模板?
  • 如何将 SSL key 和证书作为 secret 存储?

最佳答案

嘘,我的答案适用于 https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx

  • default backend at port 80 for all hosts that:
    • 404 on location /.well-known/acme-challenge/

使用 Ingress 规则这是不可能的

  • 301 on location /

这已经得到支持。如果服务器包含 SSL 证书,它将自动重定向到 https

  • subdomain based routing to different backend services on port 443
  • each subdomain points to a different SSL key/cert (generated by my LetsEncrypt, and stored in K8S as a secret I suppose??)

您需要创建多个 Ingress 规则,每个子域一个。每个规则可以使用不同的 secret 名称(这将创建多个服务器,每个子域一个)

我认为需要的是:

  • full documentation on writing Ingress rules

http://kubernetes.io/docs/user-guide/ingress/

(不知道id除了go代码还有其他信息)

  • can I configure SSL certs (on port 443) for each backend individually?
  • is / the "path" that's a catchall for a host?

是的

  • updating Ingress rules in place
  • what nginx controller do I use? nginx? nginx-alpha? nginx-ingress docker container -- and where is the documentation for each of these controllers?

这取决于您的需要,如果您想构建自定义 Ingress Controller ,您可以使用 nginx-alpha 作为引用。如果 nginx-ingress 在示例中不清楚,请打开一个问题并提及示例中可以改进的地方或缺少的地方

  • is there a base controller image that I can override the nginx.conf template that gets populated by Ingress changes from the API server?

没有。这样做的原因是模板与填充模板的 go 代码相关联。也就是说,您可以构建一个更改模板的自定义图像,但这需要您部署图像以测试更改

  • how do you store SSL keys and certs as secrets?

是的,像这样的 secret http://kubernetes.io/docs/user-guide/ingress/#tls

对于 letsencrypt 支持,请查看此评论 https://github.com/kubernetes/kubernetes/issues/19899#issuecomment-184059009

这是一个完整的例子https://gist.github.com/aledbf/d88c7f7d0b8d4d032035b14ab0965e26 added to examples in #766

关于ssl - 需要带有 SSL 教程的 Kubernetes 1.2 Ingress 裸机 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36583216/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com