让我们在kubernetes中使用Certbot进行加密失败(但与cert manager配合使用)

让我们在kubernetes中使用Certbot进行加密失败(但与cert manager配合使用),kubernetes,lets-encrypt,certbot,cert-manager,Kubernetes,Lets Encrypt,Certbot,Cert Manager,我在Azure中安装了Kubernetes群集版本1.15.5,其中安装了版本v0.14.0 它可以根据有效的DNS名称自动发出lets加密证书:MY_DOMAIN,指向入口控制器的外部IP地址 我还希望能够使用,例如,来做同样的事情。我已尝试在我的群集上运行certbot,方法是: kubectl run --generator=run-pod/v1 certbot-shell --rm -i --tty --image certbot/certbot:amd64-latest -- -d M

我在Azure中安装了Kubernetes群集版本1.15.5,其中安装了版本v0.14.0

它可以根据有效的DNS名称自动发出lets加密证书:MY_DOMAIN,指向入口控制器的外部IP地址

我还希望能够使用,例如,来做同样的事情。我已尝试在我的群集上运行certbot,方法是:

kubectl run --generator=run-pod/v1 certbot-shell --rm -i --tty --image certbot/certbot:amd64-latest -- -d MY_DOMAIN --manual --preferred-challenges http certonly
但它在以下方面失败了:

Create a file containing just this data:

QAPu****-klNq1RBgY

And make it available on your web server at this URL:

http://MY_DOMAIN/.well-known/acme-challenge/QAPu****-klNq1RBgY

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Press Enter to Continue
Waiting for verification...
Challenge failed for domain MY_DOMAIN
http-01 challenge for MY_DOMAIN
Cleaning up challenges
Some challenges have failed.

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: MY_DOMAIN
   Type:   unauthorized
   Detail: Invalid response from
   http://MY_DOMAIN/.well-known/acme-challenge/QAPuDTHa****1qlLLOg
   [13.x.x.x]: 404

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
因此,证书管理器会在质询期间自动创建文件,并在以下位置提供:

http://MY_DOMAIN/.well-known/acme-challenge/QAPu****-klNq1RBgY
但我不确定在使用certbot时如何做到这一点,或者是否有其他方法可以做到这一点

基于以下建议,我尝试安装Kube lego(0.1.2)(用于旧版1.8群集),但似乎失败了:

level=error msg="Error while processing certificate requests: 403 urn:acme:error:unauthorized: Account creation on ACMEv1 is disabled. Please upgrade your ACME client to a version that supports ACMEv2 / RFC 8555. See https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1/88430 for details." context=kubelego 
因此,我尝试升级到:

但我得到:

level=error msg="Error while processing certificate requests: Head : unsupported protocol scheme \"\"" context=kubelego
我发现:


看来kube lego无法与ACME版本2配合使用:-(

简短版本的评论:DNS模式下的certbot可能会工作,HTTP01不会,因为您需要动态调整入口设置,这正是cert manager所做的。总的来说,这是一个很好的例子,说明为什么运行2.5年前的Kube版本并不好。

为什么您要使用certbot?更不用说如果您是一个lCert manager已经开始工作,这是正确的工具。我可能需要解决问题(让我们加密)无法安装cert manager的旧Kubernetes群集上的证书-升级群集目前不是一个选项。为什么不能使用cert manager?certbot不是为Kubernetes构建的,如果您坚持使用它,您将希望在DNS模式下使用它。正如您所指出的,cert manager自动化的HTTP映射更难实现Anualy:)我没有找到可以安装在旧群集(1.8.x版)上的证书管理器版本试试kube lego,它是cert manager替换的东西。只是为了确保我理解。使用certbot进行DNS质询需要我实际拥有将初步certbot颁发的令牌添加到DNS服务器的DNS TXT字段的权限,然后我才能确认certbot应继续颁发证书,对吗?不,是的要求您通过插件授予Certbot自动访问DNS提供商的权限。很抱歉,我不清楚我的意思是运行Certbot的用户需要能够(拥有权限)要在DNS中为给定主机名添加/更新记录吗?是的,我想你可以这样说。但是用户不运行certbot,它会像自己一样连续运行。具体细节因提供商而异,但通常你会给它某种API密钥。