在该文档中,有一个有关使用Cert-Manager保护Kubernetes入口安全的示例,该示例未使用Gateway + VirtualService。
我试图使其与acme http01一起使用,但由于在日志质询中出现404错误,因此无法颁发证书。似乎无法访问域检查挑战。我提到的规格是否有最佳实践?
[更新1]
我想使用带有选项的istio网关,并通过将cert-manager与http-01一起使用来保护它。SDSTLS
根据文档,我找到了一些示例,例如使用Cert-Manager保护Kubernetes入口安全或使用Cert-Manager部署自定义入口网关。但是,这些示例正在使用Kuberenetes Ingress资源本身(不是istio网关),或者类似于第二个示例正在使用dns-01。
我需要一个包含istio gateway的SDS选项的指令,TLS并通过使用带有http-01的cert-manager来确保其安全。Istio网关使我能够使用VirtualService。
谢谢!
我已经找到了答案,但不太确定为什么会这样。我遵循文档进行了一些更改。
首先我编辑了istio-autogenerated-k8s-ingressusingkubectl -n istio-system edit gateway命令。我把整个HTTPS部分拆掉,把HTTP一部分留在那里。
然后我创建了另一个Gateway类似的东西:
cat <<EOF | kubectl apply -f -
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: bookinfo-gateway
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- 'example.com'
port:
name: http
number: 80
protocol: HTTP2
tls:
httpsRedirect: true
- hosts:
- 'example.com'
port:
name: https-default
number: 443
protocol: HTTPS
tls:
credentialName: ingress-cert-staging
mode: SIMPLE
privateKey: sds
serverCertificate: sds
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: bookinfo
spec:
hosts:
- "example.com"
gateways:
- bookinfo-gateway
http:
- match:
- uri:
exact: /productpage
- uri:
exact: /login
- uri:
exact: /logout
- uri:
prefix: /api/v1/products
route:
- destination:
host: productpage
port:
number: 9080
EOF
Run Code Online (Sandbox Code Playgroud)
通过这个证书管理器颁发了我的证书(我猜是通过istio-autogenerated-k8s-ingress网关!!不知道!!),我可以创建多个网关和虚拟服务,如上面的示例。所以一切顺利!!这只是我的想法,盲目的做法并不是正确的做法。如果您有更好的答案并且您知道为什么会像我解释的那样发生这种情况,请告诉我。
谢谢!
| 归档时间: |
|
| 查看次数: |
200 次 |
| 最近记录: |