# Deploying Services

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

- Create
  [Kubernetes Services](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/network-overview#services)
  for all containers. All
  [Deployments](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/)
  should have a
  Kubernetes Service attached.

- Name your Service ports. Although GKE allows you to
  define unnamed Service ports, Cloud Service Mesh requires that you provide a
  [name for a port](https://docs.cloud.google.com/service-mesh/v1.19/docs/naming-service-ports.md.txt) that matches the port's
  protocol.

- Label your Deployments. This allows you to use Cloud Service Mesh traffic
  management features such as splitting traffic between versions of the same
  service.

The following example Deployment and Service illustrate these requirements:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: helloserver
spec:
  replicas: 1
  selector:
    matchLabels:
      app: helloserver
  template:
    metadata:
      labels:
        app: helloserver
    spec:
      containers:
      - image: gcr.io/google-samples/istio/helloserver:v0.0.1
        imagePullPolicy: Always
        name: main
      restartPolicy: Always
      terminationGracePeriodSeconds: 5
```

```yaml
apiVersion: v1
kind: Service
metadata:
  name: hellosvc
spec:
  ports:
  - name: http
    port: 80
    targetPort: 8080
  selector:
    app: helloserver
  type: LoadBalancer
```

After deploying your Services on a cluster with Cloud Service Mesh, be sure to
[inject sidecar proxies](https://docs.cloud.google.com/service-mesh/v1.19/docs/anthos-service-mesh-proxy-injection.md.txt).

## What's next

- [Preparing an application for Cloud Service Mesh](https://docs.cloud.google.com/service-mesh/v1.19/docs/prepare-app-for-anthos-service-mesh.md.txt)

- [Deploy the Online Boutique sample application](https://docs.cloud.google.com/service-mesh/v1.19/docs/onlineboutique-install-kpt.md.txt)