someone
someone

Reputation: 1

Is there a way 2 jobs can communicate on hashicorp's nomad

I have 2 jobs:-

an api with websocket a service that sends message to the websocket of service 1 Is there a way service 2 can send message to service 1’s endpoint?

Note:- Service 1 is a public api, but i dont want to expose the websocket to the internet

I already have them communicating via the public internet, but want the websocket to be private.

Upvotes: 0

Views: 334

Answers (1)

KamilCuk
KamilCuk

Reputation: 141698

In the job service 1 you should register the service block either in Nomad or Consul provider. See https://developer.hashicorp.com/nomad/docs/job-specification/service .

Then service 2 should generate a template using the registered services matching service 1. Then this template should be used for service 2 configuration. See https://developer.hashicorp.com/nomad/docs/job-specification/template#consul-services and https://developer.hashicorp.com/nomad/docs/job-specification/template#nomad-services for an example.

Upvotes: 0

Related Questions