<p>I am trying to create Nodeport service in my EKS cluster however I am getting error as <code>for: &quot;network/minikube/orderers/services.yaml&quot;: map: map[name:endpoint] does not contain declared merge key: port</code>. Can anybody help me to fix the issue.</p>
<p>My service.yaml file</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: orderer0-service
  labels: {
    component: orderer0,
    type: orderer
  }
spec:
  type: NodePort
  ports:
    - name: endpoint
    - port: 7050
      targetPort: 7050
      nodePort: 30050
  selector:
    component: orderer0
    type: orderer
</code></pre>

Abhijeet1234
<p><code>ports:</code> is representing list of ports, where by <code>-</code> you are separating the ports, (name, port, targetPort, nodePort) these four are combinedly representing one service port values, and you mistakenly included another list in (<code>- port: 7050</code>), your yaml should be like below,</p>
<pre><code>  ports:
    - name: endpoint
      port: 7050
      targetPort: 7050
      nodePort: 30050
</code></pre>
<p>YAML:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: orderer0-service
  labels: {
    component: orderer0,
    type: orderer
  }
spec:
  type: NodePort
  ports:
    - name: endpoint
      port: 7050
      targetPort: 7050
      nodePort: 30050
  selector:
    component: orderer0
    type: orderer
</code></pre>
