Documentation ¶
Overview ¶
Code generated for package k8s by go-bindata DO NOT EDIT. (@generated) sources: resources/config-map.template resources/crd-cluster.json resources/crd-node.json resources/crd-resource.json resources/crd.template resources/generic.template resources/headless-service.template resources/kind-cluster.template resources/kind-resource.template resources/pod.template resources/srv-cluster-role-binding.json resources/srv-cluster-role.json resources/srv-deployment.json.template resources/srv-service-account.json
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func GetDefaultKubeConfigPath() (string, error)
- func InCluster() bool
- func MarshalCRD(c *Crd) ([]byte, error)
- func MarshalPod(p *Pod) ([]byte, error)
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func RunTmpl(tmpl string, obj interface{}) ([]byte, error)
- func RunTmpl2(name string, obj interface{}) ([]byte, error)
- type Config
- type Crd
- type Item
- type KubeClient
- func (c *KubeClient) Delete(path string, obj []byte) ([]byte, error)
- func (c *KubeClient) Exec(pod, container string, path string, cmdArgs ...string) ([]byte, error)
- func (c *KubeClient) Get(path string) ([]byte, error)
- func (c *KubeClient) HTTPReq(method string, path string, obj []byte) ([]byte, error)
- func (c *KubeClient) HTTPReqWithResponse(method string, path string, obj []byte) (*http.Response, error)
- func (c *KubeClient) List(path string, opts *ListOpts) (*ListResponse, error)
- func (c *KubeClient) Post(path string, obj []byte) ([]byte, error)
- func (c *KubeClient) Put(path string, obj []byte) ([]byte, error)
- func (c *KubeClient) Track(ctx context.Context, path string) (chan *Item, chan struct{})
- type KubeConfig
- type ListMetadata
- type ListOpts
- type ListResponse
- type Metadata
- type Pod
- type Provider
- func (p *Provider) CreateResource(node *proto.Node) (*proto.Node, error)
- func (p *Provider) DeleteResource(node *proto.Node) (*proto.Node, error)
- func (p *Provider) Exec(handler string, path string, cmdArgs ...string) error
- func (p *Provider) FinalizeTask(uuid string) error
- func (p *Provider) GetTask() (*proto.Task, error)
- func (p *Provider) LoadCluster(name string) (*proto.Cluster, error)
- func (p *Provider) Setup() error
- func (p *Provider) Start() error
- func (p *Provider) Stop()
- func (p *Provider) UpdateNodeStatus(node *proto.Node) (*proto.Node, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func GetDefaultKubeConfigPath ¶
GetDefaultKubeConfigPath returns the default location for the kube path
func InCluster ¶
func InCluster() bool
InCluster returns whether we are running inside a Kubernetes pod
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Config ¶
Config is the configuration for KubeClient
func InClusterConfig ¶
InClusterConfig returns the auth from inside the pod
type Crd ¶
type Crd struct { Kind string Singular string Plural string Group string Schema *schema.Schema SpecStr string }
Crd is a k8s custom resource definition
type KubeClient ¶
type KubeClient struct {
// contains filtered or unexported fields
}
KubeClient is a kubernetes client
func NewKubeClient ¶
func NewKubeClient(config *Config) *KubeClient
NewKubeClient creates a new KubeClient
func (*KubeClient) HTTPReqWithResponse ¶
func (c *KubeClient) HTTPReqWithResponse(method string, path string, obj []byte) (*http.Response, error)
HTTPReqWithResponse is a generic method to make http requests that returns the response object
func (*KubeClient) List ¶
func (c *KubeClient) List(path string, opts *ListOpts) (*ListResponse, error)
type KubeConfig ¶
KubeConfig is the kubeconfig to connect with the K8s apiserver
func NewKubeConfig ¶
func NewKubeConfig(path string, context string) (*KubeConfig, error)
NewKubeConfig loads the kube config from a given path
func (*KubeConfig) GetTLSConfig ¶
func (k *KubeConfig) GetTLSConfig() (*tls.Config, error)
GetTLSConfig returns the tls.Config for this kubeconfig
func (*KubeConfig) ToConfig ¶
func (k *KubeConfig) ToConfig() (*Config, error)
type ListMetadata ¶
type ListResponse ¶
type ListResponse struct { Items []*Item Metadata ListMetadata }
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is a Provider implementation for kubernetes.
func K8sFactory ¶
func (*Provider) CreateResource ¶
CreateResource implements the Provider interface
func (*Provider) DeleteResource ¶
DeleteResource implements the Provider interface
func (*Provider) FinalizeTask ¶
FinalizeTask implements the Provider interface
func (*Provider) LoadCluster ¶
LoadCluster implements the Provider interface