kubelet

package
v3.0.1-beta3+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	URL string `yaml:"url"`
	// Can be `none` for no auth, `tls` for TLS client cert auth, or
	// `serviceAccount` to use the pod's default service account token to
	// authenticate.
	AuthType AuthType `yaml:"authType" default:"none"`
	// Whether to skip verification of the Kubelet's TLS cert
	SkipVerify bool `yaml:"skipVerify" default:"false"`
	// Path to the CA cert that has signed the Kubelet's TLS cert, unnecessary
	// if `skipVerify` is set to false.
	CACertPath string `yaml:"caCertPath"`
	// Path to the client TLS cert to use if `authType` is set to `tls`
	ClientCertPath string `yaml:"clientCertPath"`
	// Path to the client TLS key to use if `authType` is set to `tls`
	ClientKeyPath string `yaml:"clientKeyPath"`
}

APIConfig contains config specific to the KubeletAPI

type AuthType

type AuthType string

AuthType to use when connecting to kubelet

const (
	// AuthTypeNone means there is no authentication to kubelet
	AuthTypeNone AuthType = "none"
	// AuthTypeTLS indicates that client TLS auth is desired
	AuthTypeTLS AuthType = "tls"
	// AuthTypeServiceAccount indicates that the default service account token should be used
	AuthTypeServiceAccount AuthType = "serviceAccount"
)

type Client

type Client struct {
	*http.Client
	// contains filtered or unexported fields
}

Client is a wrapper around http.Client that injects the right auth to every request.

func NewClient

func NewClient(kubeletAPI *APIConfig) (*Client, error)

NewClient creates a new client with the given config

func (*Client) NewRequest

func (kc *Client) NewRequest(method, path string, body io.Reader) (*http.Request, error)

NewRequest is used to provide a base URL to which paths can be appended. Other than the second argument it is identical to the http.NewRequest method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL