我只会描述它是如何在我这边配置的。我已经使用本教程安装cert-manger
在我的身上:Kubernetes
https://docs.cert-manager.io/en/latest/getting-started/install/kubernetes.html
我检查了它是否已安装并且它是:
我也ingress-resource
有下一个配置:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
certmanager.k8s.io/acme-http01-edit-in-place: "true"
certmanager.k8s.io/cluster-issuer: letsencrypt-issuer
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
name: boonotes-ingress-resource
namespace: default
spec:
rules:
- host: www.bnsfun.com
http:
paths:
- backend:
serviceName: booknotes-front-end-service
servicePort: 80
path: /?(.*)
- host: www.bnsfun.com
http:
paths:
- backend:
serviceName: booknotes-back-end-service
servicePort: 3000
path: /api/?(.*)
tls:
- hosts:
- www.bnsfun.com
secretName: letsencrypt-certs
status:
loadBalancer:
ingress:
- ip: some ip
另外,我已经配置了证书:
kubectl 描述证书 booknotes-certificate
Name: booknotes-certificate
Namespace: default
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"certmanager.k8s.io/v1alpha1","kind":"Certificate","metadata":{"annotations":{},"name":"booknotes-certificate","namespace":"...
API Version: certmanager.k8s.io/v1alpha1
Kind: Certificate
Metadata:
Creation Timestamp: 2019-11-17T04:51:57Z
Generation: 2
Resource Version: 7257970
Self Link: /apis/certmanager.k8s.io/v1alpha1/namespaces/default/certificates/booknotes-certificate
UID: fbe1d9c0-08f5-11ea-82b3-42010a80017a
Spec:
Acme:
Config:
Domains:
www.bnsfun.com
http01:
Ingress: boonotes-ingress-resource
Common Name: www.bnsfun.com
Dns Names:
www.bnsfun.com
Issuer Ref:
Kind: ClusterIssuer
Name: letsencrypt-issuer
Secret Name: letsencrypt-certs
Events: <none>
我还创建了一个secret
:
这是我的sevice & ingress
部分:
我已使用本教程对其进行配置: https ://medium.com/@betandr/kubernetes-ingress-with-tls-on-gke-744efd37e49e
cert-manager
和安装证书管理的官方文档。我错了什么?我如何检查为什么这不起作用?我已经尝试了很多东西,但都对我不起作用。我肯定做错了什么。但是什么?我知道我需要cert-manager
更新我的lets-encrypt
证书,还需要创建来存储它,然后我需要在和secret
中配置我的入口。请你帮我找出更多应该发生的事情以及完成它的主要步骤是什么?如果您需要更多信息,请告诉我tls
annotaions
这是我的发行人:
apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
name: letsencrypt-issuer
spec:
acme:
email: email
http01: {}
privateKeySecretRef:
name: letsencrypt
server: "https://acme-v02.api.letsencrypt.org/directory"