I've been following this tutorial on getting started with Kubernetes using Docker containers, which is a variation of this official tutorial modified to use docker-compose
.
I've managed to get as far as listing the nodes using
kubectl get nodes
but I can only do that if I have an SSH connection open to the container in another window, opened using
docker-machine ssh docker-vm -L 8080:localhost:8080
This is quite messy and I'd like to be able to handle this in the docker-compose.yml
, but I don't know how
I've tried using the ports
and expose
options in the iml file, but they do not work. When I try to forward/expose port 8080 and get the nodes using the above kubectl
command, I get the following error:
error: couldn't read version from server: Get http://localhost:8080/api: EOF
I've used the docker-compose.yml
from the first link at the top, and made the following modifications:
aipserver:
ports:
- "8080:8080"
expose:
- "8080"
I've tried this on all of the containers specified in the docker-compose.yml
, but the problem persists.
How can I use the docker-compose.yml
to forward/expose ports on my containers without having to open an SSH connection with the -L
option specified.