Accessing Kubernetes service converted from Docker Compose

I built an application using Docker Compose which included an Nginx instance accepting connections on port 80:

  nginx:
    image: nginx:1.15.12-alpine
    container_name: nginx
    volumes:
      - etc.
    ports:
      - 80:80

I’d like to spin up this application on Kubernetes running on my local machine (macOS). So I’ve run kompose convert, documented here.

This generated nginx-service.yaml which looks like this:

apiVersion: v1
kind: Service
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.18.0 ()
  creationTimestamp: null
  labels:
    io.kompose.service: nginx
  name: nginx
spec:
  ports:
  - name: "80"
    port: 80
    targetPort: 80
  selector:
    io.kompose.service: nginx
status:
  loadBalancer: {}

I ran kubectl apply with all of the YAML files produced by kompose, and then kubectl describe svc nginx:

Name:              nginx
Namespace:         myproject
Labels:            io.kompose.service=nginx
Annotations:       kompose.cmd=kompose convert
                   kompose.version=1.18.0 ()
                   kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"kompose.cmd":"kompose convert","kompose.version":"1.18.0 ()"},"creationTimestamp":null,...
Selector:          io.kompose.service=nginx
Type:              ClusterIP
IP:                172.30.110.242
Port:              80  80/TCP
TargetPort:        80/TCP
Endpoints:         
Session Affinity:  None
Events:            <none>

However, I cannot access the web server by navigating to http://172.30.110.242:80 on the same machine.

There is documentation on accessing services running on clusters. I’m new to k8s and I’m not sure how to diagnose the problem and pick the right solution of the options they list.

Is it a defect in kompose that it did not generate a comparable service config file?

Source: StackOverflow