Commit Graph

21 Commits

Author SHA1 Message Date
Clayton Coleman
60c014334f Split TLS loading to allow 3rd parties to load keys easily
The LoadTLSFiles method is useful for configuration code that needs
to read the current client config and get values out for creating
other config files.
2015-02-19 20:54:21 -05:00
Jeff Lowdermilk
703b642886 Merge pull request #4517 from liggitt/kubeconfig_cert_data
Let .kubeconfig be a single-source config for API clients
2015-02-19 10:22:58 -08:00
Jordan Liggitt
abb38cf793 Let .kubeconfig populate ca/cert/key data, and basic-auth username/password in client configs 2015-02-19 11:29:42 -05:00
Brendan Burns
3fa9ddd1e1 Add an (optional) proxy to the TLS config.
Also fill in some other reasonable defaults.
2015-02-10 05:20:47 -08:00
Clayton Coleman
0307d7ba98 Set a default user agent on all client.Client calls
Form:
  kube-controller-manager/v0.10.0 (linux/amd64) kubernetes/550b98e

  <basename(os.Argv)>/<gitVersion> (<GOOS>/<GOARCH>) kubernetes/<shortGitCommit>

Can be set by other clients
2015-02-04 17:45:53 -05:00
Clayton Coleman
d072232d4a Allow client.Config to be used for HTTP2 and WebSocket connections
client.Config describes how to make a client connection to a server
for HTTP traffic, but for connection upgrade scenarios cannot be
used because the underlying http.Transport object can't allow the
connection to be hijacked. Reorganize the TLS and connection wrapper
methods so that a sophisticated client can do:

    cfg := &client.Config{...} // from somewhere
    tlsConfig, _ := client.TLSConfigFor(cfg)
    _ := conn.Dial(...)
    rt := MyRoundTripper() // some func that implements grabbing requests
    wrapper, _ := client.HTTPWrappersFor(cfg)
    req := &http.Request{}
    req.Header.Set("Connection-Upgrade", ...)
    _, := wrapper.RoundTrip(req)
    // rt has been invoked with a fully formed Req with auth
    rt.Req.Write(conn)
    // read response for upgrade

It would be good to have utility function that does more of this,
but mostly enabling the HTTP2/SPDY client exec function right now.
2015-01-29 17:43:09 -05:00
Jordan Liggitt
1ebe885827 Allow client and kubelet configs to hold cert/key/ca data directly 2015-01-16 12:18:20 -05:00
Jordan Liggitt
1f8a74626f Use CAFile even if client certificate is not specified 2015-01-12 16:38:48 -05:00
deads2k
005f2e1bda don't require config.Version for IsConfigTransportTLS 2015-01-08 13:53:57 -05:00
deads2k
480635bb72 Revert "Revert "add kubeconfig types""
This reverts commit 02dbad7094.
2015-01-08 09:42:30 -05:00
Clayton Coleman
b03fbf90f8 Make RESTClient more generic to API version, simplify version handling
RESTClient is an abstraction on top of arbitrary HTTP endpoints that
follow the Kubernetes API conventions. Refactored RESTClientFor so that
assumptions that are Kube specific happen outside of that method (so
others can reuse the RESTClient). Added more validation to client.New
to ensure clients give good input. Exposed APIVersion on RESTClient
as a method so that wrapper code (code that adds typed / structured
methods over rest endpoints like client.Client) can more easily make
decisions about what APIVersion it is running under.
2015-01-07 18:03:34 -05:00
Brendan Burns
02dbad7094 Revert "add kubeconfig types" 2015-01-07 12:39:37 -08:00
deads2k
0e688dc271 add kubeconfig file 2015-01-07 13:09:10 -05:00
derekwaynecarr
abb6632d75 Do not use namespace in url paths pre v1beta3 from client 2014-12-19 16:32:42 -05:00
Clayton Coleman
d1d7505272 Rename client Minions->Nodes, select the correct path for v1beta3
Replaces the client public interface but leaves old references to "minions"
for a later refactor.  Selects the path "nodes" for v1beta3 and "minions"
for older versions.
2014-12-10 12:08:19 -05:00
Eric Tune
5c24855349 Rename Secure -> TLS; we may use TLS insecurely. 2014-11-13 21:42:36 -08:00
Eric Tune
dd3c85be09 Use https when Insecure is selected. 2014-11-13 17:25:31 -08:00
Haney Maxwell
3160500940 Refactor kubelet access and add SSL 2014-10-22 14:53:59 -07:00
Clayton Coleman
756f4afb2c Allow Client to define arbitrary (non-default) prefix in config 2014-10-02 23:30:27 -04:00
derekwaynecarr
fc67d822c6 Add context as parameter to client interface functions 2014-10-02 12:51:36 -04:00
Clayton Coleman
ff2eca97d9 Refactor the client (again) to better support auth
* Allows consumers to provide their own transports for common cases.
* Supports KUBE_API_VERSION on test cases for controlling which
  api version they test against
* Provides a common flag registration method for CLIs that need
  to connect to an API server (to avoid duplicating flags)
* Ensures errors are properly returned by the server
* Add a Context field to client.Config
2014-10-01 15:23:37 -04:00