Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform GKE Ingress未使用证书管理器ssl机密_Google Cloud Platform_Google Kubernetes Engine_Kubernetes Secrets_Cert Manager - Fatal编程技术网

Google cloud platform GKE Ingress未使用证书管理器ssl机密

Google cloud platform GKE Ingress未使用证书管理器ssl机密,google-cloud-platform,google-kubernetes-engine,kubernetes-secrets,cert-manager,Google Cloud Platform,Google Kubernetes Engine,Kubernetes Secrets,Cert Manager,我正在尝试让letsencrypt与GKE LB合作,我知道有GCP管理的证书,但它不会与内部LB合作,因为挑战不会通过。使用cert manager的Letsencrypt DNS认证已经存在并准备就绪 ❯ k get secrets letsencrypt-prod -o yaml apiVersion: v1 data: tls.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb3dJQkFBS0NBUUVBdlVZTVhXdG

我正在尝试让letsencrypt与GKE LB合作,我知道有GCP管理的证书,但它不会与内部LB合作,因为挑战不会通过。使用cert manager的Letsencrypt DNS认证已经存在并准备就绪

❯ k get secrets letsencrypt-prod -o yaml
apiVersion: v1
data:
  tls.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb3dJQkFBS0NBUUVBdlVZTVhXdGNZZUJpMkdadzljRFRLNzY==
kind: Secret
metadata:
  creationTimestamp: "2021-01-24T15:03:39Z"
  name: letsencrypt-prod
  namespace: elastic-system
  resourceVersion: "3636289"
  selfLink: /api/v1/namespaces/elastic-system/secrets/letsencrypt-prod
  uid: f4bec5a9-d3b5-4f4a-9ec6-01a4ce3ba47c
type: Opaque

GCP报告此错误
同步到GCP时出错:运行负载平衡器同步例程时出错:获取入口机密时出错:机密“letsencrypt prod”未将证书指定为字符串数据

有谁能帮我解决它缺少的内容吗?

根据,您必须提供GCP的有效格式,就像您已经提供的
让我们加密
有效证书:

kubectl create secret generic letsencrypt-prod --from-file=tls.crt="cert.pem" --from-file=tls.key="privkey.pem" --dry-run -o yaml > output
kubectl apply -f output

另外,(看起来您已经在使用它了,但安全总比抱歉好),您必须根据

入口的
tls
部分中定义它。实际上,它在doc中丢失了,或者我丢失了,因为示例在任何地方都使用与元数据相同的名称

---
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
  name: cert-example
  namespace: example
spec:
  secretName: REAL_NAME_OF_SECRET << This need to include in ingress.
  issuerRef:
    name: letsencrypt-prod
  dnsNames:
  - 'staging.domain.com'
  - '*.staging.domain.com'
---
apiVersion:cert-manager.io/v1alpha2
种类:证书
元数据:
名称:证书示例
名称空间:示例
规格:

secretName:REAL_NAME_OF_SECRET您不应该将您的私钥发布到任何地方,更不用说发布到您的生产环境。但在解码之后,它看起来还是不完整的。另外,看起来您还没有添加证书文件,这就是错误告诉您的@谢谢,我故意把它弄错了
---
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
  name: cert-example
  namespace: example
spec:
  secretName: REAL_NAME_OF_SECRET << This need to include in ingress.
  issuerRef:
    name: letsencrypt-prod
  dnsNames:
  - 'staging.domain.com'
  - '*.staging.domain.com'