apiVersion: v1
kind: Service
metadata:
  name: web #the name of the service
spec:
  selector:
      app: java-app
  type: NodePort # the server gives port diffrents from port 80    
  ports:
     - protocol: TCP
       port: 8080
       targetPort: 8080