Rancher server and agent on same vps

Hello,

I launched a rancher server on ports 80 and 443 as stated in the quick start guide, then added a cluster node on the same machine running the server, then i created an nginx workload and a LB pointing to nginx with a domain name of an A record pointing to the server’s IP address.

Whenever a hit the specified domain:80 i get rancher’s dashboard rather than the nginx server response.

Is it that the ranch server is using port 80 and ingress gracefully failing (without any errors shown btw) ?
I’m i supposed to run the host and agent on separate servers/ip addresses?
I used to do this without problems in 1.6.

Any help is greatly appreciated,
Thank you

Hello amine,

That happens to me too.
I think that installing the server outside the cluster or change port to rancher server solves this but I’m not sure it’s the best option.

Have you solved it?

Thank you.

In the situation where you want to use a single node to run Rancher and to be able to add the same node to a cluster, you have to adjust the host ports mapped for the rancher/rancher container.

If a node is added to a cluster, it deploys the nginx ingress controller which will use port 80 and 443. This will conflict with the default ports we advice to expose for the rancher/rancher container.

Please note that this setup is not recommended for production use, but can be convenient for development/demo purposes.

To change the host ports mapping, replace the following part -p 80:80 -p 443:443 with -p 8080:80 -p 8443:443:

docker run -d --restart=unless-stopped \
  -p 8080:80 -p 8443:443 \
  rancher/rancher:latest
1 Like

Hi superseb,

Thanks for the tip.
Could you provide more infor about this on a ha production installation?

Thanks in advance.

In an HA setup you have a dedicated cluster for Rancher, and the nginx ingress controller routes outside traffic to the pods. So the container ports remain the same, but they are not exposed in the container but routed to via the nginx ingress controller.

Okay, so I need another cluster to run my containers.
Thanks you.