S
S
Sergey2022-03-13 17:27:20
Ansible
Sergey, 2022-03-13 17:27:20

How realistic is the consul for devops?

Prompt on such questions:
1. And Consul is able in general to automatically detect services somehow? Or just gives everything that we specify to him in the config? I somehow caught a glimpse of an article something like "automatic discovery of services by consul", in which, it seems, somehow this was done without the standard enumeration in the configs. Now I've looked all over the internet and can't find it. Only an independent indication in the configs.
2. And how do you add your services to the consul? Ansible, for example, deploy some service on a server and immediately add an entry to the consul on it? Or is it possible to do it in a more convenient / native way?
3. Why do you need to register services in the consul? According to the docks everywhere, it turns out that they brought the data to the consul, he handed them over to Prometheus. But if I add some kind of service to the consul configs using automation tools (scripts, ansible, something else), then what prevents me from writing the same information directly to the consul configs using the same tools? Why extra intermediate services, points of failure, additional load, additional memory leaks, additional threat to information security, etc.?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
shurshur, 2022-03-13
@sergey_privacy

No one is forcing you to use docker, systemd, ansible, and generally any kind of orchestration and optimization systems. It is not necessary to make config templates or clustered service configurations, it is not necessary to use custom logging libraries, mess with balancers and replicated databases. But people do it, so it still makes sense?
An experienced administrator should not ask the question "is it necessary at all?" and proceed from ideas like "any specialist in the field of DevOps needs this specifically and does not need specifically another." He himself must understand at what point the complexity of his infrastructure reaches the state in which it needs this or that complication. Do not talk about the fact that the consul is not needed at all or is urgently needed, but make a decision about what and when he needs to solve practical problems. It's great that in the modern world there are many tools that allow you to quickly do various useful things.
Consul is also a tool. It is unlikely that at least someone uses its capabilities entirely and completely, especially since no one forces. It is enough for someone that he has all services registered in one place and out of the box have an automatic DNS name of the form NAME.service.consul. Someone uses a kv-storage to store parameters, and someone stores secrets and entire configs in it, sets up tokens with different acls and crosses all this with consul-template. In general, it is not necessary to use the consul, there are other tools for similar tasks. For example, zk/etcd.
Consul is more often used not with ansible at all, but with orchestration tools in which services can expand and collapse, reload and migrate. Let's say we have a conditional rabbitmq service for three nodes. Then we can have three rabbitm{1..3} containers, at startup they are registered in the consul by the startup script along with checks, and then consul gives them all three as the name rabbitmq.service.consul. If one of them suddenly falls, consul will quickly detect this and exclude the problem node from DNS. If suddenly the administrator managing all this or the automatic orchestration system considers it necessary to add new nodes or move them somewhere else in the cluster, then consul will also reflect all the necessary changes. In this case, the application using rabbitmq will only need to know the address of rabbitmq.
Of course, any task can be covered with scripts, crutches and even self-written playbooks without the use of ready-made tools, and then re-solve dozens of tasks that have already been solved a hundred times by experienced people before you, but why?

V
Vitaly Karasik, 2022-03-14
@vitaly_il1

In addition to shurshur , one of my favorite quotes is "choose your tools based on your needs, not the other way around."

P
Puma Thailand, 2022-03-14
@opium

Because you yourself can forget to add
. For example, a new service or server must be added in that place
. And you took it and did not add it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question