我的 TLS 有问题。我创建了我的 TLS secret :
kubectl create secret tls ingress-tls --key certificate.key --cert certificate.crt
我在 ingress 中使用它:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: "beta"
spec:
tls:
- hosts:
- '*.host.com'
- 'beta.host.com'
secretName: ingress-tls
backend:
serviceName: nginx
servicePort: 443
入口完美创建,我通过浏览器访问没问题,当我执行 curl 或使用程序 postman 时出现问题,我收到证书错误。
curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
我正在使用 GCE 驱动程序,它是来自谷歌云的默认 GKE。
我一直在阅读如何添加 ca key ,但此错误并未修复。
我做了以下事情:
kubectl create secret generic ca --from-file certificate.ca.crt
并且我在 ingress 中添加了以下注释:
ingress.kubernetes.io/auth-tls-secret: ca
但是不工作。
有谁知道如何修复 CA 证书?该证书是在 DonDominio 网站上购买的,它是一个 Wildcard。
最佳答案
问题基本上是我在生成 TLS key 时使用的是 .crt 而不是 .pem。通过更改密码,我得到 curl 以将其检测为有效证书。
新命令:
kubectl create secret tls ingress-tls --key certificate.key --cert certificate.pem
感谢@Michael-sqlbot!
关于ssl - Kubernetes Ingress SSL 证书问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56717348/