<p>So final manifest will be next :</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: apiserver-service
  labels:
    app: apiserver
spec:
  selector:
    app: apiserver
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
      nodePort: 30005
  type: NodePort
</code></pre>
<p>It will work for defining specific targetport</p>

Kwaker
<p>Service is an abstract way to expose your application running on a set of Pods. This one is a manifest for creating a <code>service</code>, here <code>targetPort: 8080</code> is the pod port. In this manifest there are basically two parts, one is <code>metadata</code> which gives the service name and also give it a label. Then the <code>spec</code> part, which is short form of specification, it basically the specification of the service, here the <code>selector</code> is given, and also the ports are specified here, <code>port</code> represents the service port, <code>targetPort</code> represents the port on which the service will send requests. By <code>nodePort</code> the outside world (from outside the cluster) can communicate to the service, and finally <code>type</code> represents the type of the service. If the <code>type = NodePort</code> then it is basically means from outside the cluster the service will expose a port (<code>nodePort</code>).</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: apiserver-service
  labels:
    app: apiserver
spec:
  selector:
    app: apiserver
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
      nodePort: 30005
  type: NodePort
</code></pre>
