Documentation
¶
Index ¶
- func BuildRESTConfig(context, kubeconfig string) (*rest.Config, error)
- type Client
- func (c *Client) Apply(name string, content []byte) error
- func (c *Client) ApplyFile(filename string) error
- func (c *Client) ApplyNamespace(namespace string) error
- func (c *Client) ApplyResource(r *resource.Result) error
- func (c *Client) Builder() *resource.Builder
- func (c *Client) ClientSet() error
- func (c *Client) Create(name string, content []byte) error
- func (c *Client) CreateFile(filename string) error
- func (c *Client) CreateNamespace(namespace string) error
- func (c *Client) ExistsResource(r *resource.Result) (bool, error)
- func (c *Client) ListConfigMaps(namespace string) (*corev1.ConfigMapList, error)
- func (c *Client) ListDaemonSets(namespace string) (*appsv1.DaemonSetList, error)
- func (c *Client) ListDeployments(namespace string) (*appsv1.DeploymentList, error)
- func (c *Client) ListEndpoints(namespace string) (*corev1.EndpointsList, error)
- func (c *Client) ListJobs(namespace string) (*batchv1.JobList, error)
- func (c *Client) ListNamespaces() (*corev1.NamespaceList, error)
- func (c *Client) ListNodes() (*corev1.NodeList, error)
- func (c *Client) ListPersistentVolumeClaims(namespace string) (*corev1.PersistentVolumeClaimList, error)
- func (c *Client) ListPersistentVolumes() (*corev1.PersistentVolumeList, error)
- func (c *Client) ListPods(namespace string) (*corev1.PodList, error)
- func (c *Client) ListReplicaSets(namespace string) (*appsv1.ReplicaSetList, error)
- func (c *Client) ListReplicationControllers(namespace string) (*corev1.ReplicationControllerList, error)
- func (c *Client) ListSecrets(namespace string) (*corev1.SecretList, error)
- func (c *Client) ListServiceAccounts(namespace string) (*corev1.ServiceAccountList, error)
- func (c *Client) ListServices(namespace string) (*corev1.ServiceList, error)
- func (c *Client) ListStatefulSets(namespace string) (*appsv1.StatefulSetList, error)
- func (c *Client) Namespace(namespace string) (*v1.Namespace, error)
- func (c *Client) NodesReady() (int, int, error)
- func (c *Client) ResultForContent(name string, content []byte, unstructured bool) *resource.Result
- func (c *Client) ResultForFilenameParam(filenames []string, unstructured bool) *resource.Result
- func (c *Client) ResultForReader(name string, r io.Reader, unstructured bool) *resource.Result
- func (c *Client) UnstructuredBuilder() *resource.Builder
- func (c *Client) Update(name string, content []byte) error
- func (c *Client) UpdateFile(filename string) error
- type Config
- func (c *Config) ClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
- func (c *Config) DynamicClient() (dynamic.Interface, error)
- func (c *Config) KubernetesClientSet() (*kubernetes.Clientset, error)
- func (c *Config) NewBuilder() *resource.Builder
- func (c *Config) RESTClient() (*rest.RESTClient, error)
- func (c *Config) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
- func (c *Config) ToRESTConfig() (*rest.Config, error)
- func (c *Config) ToRESTMapper() (meta.RESTMapper, error)
- func (c *Config) ToRawKubeConfigLoader() clientcmd.ClientConfig
- func (c *Config) UnstructuredClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Config *Config // contains filtered or unexported fields }
Client is a kubernetes client, like `kubectl`
func NewClientE ¶
NewClientE creates a kubernetes client, returns an error if fail
func (*Client) ApplyNamespace ¶
ApplyNamespace creates the given namespace if does not exists
func (*Client) ApplyResource ¶
ApplyResource creates a resource with the resource.Result
func (*Client) CreateFile ¶
CreateFile creates a resource in the given local filename or HTTP URL
func (*Client) CreateNamespace ¶
CreateNamespace creates a namespace with the given name
func (*Client) ExistsResource ¶
ExistsResource returns true if the resources are found, otherwise returns false and no error. If failed to get the resources, it returns false and the error.
func (*Client) ListConfigMaps ¶
func (c *Client) ListConfigMaps(namespace string) (*corev1.ConfigMapList, error)
ListConfigMaps returns a list of configmaps for a namespace, set to empty string to get from all
func (*Client) ListDaemonSets ¶
func (c *Client) ListDaemonSets(namespace string) (*appsv1.DaemonSetList, error)
ListDaemonSets returns a list of daemonsets for a namespace, set to empty string to get from all
func (*Client) ListDeployments ¶
func (c *Client) ListDeployments(namespace string) (*appsv1.DeploymentList, error)
ListDeployments returns a list of deployments for a namespace, set to empty string to get from all
func (*Client) ListEndpoints ¶
func (c *Client) ListEndpoints(namespace string) (*corev1.EndpointsList, error)
ListEndpoints returns a list of endpoints for a namespace, set to empty string to get from all
func (*Client) ListJobs ¶
ListJobs returns a list of jobs for a namespace, set to empty string to get from all
func (*Client) ListNamespaces ¶
func (c *Client) ListNamespaces() (*corev1.NamespaceList, error)
ListNamespaces returns a list of namespaces
func (*Client) ListPersistentVolumeClaims ¶
func (c *Client) ListPersistentVolumeClaims(namespace string) (*corev1.PersistentVolumeClaimList, error)
ListPersistentVolumeClaims returns a list of persistent volume claims for a namespace, set to empty string to get from all
func (*Client) ListPersistentVolumes ¶
func (c *Client) ListPersistentVolumes() (*corev1.PersistentVolumeList, error)
ListPersistentVolumes returns a list of persistent volumes
func (*Client) ListPods ¶
ListPods returns a list of pods for a namespace, set to empty string to get from all
func (*Client) ListReplicaSets ¶
func (c *Client) ListReplicaSets(namespace string) (*appsv1.ReplicaSetList, error)
ListReplicaSets returns a list of deployments for a namespace, set to empty string to get from all
func (*Client) ListReplicationControllers ¶
func (c *Client) ListReplicationControllers(namespace string) (*corev1.ReplicationControllerList, error)
ListReplicationControllers returns a list of replication controllers for a namespace, set to empty string to get from all
func (*Client) ListSecrets ¶
func (c *Client) ListSecrets(namespace string) (*corev1.SecretList, error)
ListSecrets returns a list of secrets for a namespace, set to empty string to get from all
func (*Client) ListServiceAccounts ¶
func (c *Client) ListServiceAccounts(namespace string) (*corev1.ServiceAccountList, error)
ListServiceAccounts returns a list of service accounts for a namespace, set to empty string to get from all
func (*Client) ListServices ¶
func (c *Client) ListServices(namespace string) (*corev1.ServiceList, error)
ListServices returns a list of services for a namespace, set to empty string to get from all
func (*Client) ListStatefulSets ¶
func (c *Client) ListStatefulSets(namespace string) (*appsv1.StatefulSetList, error)
ListStatefulSets returns a list of statefulsets for a namespace, set to empty string to get from all
func (*Client) Namespace ¶
Namespace returns the namespace with the given name. If not found returns a IsNotFound error
func (*Client) NodesReady ¶
NodesReady returns the number of nodes ready
func (*Client) ResultForContent ¶
ResultForContent returns the builder results for the given content
func (*Client) ResultForFilenameParam ¶
ResultForFilenameParam returns the builder results for the given list of files or URLs
func (*Client) ResultForReader ¶
ResultForReader returns the builder results for the given reader
func (*Client) UnstructuredBuilder ¶
UnstructuredBuilder creates an unstructure builder for the given namespace
func (*Client) UpdateFile ¶
UpdateFile creates a resource in the given local filename or HTTP URL
type Config ¶
Config is the client configuration. It implements RESTClientGetter
func (*Config) ClientForMapping ¶
func (c *Config) ClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
ClientForMapping creates a resource REST client from the given mappings
func (*Config) DynamicClient ¶
DynamicClient creates a dynamic client from the configuration
func (*Config) KubernetesClientSet ¶
func (c *Config) KubernetesClientSet() (*kubernetes.Clientset, error)
KubernetesClientSet creates a kubernetes clientset from the configuration
func (*Config) NewBuilder ¶
NewBuilder returns a new resource builder for structured api objects.
func (*Config) RESTClient ¶
func (c *Config) RESTClient() (*rest.RESTClient, error)
RESTClient creates a REST client from the configuration
func (*Config) ToDiscoveryClient ¶
func (c *Config) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
ToDiscoveryClient returns a CachedDiscoveryInterface using a computed RESTConfig
func (*Config) ToRESTConfig ¶
ToRESTConfig creates a kubernetes REST client config
func (*Config) ToRESTMapper ¶
func (c *Config) ToRESTMapper() (meta.RESTMapper, error)
ToRESTMapper returns a mapper
func (*Config) ToRawKubeConfigLoader ¶
func (c *Config) ToRawKubeConfigLoader() clientcmd.ClientConfig
ToRawKubeConfigLoader creates a client config using the following rules: 1. builds from the given kubeconfig path, if not empty 2. use the in cluster config if running in-cluster 3. gets the config from KUBECONFIG env var 4. Uses $HOME/.kube/config
func (*Config) UnstructuredClientForMapping ¶
func (c *Config) UnstructuredClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
UnstructuredClientForMapping creates a unstructured resource REST client from the given mappings