Issue 1:
BUG REPORT

Kubernetes version : v1.3.2

Environment:

setup kubernetes cluster on 4 VMs of ubuntu 14.04, 1 master and 3 nodes

bring up by kube-up.sh with PROVIDER=ubuntu

Kernel : 3.13.0-92-generic

What happened:

when do kubectl get nodes returned:

NAME STATUS AGE

*.205 Ready 1h

*.205 NotReady 14d

*.206 Ready 14d

*.207 Ready 14d

so there are two nodes with the same name *.205 and one is Notready

What you expected to happen:

this probably happened after I restart kube-controller and api-server

restart kubelet and tail kubelet.log on *.205 shows:

I0819 09:54:08.146564 17698 factory.go:54] Registering systemd factory

I0819 09:54:08.148318 17698 factory.go:86] Registering Raw factory

I0819 09:54:08.150438 17698 manager.go:1072] Started watching for new ooms in manager

I0819 09:54:08.150552 17698 oomparser.go:200] OOM parser using kernel log file: "/var/log/kern.log"

I0819 09:54:08.151820 17698 manager.go:281] Starting recovery of all containers

I0819 09:54:08.162525 17698 manager.go:286] Recovery completed

I0819 09:54:08.256878 17698 kubelet.go:1187] *Node .205 was previously registered

if add --register-node=false to /etc/default/kubelet and tail log shows:

I0819 09:56:52.330062 18421 factory.go:54] Registering systemd factory

I0819 09:56:52.331063 18421 factory.go:86] Registering Raw factory

I0819 09:56:52.332105 18421 manager.go:1072] Started watching for new ooms in manager

I0819 09:56:52.332225 18421 oomparser.go:200] OOM parser using kernel log file: "/var/log/kern.log"

I0819 09:56:52.333547 18421 manager.go:281] Starting recovery of all containers

I0819 09:56:52.348541 18421 manager.go:286] Recovery completed

the node *205 is working now but not stable and when I do setup of weave-scope which launch pod on each node would have two pods on two duplicate *205 node and the one who is Not Ready has the pod pending

Is there any way to remove that dupliacte useless node?

Issue 2:
What:

Propose refactor pkg/proxy/config/config.go

https://github.com/kubernetes/kubernetes/blob/master/pkg/proxy/config/config.go

Why:

In pkg/proxy/config/config.go, there are many identical codes between Service and Endpoints.

ServiceUpdate VS. EndpointsUpdate

type ServiceUpdate struct {
Services []api.Service
Op Operation
}

type EndpointsUpdate struct {
Endpoints []api.Endpoints
Op Operation
}

ServiceConfigHandler VS. EndpointsConfigHandler

type ServiceConfigHandler interface {
OnServiceUpdate(services []api.Service)
}

type EndpointsConfigHandler interface {
OnEndpointsUpdate(endpoints []api.Endpoints)
}

EndpointsConfig VS. ServiceConfig

and almost the same NewServiceConfig() VS. NewEndpointsConfig(), endpointsStore.Merge() VS. serviceStore.Merge() and so on.

So I think we can introduce an abstract layer which can generify both Service and Endpoints here. In this way, reuse some codes.

How:

Move Service and Endpoints to interface{}, like:

type ObjectUpdate struct {
Objects []interface{}
Op Operation
}

type ObjectConfigHandler interface {
OnObjectUpdate(objects []interface{})
}

type ObjectConfig struct {
mux *config.Mux
bcaster *config.Broadcaster
store *objectStore
}

func (s *objectStore) Merge(source string, change interface{}) error {
...
}

...

@thockin @smarterclayton

What do you think about it?

Thanks!