Deploying Services

Deploying Services to clusters with Cloud Service Mesh is almost thesame as deploying Services to clusters without Cloud Service Mesh. You do need tomake some changes to your Kubernetes manifests:

  • CreateKubernetes Servicesfor all containers. AllDeployments should have aKubernetes Service attached.

  • Name your Service ports. Although GKE allows you todefine unnamed Service ports, Cloud Service Mesh requires that you provide aname for a port that matches the port'sprotocol.

  • Label your Deployments. This allows you to use Cloud Service Mesh trafficmanagement features such as splitting traffic between versions of the sameservice.

The following example Deployment and Service illustrate these requirements:

apiVersion:apps/v1kind:Deploymentmetadata:name:helloserverspec:replicas:1selector:matchLabels:app:helloservertemplate:metadata:labels:app:helloserverspec:containers:-image:gcr.io/google-samples/istio/helloserver:v0.0.1imagePullPolicy:Alwaysname:mainrestartPolicy:AlwaysterminationGracePeriodSeconds:5
apiVersion:v1kind:Servicemetadata:name:hellosvcspec:ports:-name:httpport:80targetPort:8080selector:app:helloservertype:LoadBalancer

After deploying your Services on a cluster with Cloud Service Mesh, be sure toinject sidecar proxies.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.