部署 Service
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将 Service 部署到具有 Cloud Service Mesh 的集群与将 Service 部署到没有 Cloud Service Mesh 的集群几乎相同。您需要对 Kubernetes 清单进行一些更改:
为所有容器创建 Kubernetes Service。所有 Deployment 都应附加 Kubernetes Service。
为您的 Service 端口命名。虽然 GKE 允许您定义未命名的 Service 端口,但 Cloud Service Mesh 要求您提供端口名称(与端口的协议匹配)。
为 Deployment 添加标签。这可让您使用 Cloud Service Mesh 流量管理功能,例如在同一服务的不同版本之间拆分流量。
以下示例 Deployment 和 Service 演示了这些要求:
在具有 Cloud Service Mesh 的集群上部署 Service 后,请务必注入 Sidecar 代理。