Skip to content

Trivial converted service is not reachable #1128

Closed
@rgov

Description

I'm using kompose 1.18.0 on macOS. Consider the following simple docker-compose.yml:

version: '3'
services:
  nginx:
    image: nginx:1.15.12-alpine
    container_name: nginx
    ports:
      - 80:80

If I run:

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

But I cannot access the service at this IP address on the port that should be listening for outside connections (as it would if I had run docker-compose up):

$ curl -vvv http://172.30.110.242
* Rebuilt URL to: http://172.30.110.242/
*   Trying 172.30.110.242...
* TCP_NODELAY set
* Connection failed
* connect to 172.30.110.242 port 80 failed: Connection refused
* Failed to connect to 172.30.110.242 port 80: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 172.30.110.242 port 80: Connection refused

Also for what it's worth kompose --file kubernetes.yml up reports a bunch of YAML parse errors. I've attached it here. kubernetes.yml.txt

Activity

hangyan

hangyan commented on May 10, 2019

@hangyan
Contributor

Does the pods running?

hangyan

hangyan commented on May 10, 2019

@hangyan
Contributor

I have test the example you posted, and it works!. Can you check the deployment pods to see if they are running?

rgov

rgov commented on May 10, 2019

@rgov
Author

I'm new to Kubernetes, could you please tell me how to "check the deployment pods" and to start them if they're not running?

hangyan

hangyan commented on May 10, 2019

@hangyan
Contributor

Just run kubectl get pods -n <ns>, mostly <ns>=default

rgov

rgov commented on May 10, 2019

@rgov
Author
$ kubectl get deployment,svc,pods
NAME                          DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deployment.extensions/nginx   1         1         1            0           0s

NAME            TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
service/nginx   ClusterIP   172.30.55.250   <none>        80/TCP    0s

NAME                         READY     STATUS    RESTARTS   AGE
pod/nginx-6f986c9f65-t5vjx   0/1       Pending   0          <invalid>
hangyan

hangyan commented on May 10, 2019

@hangyan
Contributor

Your Pod is Pending, you can use kubectl describe pods nginx-6f986c9f65-t5vjx why it's not running. And theAGE field is invalid, seems like a misconfig of the kubernetes system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Trivial converted service is not reachable · Issue #1128 · kubernetes/kompose