tczekajlo / kube-consul-register

a tool to register Kubernetes PODs as Consul Services
Apache License 2.0
105 stars 50 forks source link

kube-consul-register don't register services #26

Open denyskril opened 6 years ago

denyskril commented 6 years ago

Hello my configmap:

apiVersion: v1 kind: ConfigMap metadata: name: kube-consul-register namespace: default data: consul_address: "consul-agent.cluster.local" consul_port: "8500" consul_scheme: "http" consul_insecure_skip_verify: "true" consul_token: "TOKEN" consul_timeout: "2s" consul_container_name: "consul-agent" consul_node_selector: "consul=enabled" pod_label_selector: "" k8s_tag: "kubernetes" register_mode: "node" register_source: "service"

but i see in logs:

I0517 13:46:56.050948 1 main.go:64] Using build: v0.1.4-1-gb9100f5 I0517 13:46:56.111231 1 main.go:98] Current configuration: Controller: &config.ControllerConfig{ConsulAddress:"consul-agent.cluster.local", ConsulPort:"8500", ConsulScheme:"http", ConsulCAFile:"", ConsulCertFile:"", ConsulKeyFile:"", ConsulInsecureSkipVerify:true, ConsulToken:"TOKEN", ConsulTimeout:2000000000, ConsulContainerName:"consul-agent", ConsulNodeSelector:"consul=enabled", PodLabelSelector:"", K8sTag:"kubernetes", RegisterMode:"node"}, Consul: &api.Config{Address:"127.0.0.1:8500", Scheme:"http", Datacenter:"", HttpClient:(http.Client)(0xc420400fc0), HttpAuth:(api.HttpBasicAuth)(nil), WaitTime:0, Token:""} I0517 13:46:56.111420 1 main.go:128] Start syncing... I0517 13:46:56.159244 1 main.go:133] Synchronization's been ended I0517 13:46:56.159285 1 main.go:112] Start cleaning... I0517 13:46:56.197430 1 main.go:117] Cleaning has been ended

and services dont register in consul.

how can i fix it?

please help.

mellowplace commented 6 years ago

As I see from the code it only registers services if they are of type NodePort - otherwise it silently does nothing

mellowplace commented 6 years ago

Apologies in master it will register services of type NodePort & ClusterIP

mellowplace commented 6 years ago

Also though make sure your services have the correct annotation and you have the correct config for kube-consul-register to pick up services