Adding endpoint for log retrieval on the minion

Adding logic for retrieving logs from docker containers.
Usage:
To returns snapshot of the logs:
`curl http://10.245.2.2:10250/containerLogs?containerID=c93b7770a0b6`  

 To tail 15 lines of logs:
`curl http://10.245.2.2:10250/containerLogs?containerID=c93b7770a0b6&tail=15`

To stream logs:
`curl http://10.245.2.2:10250/containerLogs?containerID=c93b7770a0b6&follow=1`

Related: 
https://github.com/GoogleCloudPlatform/kubernetes/issues/1235#issuecomment-55188947


> On Sep 15, 2014, at 4:16 PM, Dawn Chen <notifications@github.com> wrote:
> 
> In pkg/kubelet/server.go:
> 
> > @@ -143,7 +145,45 @@ func (s *Server) handleContainers(w http.ResponseWriter, req *http.Request) {
> >  
> >  }
> >  
> > -// handlePodInfo handles podInfo requests against the Kubelet.
> > +// handleContainerLogs handles containerLogs request againts the Kubelet
> > +func (s *Server) handleContainerLogs(w http.ResponseWriter, req *http.Request) {
> > +	defer req.Body.Close()
> > +	u, err := url.ParseRequestURI(req.RequestURI)
> > +	if err != nil {
> > +		s.error(w, err)
> > +		return
> > +	}
> > +	uriValues := u.Query()
> > +
> > +	containerID := uriValues.Get("containerID")
> At this moment, UUID is used as attemptID to have time uniqueness. In the future, we are still finalizing attemptID. You can monitor https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/api/v1beta3/types.go for more discussion.
> 
> For now, I think you cloud have "podID+containerName" and "podID+attemptID(a.k.a. UUID)+containerName". For podID+containerName case, you can retrieve the latest attempt's log from docker. @smarterclayton how do you think?
> 
Makes sense to me.  It's probably better to take them as individual parameters as well.
> —
> Reply to this email directly or view it on GitHub.