在文档中,有一个关于使用没有使用网关+ VirtualService的证书管理器来保护Kubernetes入侵的的例子。
我试过让它与acme http01一起工作,但是证书无法颁发,因为在日志挑战中,我有404错误。似乎无法访问域检查的挑战。我提到的规范有什么最佳实践吗?
更新1
我希望为istio网关和SDS选项一起使用TLS,并通过使用证书-经理与http-01来保护它。
根据文档,我找到了一些示例,如用Cert-Manager确保Kubernetes入侵或使用Cert-Manager部署自定义侵入网关。然而,这些示例使用的是Kuberenetes、In匀浆资源本身(不是istio网关),或者像第二个示例一样使用dns-01。
我需要一个指令,其中包括istio网关和SDS选项的TLS,并通过使用证书-经理与http-01来保护它。Istio网关使我能够使用VirtualService。
谢谢!
发布于 2019-06-14 01:47:40
我已经找到了答案,但不太确定为什么会这样。我对文档进行了一些修改。
首先,我使用istio-autogenerated-k8s-ingress命令编辑了kubectl -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有了这个证书-经理颁发了我的证书(我猜是由istio-autogenerated-k8s-ingress网关!不知道!我可以像上面的例子一样创建多个网关和虚拟服务。所以一切都很好!这只是我的想法,盲目地做并不是一种正确的方法。如果你有更好的答案,并且你知道为什么会发生像我解释的那样的事情,请告诉我。
谢谢!
https://stackoverflow.com/questions/56445893
复制相似问题