Closed
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
Metadata
Assignees
Labels
No labels
Activity
hangyan commentedon May 10, 2019
Does the pods running?
hangyan commentedon May 10, 2019
I have test the example you posted, and it works!. Can you check the deployment pods to see if they are running?
rgov commentedon May 10, 2019
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 commentedon May 10, 2019
Just run
kubectl get pods -n <ns>
, mostly<ns>
=defaultrgov commentedon May 10, 2019
hangyan commentedon May 10, 2019
Your Pod is Pending, you can use
kubectl describe pods nginx-6f986c9f65-t5vjx
why it's not running. And theAGE
field isinvalid
, seems like a misconfig of the kubernetes system