Reputation: 11
I want to use Rancher to host several webservers for domains that I own as well as other Linuxy programs I may want to use in future. I have an HP Gen 8 Microserver with 4TB storage and 16GB RAM to use as a host.
After protracted faffing around I've clean-installed Rancher Agent version 2.3.5 on top of RancherOS 1.5.5. The Rancher install command was :
docker run -d --restart=unless-stopped -p 8080:80 -p 8443:443 rancher/rancher:latest
as per the bottom of the Rancher docs webpage here because I m installing Rancher Agent on the same host as the server.
The Rancher Agent install command I used is :
sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.3.5 --server https://mitchell:8443 --token h4vw6pjvwd5l2wztjftzghnlx7wggsc2gmm2qnl45z8k4sx7bb4rsk --ca-checksum ee7e963689584c3ae564a66604bc3f82af6b75abae1abf0a43945a31903be693 --etcd --controlplane --worker
and this installs controlplane, etcd and worker functionality. The server seems fine and I can log on via https://myhost:8443 as expected.
Like many small office developer I have a broadband router that permits me to route http(s) traffic to a specific LAN IP and this works fine. I have also got mydomain.net etc to route through it but I am testing with a 'hosts' file setup now for simplicity.
I have installed several test loads but am unable to work out how to access them. Basically, I want to end up with a load balancer which routes the http(s) traffic to the relevant Rancher workload according to whether the request host is mydomain1.net, mydomain2.net etc etc.
Taking a concrete example : if I install phpBB from the Rancher "Library" catalogue into the "default" namespace that you get with the Rancher install and using all default options except the phpBB Password and Admin email address and setting "phpBB Service Type" := "NodePort" I get the continuous error message "Deployment does not have minimum availability." for the phpBB container (although the phpBB-mariadb container comes up immediately as "Active"). If I edit phpBB and change the Scaling/Upgrade policy from "Custom" to "Rolling: stop old pods, then start new" with Batch Size 1 then it starts OK and shows me "31470/tcp, 32640/tcp" as the ports for the container. However, if I try to browse to "myhost:31470" or to "myhost:32640" the connection times out. The same is true for "mydomain.net:32640" etc. Ports 80 and 443 don't work either.
I assume that I need to add an Ingress load balancer into the "default" workload and I have tried this as follows :
I select "Specify a hostname to use" and enter "mydomain.net". I then choose the workload phpBB from the "Target" dropdown box and set the Port to 443. I have tried both mydomain.net's certificate from zerossl.com as well as the "Use default ingress controller certificate" option and it makes no difference to the result. Host for the certificate is set to mydomain.net as above. All that transpires from the above is that the service times out with a "503 Service Temporarily Unavailable" message
Can anyone tell me how I can set up an Ingress load balancer on Rancher so that I can access my servers via their domain names at ports 82 and 445 on my server ?
Thanks,
Upvotes: 1
Views: 383