Comments (11)
You are right, in puppet each thing must be unique.
How about making your "app_name" have the port in it?
consul::service { "my_app_port_42":
service => "my_app",
port => 42,
}
consul::service { "my_app_port_43":
service => "my_app",
port => 43,
}
If you want you can specify the id directly too, but in this case you don't have to, it defaults to the title.
Here are all the available params:
https://github.com/solarkennedy/puppet-consul/blob/master/manifests/service.pp#L1
from puppet-consul.
Make the title of the consul::service
be ${app_name}_${port}
.
from puppet-consul.
@solarkennedy Thanks for reply, we already use it few places but we dont want to do it cause it creates lot of mess.
This is basic functionality from consul end, and it can be handled on tag level when ports are different and extra information needs to be added.
One more thing i noticed is the Service ID, basically it is created with Service name which is kinda of wrong, cause when you try to register same service with different configuration (like explained in above example) from same node it will overwrite the existing service with latest config instead of adding new service to catalogue, either service id needs to be generated randomly with some logic or overhead should be off loaded to consul as it takes care of it and createsservice id on its own.
from puppet-consul.
Can we expect fix for this any time soon @solarkennedy, it will be great help ?
from puppet-consul.
I can imagine (PRs welcome) a fix for Service ID.
But there will never be a fix for the puppet language requiring unique names of resources.
from puppet-consul.
@solarkennedy correct me if am wrong, i was thinking(suggesting) https://github.com/solarkennedy/puppet-consul/blob/master/manifests/install.pp#L5 this part changing it to defined resource or function.
(It might be a lot of effort to change it though, am not sure).
from puppet-consul.
I'm confused, do you intend to install
consul multiple times? or configure multiple consul services on the same port?
from puppet-consul.
@solarkennedy am just trying to register multiple services from same machine, port can be same, name can be same. The issue is with ID of service if it's unique (by default if you don't provide consul generates random uuid) you can register multiple services on same agent with same name same port but technically they will be different cause of ID. But as of now in module we use service name as ID and that's the problem.
from puppet-consul.
Also sorry for late reply, hope you're well in this difficult times :).
from puppet-consul.
@solarkennedy Hey kyle yes i do it already, problem with this approach is, the services from other end need to do multiple calls, lets say if service is having multiple ports.
Take this example,
I have proxysql and it's running on multiple ports lets assume 8080, 8081, 8092
Now if i register each proxysql with name-port combination: proxysql-8081, proxysql-8082.
When i want to discover proxysql, I can't get catalog by simply looking for service with proxysql name, i will need to do multiple calls with name-port combination also to make those calls i should know the ports beforehand which beats the whole purpose of service discovery from my opinion.
from puppet-consul.
Yes Adding ID should do the job :) and i can see it's over writable this should help, thanks.
from puppet-consul.
Related Issues (20)
- Drop EoL Amazon Linux support
- Drop EoL Fedora 25/26/27 support
- Drop EoL FreeBSD 10 support
- Drop support for old SLES/SLED versions
- Drop support for EoL Puppet 5
- Migrate from master to main HOT 2
- migrate module to Vox Pupuli? HOT 6
- Module Release?
- RFC: refactor to include official hashicorp package repos HOT 1
- Systemd service does't work for 'package' install_method HOT 6
- RFC: change dependency camp2camp/systemd module to voxpupuli/systemd
- legacy ACL v1 no longer working starting from Consul version 1.11 HOT 9
- Add ability to manage consul log directory HOT 1
- Status of the project HOT 1
- Adding ACLS / Policies failes with unable to get local issuer certificate -> Puppet 6 / LetsEncrypt HOT 2
- alternative commands to Consul Reload
- module doesn't support grpc checks
- systemd Failed to parse service type, ignoring: exec
- How to access the secret_id of tokens HOT 1
- Allow to not restart consul when updating the binary
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-consul.