If you go for a microservices architecture in your organization, they can share configuration via zookeeper or its equivalent. However, how should the vario
The "purest" approach, i.e. the one that gives you the least amount of coupling, is to not share any code.
If you find that two services (call them A and B) need the same functionality, your options are:
While this may sound awkward, you avoid the (not uncommon) problem of creating a "utility" or "common" or "infrastructure" library which everyone depends on, and which is then really hard to upgrade and change (i.e. which indirectly couples the services).
In practice, as usual, it's a tradeoff.
However, what's best will depend on your specific situation and problem.