How to map single public port of container for few private ports in Rancher Cattle to make port sink? Maybe i should write custom HAProxy config?
For example:
5555/tcp -> 5555/tcp
5555/tcp -> 5556/tcp
5555/tcp -> 5557/tcp
5555/tcp -> 5558/tcp
What you are asking for is easily possible in Rancher.
One of the ways of implementing this:
one (which has the tcp service running on port 5555) to the stack.two (which has the tcp service running on port 5556) to the stack.three (which has the tcp service running on port 5557) to the stack.four (which has the tcp service running on port 5558) to the stack.tcp, port: 5555 with target to one,
port: 5555tcp, port: 5555 with target to two, port: 5556tcp, port: 5555 with target to three, port: 5557tcp, port: 5555 with target to four, port: 5558If you want this load balancer to run on all hosts, you can choose that option when creating the load balancer service.
Also if your service was running on HTTP instead of TCP, you could use that option as well.
Once you have this working manually you can "View Config" to get the docker-compose.yml and rancher-compose.yml files. You can use them to create your custom catalog item and deploy it in one click!
Check out the community-catalog for inspiration and the docs for instructions.