https://rancher.com/ logo
Title
f

famous-lion-95839

03/06/2023, 1:53 PM
I am quite new to Rancher and therefore have a basic deployment question: When trying to deploy two workloads that need to talk to each other (one DB and one service), how exactly can I handle this in Rancher? I know that you need to register the DB as a service but somehow it is not working and I couldn't find any detailed documentation....
l

little-ram-17683

03/06/2023, 2:09 PM
I think the best way is to create 2x ClusterIP services (1 for DB and 1 for app), then just create an ingress and connect it to your clusterIP services (it should appear in rancher UI )
👍 1
f

famous-lion-95839

03/06/2023, 2:22 PM
Would you know a guide that I could follow (can just be for a random app)?
l

little-ram-17683

03/06/2023, 3:17 PM
I think kubernetes docs. You can do it by Rancher UI but you need kubernetes knowledge. https://gist.github.com/alexellis/1f31efc9febfaa3688abfe95c7bfab77 As you can see you need
kind: Service
(clusterIP) for your deployment, then connect it to ingress. If you do it by Rancher GUI selectors will be created automatically. All you have to do is
Workload
->
Deployment
-> click three dots in right of name of your deployment and
edit config
-> click tab with your container name (to the right of "Pods") and click "Add Port". After this operation you should get service. Service Discovery -> Services. Last step is just to create ingress and connect to your service
a

agreeable-oil-87482

03/06/2023, 6:40 PM
This is more of a kubernetes question than a rancher one.