我正在尝试在多租户 GKE+Istio 设置上配置 TLS (LetsEncrypt)。
我主要按照本指南 -> Full Isolation in Multi-Tenant SAAS with Kubernetes & Istio 在 GKE+Istio 中设置多租户,我能够成功实现。我可以将简单的应用部署在它们单独的命名空间上,这些命名空间可以通过它们各自的子域进行访问。
然后我尝试前进并使用 LetsEncrypt 设置 TLS。为此,我主要遵循了一个不同的指南,可以在这里找到-> istio-gke。但不幸的是,遵循本指南并没有产生我想要的结果。当我完成后,LetsEncrypt 甚至不会向我的部署或域颁发证书。
因此,我尝试遵循以下不同的指南 -> istio-gateway-tls-setup。在这里,我设法让 LetsEncrypt 为我的域颁发证书,但是当我尝试使用 openssl 或其他在线 ssl 检查器对其进行测试时,它说我仍然无法安全地进行通信。
以下是我尝试描述我的证书、颁发者和网关的配置时的结果:
证书:kubectl -n istio-system 描述证书 istio-gateway
颁发者:kubectl -n istio-system 描述颁发者letsencrypt-prod
网关:kubectl -n istio-system 描述网关 istio-gateway
虽然这是我的 helm install <tenant>
的试运行结果
install.go:173: [debug] Original chart version: ""
install.go:190: [debug] CHART PATH: /home/cjcabero/projects/aqt-ott-msging-dev/gke-setup/helmchart
NAME: tenanta
LAST DEPLOYED: Wed Feb 17 21:15:08 2021
NAMESPACE: default
STATUS: pending-install
REVISION: 1
TEST SUITE: None
USER-SUPPLIED VALUES:
{}
COMPUTED VALUES:
frontend:
image:
pullPolicy: IfNotPresent
repository: paulbouwer/hello-kubernetes
tag: "1.8"
ports:
containerPort: 8080
service:
name: http
port: 80
type: ClusterIP
HOOKS:
MANIFEST:
---
# Source: helmchart/templates/namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: tenanta
labels:
istio-injection: enabled
---
# Source: helmchart/templates/frontend-service.yaml
apiVersion: v1
kind: Service
metadata:
name: frontend
namespace: tenanta
spec:
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 8080
selector:
app: frontend
---
# Source: helmchart/templates/frontend-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
namespace: tenanta
spec:
replicas: 3
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- name: hello-kubernetes
image: paulbouwer/hello-kubernetes:1.8
ports:
- containerPort: 8080
env:
- name: MESSAGE
value: Hello tenanta
---
# Source: helmchart/templates/virtualservice.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: tenanta-frontend-ingress
namespace: istio-system
spec:
hosts:
- tenanta.cjcabero.dev
gateways:
- istio-gateway
http:
- route:
- destination:
host: frontend.tenanta.svc.cluster.local
port:
number: 80
我不明白为什么尽管 LetsEncrypt 似乎能够为我的域颁发证书,但它仍然无法安全地通信。
Google Domains 甚至设法发现在其 Transparency Report 的域中颁发了证书。
无论如何,我不确定这是否有帮助,但我也尝试使用在线 ssl 检查器检查域,结果如下 -> https://check-your-website.server-daten.de/?q=cjcabero.dev。
顺便说一下,我确实使用了 Istio on GKE,结果是 Istio v1.4.10 和 Kubernetes v1.18.15-gke.1100。