Documentation ¶
Overview ¶
Package k8s generated by go-bindata.// sources: resources/config-map.template resources/crd-cluster.json resources/crd-resource.json resources/crd.template resources/generic.template resources/headless-service.template resources/kind-cluster.template resources/kind-resource.template resources/mock-crd.template resources/mock.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 resources/volume-claim.template
Index ¶
- Constants
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func DecodeClusterSpec(item *Item) (*any.Any, error)
- func DecodeItem(item *Item) (*any.Any, error)
- func DecodeResourceSpec(item *Item) (*any.Any, error)
- func GetDefaultKubeConfigPath() (string, error)
- func InCluster() bool
- func MarshalPod(i *proto.Instance) ([]byte, error)
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func RunTmpl2(name string, obj interface{}) ([]byte, error)
- type APIGroup
- type APIGroupList
- type APIResource
- type APIResourceList
- type Config
- type Event
- type EventRegarding
- 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) GetFull(url string, out interface{}) ([]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) Post(path string, obj []byte) ([]byte, error)
- func (c *KubeClient) Put(path string, obj []byte) ([]byte, error)
- func (c *KubeClient) Watch(path string) (*http.Response, error)
- type KubeConfig
- type Metadata
- type PodItem
- type Provider
- func (p *Provider) Exec(handler string, path string, cmdArgs ...string) (string, error)
- func (p *Provider) Name() string
- func (p *Provider) Resources() operator.ProviderResources
- func (p *Provider) Setup(cplane operator.ControlPlane) error
- func (p *Provider) Start() error
- func (p *Provider) Stop() error
- type WatchEntry
- type WatchEvent
- type Watcher
Constants ¶
const ( PodPhasePending = "Pending" PodPhaseRunning = "Running" PodPhaseFailed = "Failed" PodPhaseSucceeded = "Succeeded" )
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("nonexistent") 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 APIGroupList ¶ added in v0.1.3
type APIGroupList struct {
Groups []*APIGroup
}
type APIResource ¶ added in v0.1.3
type APIResource struct {
Name string
}
type APIResourceList ¶ added in v0.1.3
type APIResourceList struct {
Resources []*APIResource
}
type Config ¶
Config is the configuration for KubeClient
func InClusterConfig ¶
InClusterConfig returns the auth from inside the pod
type Event ¶ added in v0.1.3
type Event struct { Metadata *Metadata Reason string Regarding *EventRegarding Note string Type string }
func (*Event) GetMetadata ¶ added in v0.1.3
type EventRegarding ¶ added in v0.1.3
type EventRegarding struct {
Kind string
}
type Item ¶
type Item struct { Metadata *Metadata Kind string Spec map[string]interface{} Data map[string]interface{} }
func (*Item) ResourceVersion ¶ added in v0.1.3
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) GetFull ¶ added in v0.1.3
func (c *KubeClient) GetFull(url string, out interface{}) ([]byte, error)
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
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 PodItem ¶ added in v0.1.3
type PodItem struct { Metadata *Metadata Status struct { Phase string PodIP string Conditions []struct { Type string Status string } ContainerStatuses []struct { State struct { Terminated struct { ExitCode int Reason string Message string } Waiting struct { Reason string } Running struct { StartedAt string } } } } }
func (*PodItem) ExitResult ¶ added in v0.1.3
func (p *PodItem) ExitResult() (*proto.Instance_ExitResult, error)
func (*PodItem) ResourceVersion ¶ added in v0.1.3
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is a Provider implementation for kubernetes.
func K8sFactory ¶
func (*Provider) Resources ¶ added in v0.1.3
func (p *Provider) Resources() operator.ProviderResources
type WatchEntry ¶ added in v0.1.3
type WatchEntry struct {
// contains filtered or unexported fields
}
type WatchEvent ¶ added in v0.1.1
type Watcher ¶ added in v0.1.1
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶ added in v0.1.3
func NewWatcher(logger hclog.Logger, client *KubeClient, path string, obj itemObj) (*Watcher, error)
func (*Watcher) ForEach ¶ added in v0.1.3
func (w *Watcher) ForEach(handler func(task *WatchEntry, i interface{}))