cloudwatt / kube2consul

GNU General Public License v3.0
3 stars 12 forks source link

Feature request : allow prefixing and overriding Consul service-name #5

Open BarthV opened 7 years ago

BarthV commented 7 years ago

Hi !

It should be possible to ask kube2consul to dynamicly change the target service name in Consul based on Endpoint metadata. Since Annotations are not available in Endpoints metadata, I suggest using only label for this case.

This is what I'm thinking about :

apiVersion: v1
kind: Service
metadata:
  name: my-service-02
  namespace: myservices
  labels:
    k2c-servicename: 'my-svc-two-in-consul'
    k2c-serviceprefix: 'foobar-'
spec:
[...]

Obviously, k2c-servicename wins if both are specified.

Thanks !