Change:
Currently, kubelet uses a for communicating with cAdvisor. , were having an issue because we didn't realize making port available was required for kubernetes.
I prefer not do this since we plan to make 4194 publically reserved port for cAdvisor. Also cAdvisor is the default deamon running on every node of a kubernetes cluster. The issue you encountered sounds like a bad document issue we had for cAdvisor. We should fix the document instead of allow the port being configurable.
can you expound on 'bad document' issue?

Discussion:
minimumGCAge            = flag.Duration("minimum_container_ttl_duration", 0, "Minimum age for a finished container before it is garbage collected.  Examples: '300ms', '10s' or '2h45m'") maxContainerCount       = flag.Int("maximum_dead_containers_per_container", 5, "Maximum number of old instances of a container to retain per container.  Each container takes up some disk space.  Default: 5.") authPath                = flag.String("auth_path", "", "Path to .kubernetes_auth file, specifying how to authenticate to API server.") <ins> cAdvisorPort            = flag.Uint("cadvisor_port", 4194, "The port of the localhost cAdvisor endpoint") </ins> apiServerList           util.StringList )

MaxContainerCount:       *maxContainerCount, Runonce:                 *runonce, Port:                    *port, <ins> CAdvisorPort:            *cAdvisorPort, </ins> EnableServer:            *enableServer, EnableDebuggingHandlers: *enableDebuggingHandlers, DockerClient:            kubelet.ConnectToDockerOrDie(*dockerEndpoint),

# Heapster <del> Heapster enables monitoring of Kubernetes Clusters using [cAdvisor](https://github.com/google/cadvisor). Detailed information about heapster can be found [here](https://github.com/GoogleCloudPlatform/heapster). </del> <ins> Heapster enables monitoring of Kubernetes Clusters using [cAdvisor](https://github.com/google/cadvisor). The kubelet will communicate with an instance of cAdvisor running on localhost and proxy container stats to Heapster. Kubelet will attempt to connect to cAdvisor on port 4194 by default but this port can be configured with kubelet's `-cadvisor_port` run flag. Detailed information about heapster can be found [here](https://github.com/GoogleCloudPlatform/heapster). </ins>

"os" "os/exec" "path" <ins> "strconv" </ins> "strings" "time"

} // TODO: move this into the kubelet itself <del> func MonitorCAdvisor(k *Kubelet) { </del> <ins> func MonitorCAdvisor(k *Kubelet, cp uint) { </ins> defer util.HandleCrash() // TODO: Monitor this connection, reconnect if needed? glog.V(1).Infof("Trying to create cadvisor client.") <del> cadvisorClient, err := cadvisor.NewClient("http://127.0.0.1:4194") </del> <ins> cadvisorClient, err := cadvisor.NewClient("http://127.0.0.1:" + strconv.Itoa(int(cp))) </ins> if err != nil { glog.Errorf("Error on creating cadvisor client: %v", err) return

type KubeletConfig struct { EtcdClient              tools.EtcdClient DockerClient            dockertools.DockerInterface <ins> CAdvisorPort            uint </ins> Address                 util.IP AuthPath                string ApiServerList           util.StringList

k.BirthCry() go kubelet.GarbageCollectLoop(k) <del> go kubelet.MonitorCAdvisor(k) </del> <ins> go kubelet.MonitorCAdvisor(k, kc.CAdvisorPort) </ins> kubelet.InitHealthChecking(k) return k