Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateApiserverClient ¶
func CreateApiserverClient(apiserverHost string, kubeConfig string) (*client.Clientset, clientcmd.ClientConfig, error)
CreateApiserverClient creates new Kubernetes Apiserver client. When kubeconfig or apiserverHost param is empty the function assumes that it is running inside a Kubernetes cluster and attempts to discover the Apiserver. Otherwise, it connects to the Apiserver specified.
apiserverHost param is in the format of protocol://address:port/pathPrefix, e.g.http://localhost:8001. kubeConfig location of kubeconfig file
Types ¶
type HeapsterClient ¶
type HeapsterClient interface { // Creates a new GET HTTP request to heapster, specified by the path param, to the V1 API // endpoint. The path param is without the API prefix, e.g., // /model/namespaces/default/pod-list/foo/metrics/memory-usage Get(path string) RequestInterface }
HeapsterClient is a client used to make requests to a Heapster instance.
func CreateHeapsterRESTClient ¶
func CreateHeapsterRESTClient(heapsterHost string, apiclient *client.Clientset) ( HeapsterClient, error)
CreateHeapsterRESTClient creates new Heapster REST client. When heapsterHost param is empty string the function assumes that it is running inside a Kubernetes cluster and connects via service proxy. heapsterHost param is in the format of protocol://address:port, e.g., http://localhost:8002.
type InClusterHeapsterClient ¶
type InClusterHeapsterClient struct {
// contains filtered or unexported fields
}
InClusterHeapsterClient is an in-cluster implementation of a Heapster client. Talks with Heapster through service proxy.
func (InClusterHeapsterClient) Get ¶
func (c InClusterHeapsterClient) Get(path string) RequestInterface
Get creates request to given path.
type RemoteHeapsterClient ¶
type RemoteHeapsterClient struct {
// contains filtered or unexported fields
}
RemoteHeapsterClient is an implementation of a remote Heapster client. Talks with Heapster through raw RESTClient.
func (RemoteHeapsterClient) Get ¶
func (c RemoteHeapsterClient) Get(path string) RequestInterface
Get creates request to given path.
type RequestInterface ¶
RequestInterface is an interface that allows to make operations on pure request object. Separation is done to allow testing.