<p>I have one port specified as below.</p>

<p>my-app-service.yaml</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  labels:
    app: my-app
  name: my-app-service
  namespace: default
spec:
  externalTrafficPolicy: Cluster
  ports:
    - port: 80
      name: my-port
      protocol: TCP
      targetPort: 8000
  selector:
    app: my-app
  sessionAffinity: None
  type: NodePort

</code></pre>

<p>cloudbuild.yaml summary:</p>

<pre><code>steps:
  - name: gcr.io/cloud-builders/gcloud
  - name: gcr.io/cloud-builders/docker
  - name: gcr.io/cloud-builders/gke-deploy
</code></pre>

<p>For some reason I get an error asking for a name param on port1, when port1 doesn't even exist. See below.</p>

<p>output:</p>

<pre><code>Step #3: Applying deployment.
Step #3: Getting access to cluster "my-cluster" in "my-zone".
Step #3: Configuration files to be used: [{kind: Deployment, name: my-app} {kind: HorizontalPodAutoscaler, name: my-app-hpa} {kind: Service, name: my-app-service}]
Step #3: Applying configuration files to cluster.
Step #3: Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
Step #3: The Service "my-app-service" is invalid: 
Step #3: * spec.ports[1].name: Required value
</code></pre>

<p>Kubernetes version: 1.15.9-gke.24</p>

<p>Anyone know what I'm missing?</p>

Willy G
<p>Recreating the yaml worked:</p>

<pre><code>kubectl delete -f service.yaml
kubectl apply -f service.yaml
</code></pre>
