我有一个现有的GKE集群,安装了Istio addon,例如:
gcloud beta container clusters create istio-demo \
--addons=Istio --istio-config=auth=MTLS_PERMISSIVE \
--cluster-version=[cluster-version] \
--machine-type=n1-standard-2 \
--num-nodes=4我跟随本指南安装cert-manager,以便自动提供TLS证书。根据指南,Istio需要启用SDS,在安装时可以这样做:
helm install istio.io/istio \
--name istio \
--namespace istio-system \
--set gateways.istio-ingressgateway.sds.enabled=true由于我已经通过GKE安装了Istio,如何在现有集群上启用SDS?或者,是否可以在集群创建的时候使用gcloud CLI来启用SDS?
发布于 2019-08-16 09:32:49
根据卡洛斯的回答,我决定不使用Istio on GKE插件,因为在使用Istio作为托管服务时,可用的定制非常有限。
我创建了一个标准的GKE集群..。
gcloud beta container clusters create istio-demo \
--cluster-version=[cluster-version] \
--machine-type=n1-standard-2 \
--num-nodes=4然后手工安装Istio..。
kubectl create namespace istio-systemhelm template install/kubernetes/helm/istio-init --name istio-init --namespace istio-system | kubectl apply -f -helm template install/kubernetes/helm/istio --name istio --namespace istio-system \
--set gateways.enabled=true \
--set gateways.istio-ingressgateway.enabled=true \
--set gateways.istio-ingressgateway.sds.enabled=true \
--set gateways.istio-ingressgateway.externalTrafficPolicy="Local" \
--set global.proxy.accessLogFile="/dev/stdout" \
--set global.proxy.accessLogEncoding="TEXT" \
--set grafana.enabled=true \
--set kiali.enabled=true \
--set prometheus.enabled=true \
--set tracing.enabled=true \
| kubectl apply -f -kubectl label namespace default istio-injection=enabled发布于 2019-08-15 22:13:10
每个设计的托管Istio将恢复任何自定义配置,并将再次禁用SDS。所以,IMHO,这是一个无用的场景.您可以在此指南之后手动启用SDS,但请记住,配置将只在2-3分钟内保持活动状态。
目前,GKE不支持从头创建集群时启用SDS。在GKE管理的Istio上,谷歌希望拥有在GKE集群上启用SDS的能力,但他们还没有发布ETA。
但是,如果您使用的是非托管(开放源码) Istio,那么SDS特性就在Istio路线图中,我认为它应该在1.2版中提供,但这不是一个保证。
发布于 2019-11-12 09:03:35
尽管目前由default ingress gateway创建的Istio on GKE不支持SDS,但您可以手动添加自己的额外入口网关。
您可以在您的istio-ingressgateway名称空间中获取默认的deployment和service的清单,并对其进行修改以添加SDS容器并更改名称,然后将其应用于集群。但这有点太乏味了,有一种更简单的方法可以做到:
首先下载istio的开放源代码舵图(选择一个在GKE版本上与您的Istio一起工作的版本,在我的例子中,我在GKE上的Istio是1.1.3,我下载了开放源代码istio 1.1.17,它可以工作):
curl -O https://storage.googleapis.com/istio-release/releases/1.1.17/charts/istio-1.1.17.tgz
# extract under current working directory
tar xzvf istio-1.1.17.tgz然后只呈现ingressgateway组件的helm模板:
helm template istio/ --name istio \
--namespace istio-system \
-x charts/gateways/templates/deployment.yaml \
-x charts/gateways/templates/service.yaml \
--set gateways.istio-egressgateway.enabled=false \
--set gateways.istio-ingressgateway.sds.enabled=true > istio-ingressgateway.yaml然后通过以下修改手动修改呈现的istio-ingressgateway.yaml文件:
metadata.name更改为类似于istio-ingressgateway-sds的其他内容metadata.lables.istio更改为类似于ingressgateway-sds的其他内容spec.template.metadata.labels更改为ingressgateway-sdsspec.selector.istio更改为与ingressgateway-sds相同的值然后将yaml文件应用于GKE集群:
kubectl apply -f istio-ingressgateway.yaml霍拉!您现在创建了与SDS一起创建的istio ingressgatway,您可以通过以下方式获得其负载均衡器IP:
kubectl -n istio-system get svc istio-ingressgateway-sds要让您的Gateway使用正确的sds启用的ingressgateway,您需要设置spec.selector.istio来匹配您设置的spec.selector.istio。下面是一个使用kubernetes秘密作为TLS证书的Gateway资源的示例:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: gateway-test
spec:
selector:
istio: ingressgateway-sds
servers:
- hosts:
- '*.example.com'
port:
name: http
number: 80
protocol: HTTP
tls:
httpsRedirect: true
- hosts:
- '*.example.com'
port:
name: https
number: 443
protocol: HTTPS
tls:
credentialName: example-com-cert
mode: SIMPLE
privateKey: sds
serverCertificate: sdshttps://stackoverflow.com/questions/57477555
复制相似问题