Documentation ¶
Index ¶
- Constants
- Variables
- func ToMB(v int64) float64
- type APIClient
- func (a *APIClient) CanIAccess(ns, resURL string, verbs []string) (bool, error)
- func (a *APIClient) CheckListNSAccess() error
- func (a *APIClient) CheckNSAccess(n string) error
- func (a *APIClient) Config() *Config
- func (a *APIClient) CurrentNamespaceName() (string, error)
- func (a *APIClient) DialOrDie() kubernetes.Interface
- func (a *APIClient) DynDialOrDie() dynamic.Interface
- func (a *APIClient) FetchNodes() (*v1.NodeList, error)
- func (a *APIClient) HasMetrics() bool
- func (a *APIClient) IsNamespaced(res string) bool
- func (a *APIClient) MXDial() (*versioned.Clientset, error)
- func (a *APIClient) NSDialOrDie() dynamic.NamespaceableResourceInterface
- func (a *APIClient) NodePods(node string) (*v1.PodList, error)
- func (a *APIClient) RestConfigOrDie() *restclient.Config
- func (a *APIClient) ServerVersion() (*version.Info, error)
- func (a *APIClient) SupportsRes(group string, versions []string) (string, bool, error)
- func (a *APIClient) SupportsResource(group string) bool
- func (a *APIClient) SwitchContextOrDie(ctx string)
- func (a *APIClient) ValidNamespaces() ([]v1.Namespace, error)
- type APIGroup
- type Cluster
- type ClusterMetrics
- type ClusterRole
- func (c *ClusterRole) Delete(_, n string, cascade, force bool) error
- func (c *ClusterRole) Get(_, n string) (interface{}, error)
- func (b ClusterRole) GetFieldSelector() string
- func (b ClusterRole) GetLabelSelector() string
- func (b ClusterRole) HasSelectors() bool
- func (b ClusterRole) Kill(ns, n string) error
- func (c *ClusterRole) List(_ string) (Collection, error)
- func (b ClusterRole) SetFieldSelector(s string)
- func (b ClusterRole) SetLabelSelector(s string)
- type ClusterRoleBinding
- func (c *ClusterRoleBinding) Delete(_, n string, cascade, force bool) error
- func (c *ClusterRoleBinding) Get(_, n string) (interface{}, error)
- func (b ClusterRoleBinding) GetFieldSelector() string
- func (b ClusterRoleBinding) GetLabelSelector() string
- func (b ClusterRoleBinding) HasSelectors() bool
- func (b ClusterRoleBinding) Kill(ns, n string) error
- func (c *ClusterRoleBinding) List(_ string) (Collection, error)
- func (b ClusterRoleBinding) SetFieldSelector(s string)
- func (b ClusterRoleBinding) SetLabelSelector(s string)
- type Collection
- type Config
- func (c *Config) ClusterNameFromContext(ctx string) (string, error)
- func (c *Config) ClusterNames() ([]string, error)
- func (c *Config) ConfigAccess() (clientcmd.ConfigAccess, error)
- func (c *Config) ContextNames() ([]string, error)
- func (c *Config) Contexts() (map[string]*clientcmdapi.Context, error)
- func (c *Config) CurrentClusterName() (string, error)
- func (c *Config) CurrentContextName() (string, error)
- func (c *Config) CurrentGroupNames() ([]string, error)
- func (c *Config) CurrentNamespaceName() (string, error)
- func (c *Config) CurrentUserName() (string, error)
- func (c *Config) DelContext(n string) error
- func (c *Config) Flags() *genericclioptions.ConfigFlags
- func (c *Config) GetContext(n string) (*clientcmdapi.Context, error)
- func (c *Config) NamespaceNames(nns []v1.Namespace) []string
- func (c *Config) RESTConfig() (*restclient.Config, error)
- func (c *Config) RawConfig() (clientcmdapi.Config, error)
- func (c *Config) SwitchContext(name string) error
- type ConfigMap
- func (c *ConfigMap) Delete(ns, n string, cascade, force bool) error
- func (c *ConfigMap) Get(ns, n string) (interface{}, error)
- func (b ConfigMap) GetFieldSelector() string
- func (b ConfigMap) GetLabelSelector() string
- func (b ConfigMap) HasSelectors() bool
- func (b ConfigMap) Kill(ns, n string) error
- func (c *ConfigMap) List(ns string) (Collection, error)
- func (b ConfigMap) SetFieldSelector(s string)
- func (b ConfigMap) SetLabelSelector(s string)
- type Connection
- type Context
- func (c *Context) Delete(_, n string, cascade, force bool) error
- func (c *Context) Get(_, n string) (interface{}, error)
- func (b Context) GetFieldSelector() string
- func (b Context) GetLabelSelector() string
- func (b Context) HasSelectors() bool
- func (b Context) Kill(ns, n string) error
- func (c *Context) KubeUpdate(n string) error
- func (c *Context) List(string) (Collection, error)
- func (c *Context) MustCurrentContextName() string
- func (b Context) SetFieldSelector(s string)
- func (b Context) SetLabelSelector(s string)
- func (c *Context) Switch(ctx string) error
- type CronJob
- func (c *CronJob) Delete(ns, n string, cascade, force bool) error
- func (c *CronJob) Get(ns, n string) (interface{}, error)
- func (b CronJob) GetFieldSelector() string
- func (b CronJob) GetLabelSelector() string
- func (b CronJob) HasSelectors() bool
- func (b CronJob) Kill(ns, n string) error
- func (c *CronJob) List(ns string) (Collection, error)
- func (c *CronJob) Run(ns, n string) error
- func (b CronJob) SetFieldSelector(s string)
- func (b CronJob) SetLabelSelector(s string)
- type Cruder
- type CustomResourceDefinition
- func (c *CustomResourceDefinition) Delete(_, n string, cascade, force bool) error
- func (c *CustomResourceDefinition) Get(_, n string) (interface{}, error)
- func (b CustomResourceDefinition) GetFieldSelector() string
- func (b CustomResourceDefinition) GetLabelSelector() string
- func (b CustomResourceDefinition) HasSelectors() bool
- func (b CustomResourceDefinition) Kill(ns, n string) error
- func (c *CustomResourceDefinition) List(string) (Collection, error)
- func (b CustomResourceDefinition) SetFieldSelector(s string)
- func (b CustomResourceDefinition) SetLabelSelector(s string)
- type DaemonSet
- func (d *DaemonSet) Delete(ns, n string, cascade, force bool) error
- func (d *DaemonSet) Get(ns, n string) (interface{}, error)
- func (b DaemonSet) GetFieldSelector() string
- func (b DaemonSet) GetLabelSelector() string
- func (b DaemonSet) HasSelectors() bool
- func (b DaemonSet) Kill(ns, n string) error
- func (d *DaemonSet) List(ns string) (Collection, error)
- func (b DaemonSet) SetFieldSelector(s string)
- func (b DaemonSet) SetLabelSelector(s string)
- type Deployment
- func (d *Deployment) Delete(ns, n string, cascade, force bool) error
- func (d *Deployment) Get(ns, n string) (interface{}, error)
- func (b Deployment) GetFieldSelector() string
- func (b Deployment) GetLabelSelector() string
- func (b Deployment) HasSelectors() bool
- func (b Deployment) Kill(ns, n string) error
- func (d *Deployment) List(ns string) (Collection, error)
- func (d *Deployment) Scale(ns, n string, replicas int32) error
- func (b Deployment) SetFieldSelector(s string)
- func (b Deployment) SetLabelSelector(s string)
- type Endpoints
- func (e *Endpoints) Delete(ns, n string, cascade, force bool) error
- func (e *Endpoints) Get(ns, n string) (interface{}, error)
- func (b Endpoints) GetFieldSelector() string
- func (b Endpoints) GetLabelSelector() string
- func (b Endpoints) HasSelectors() bool
- func (b Endpoints) Kill(ns, n string) error
- func (e *Endpoints) List(ns string) (Collection, error)
- func (b Endpoints) SetFieldSelector(s string)
- func (b Endpoints) SetLabelSelector(s string)
- type Event
- func (e *Event) Delete(ns, n string, cascade, force bool) error
- func (e *Event) Get(ns, n string) (interface{}, error)
- func (b Event) GetFieldSelector() string
- func (b Event) GetLabelSelector() string
- func (b Event) HasSelectors() bool
- func (b Event) Kill(ns, n string) error
- func (e *Event) List(ns string) (Collection, error)
- func (b Event) SetFieldSelector(s string)
- func (b Event) SetLabelSelector(s string)
- type GKV
- type HorizontalPodAutoscalerV1
- func (h *HorizontalPodAutoscalerV1) Delete(ns, n string, cascade, force bool) error
- func (h *HorizontalPodAutoscalerV1) Get(ns, n string) (interface{}, error)
- func (b HorizontalPodAutoscalerV1) GetFieldSelector() string
- func (b HorizontalPodAutoscalerV1) GetLabelSelector() string
- func (b HorizontalPodAutoscalerV1) HasSelectors() bool
- func (b HorizontalPodAutoscalerV1) Kill(ns, n string) error
- func (h *HorizontalPodAutoscalerV1) List(ns string) (Collection, error)
- func (b HorizontalPodAutoscalerV1) SetFieldSelector(s string)
- func (b HorizontalPodAutoscalerV1) SetLabelSelector(s string)
- type HorizontalPodAutoscalerV2Beta1
- func (h *HorizontalPodAutoscalerV2Beta1) Delete(ns, n string, cascade, force bool) error
- func (h *HorizontalPodAutoscalerV2Beta1) Get(ns, n string) (interface{}, error)
- func (b HorizontalPodAutoscalerV2Beta1) GetFieldSelector() string
- func (b HorizontalPodAutoscalerV2Beta1) GetLabelSelector() string
- func (b HorizontalPodAutoscalerV2Beta1) HasSelectors() bool
- func (b HorizontalPodAutoscalerV2Beta1) Kill(ns, n string) error
- func (h *HorizontalPodAutoscalerV2Beta1) List(ns string) (Collection, error)
- func (b HorizontalPodAutoscalerV2Beta1) SetFieldSelector(s string)
- func (b HorizontalPodAutoscalerV2Beta1) SetLabelSelector(s string)
- type HorizontalPodAutoscalerV2Beta2
- func (h *HorizontalPodAutoscalerV2Beta2) Delete(ns, n string, cascade, force bool) error
- func (h *HorizontalPodAutoscalerV2Beta2) Get(ns, n string) (interface{}, error)
- func (b HorizontalPodAutoscalerV2Beta2) GetFieldSelector() string
- func (b HorizontalPodAutoscalerV2Beta2) GetLabelSelector() string
- func (b HorizontalPodAutoscalerV2Beta2) HasSelectors() bool
- func (b HorizontalPodAutoscalerV2Beta2) Kill(ns, n string) error
- func (h *HorizontalPodAutoscalerV2Beta2) List(ns string) (Collection, error)
- func (b HorizontalPodAutoscalerV2Beta2) SetFieldSelector(s string)
- func (b HorizontalPodAutoscalerV2Beta2) SetLabelSelector(s string)
- type Ingress
- func (i *Ingress) Delete(ns, n string, cascade, force bool) error
- func (i *Ingress) Get(ns, n string) (interface{}, error)
- func (b Ingress) GetFieldSelector() string
- func (b Ingress) GetLabelSelector() string
- func (b Ingress) HasSelectors() bool
- func (b Ingress) Kill(ns, n string) error
- func (i *Ingress) List(ns string) (Collection, error)
- func (b Ingress) SetFieldSelector(s string)
- func (b Ingress) SetLabelSelector(s string)
- type Job
- func (j *Job) Containers(ns, n string, includeInit bool) ([]string, error)
- func (j *Job) Delete(ns, n string, cascade, force bool) error
- func (j *Job) Events(ns, n string) (*v1.EventList, error)
- func (j *Job) Get(ns, n string) (interface{}, error)
- func (b Job) GetFieldSelector() string
- func (b Job) GetLabelSelector() string
- func (b Job) HasSelectors() bool
- func (b Job) Kill(ns, n string) error
- func (j *Job) List(ns string) (Collection, error)
- func (j *Job) Logs(ns, n string, opts *v1.PodLogOptions) *restclient.Request
- func (b Job) SetFieldSelector(s string)
- func (b Job) SetLabelSelector(s string)
- type Loggable
- type MetricsServer
- func (m *MetricsServer) ClusterLoad(nos Collection, nmx Collection, mx *ClusterMetrics)
- func (m *MetricsServer) FetchNodesMetrics() (*mv1beta1.NodeMetricsList, error)
- func (m *MetricsServer) FetchPodsMetrics(ns string) (*mv1beta1.PodMetricsList, error)
- func (b MetricsServer) GetFieldSelector() string
- func (b MetricsServer) GetLabelSelector() string
- func (b MetricsServer) HasSelectors() bool
- func (b MetricsServer) Kill(ns, n string) error
- func (m *MetricsServer) NodesMetrics(nodes Collection, metrics *mv1beta1.NodeMetricsList, mmx NodesMetrics)
- func (m *MetricsServer) PodsMetrics(pods *mv1beta1.PodMetricsList, mmx PodsMetrics)
- func (b MetricsServer) SetFieldSelector(s string)
- func (b MetricsServer) SetLabelSelector(s string)
- type NamedContext
- type Namespace
- func (n *Namespace) Delete(_, name string, cascade, force bool) error
- func (n *Namespace) Get(_, name string) (interface{}, error)
- func (b Namespace) GetFieldSelector() string
- func (b Namespace) GetLabelSelector() string
- func (b Namespace) HasSelectors() bool
- func (b Namespace) Kill(ns, n string) error
- func (n *Namespace) List(_ string) (Collection, error)
- func (b Namespace) SetFieldSelector(s string)
- func (b Namespace) SetLabelSelector(s string)
- type NetworkPolicy
- func (d *NetworkPolicy) Delete(ns, n string, cascade, force bool) error
- func (d *NetworkPolicy) Get(ns, n string) (interface{}, error)
- func (b NetworkPolicy) GetFieldSelector() string
- func (b NetworkPolicy) GetLabelSelector() string
- func (b NetworkPolicy) HasSelectors() bool
- func (b NetworkPolicy) Kill(ns, n string) error
- func (d *NetworkPolicy) List(ns string) (Collection, error)
- func (b NetworkPolicy) SetFieldSelector(s string)
- func (b NetworkPolicy) SetLabelSelector(s string)
- type Node
- func (n *Node) Delete(_, name string, cascade, force bool) error
- func (n *Node) Get(_, name string) (interface{}, error)
- func (b Node) GetFieldSelector() string
- func (b Node) GetLabelSelector() string
- func (b Node) HasSelectors() bool
- func (b Node) Kill(ns, n string) error
- func (n *Node) List(_ string) (Collection, error)
- func (b Node) SetFieldSelector(s string)
- func (b Node) SetLabelSelector(s string)
- type NodeMetrics
- type NodesMetrics
- type PeristentVolume
- func (p *PeristentVolume) Delete(_, n string, cascade, force bool) error
- func (p *PeristentVolume) Get(_, n string) (interface{}, error)
- func (b PeristentVolume) GetFieldSelector() string
- func (b PeristentVolume) GetLabelSelector() string
- func (b PeristentVolume) HasSelectors() bool
- func (b PeristentVolume) Kill(ns, n string) error
- func (p *PeristentVolume) List(_ string) (Collection, error)
- func (b PeristentVolume) SetFieldSelector(s string)
- func (b PeristentVolume) SetLabelSelector(s string)
- type PersistentVolumeClaim
- func (p *PersistentVolumeClaim) Delete(ns, n string, cascade, force bool) error
- func (p *PersistentVolumeClaim) Get(ns, n string) (interface{}, error)
- func (b PersistentVolumeClaim) GetFieldSelector() string
- func (b PersistentVolumeClaim) GetLabelSelector() string
- func (b PersistentVolumeClaim) HasSelectors() bool
- func (b PersistentVolumeClaim) Kill(ns, n string) error
- func (p *PersistentVolumeClaim) List(ns string) (Collection, error)
- func (b PersistentVolumeClaim) SetFieldSelector(s string)
- func (b PersistentVolumeClaim) SetLabelSelector(s string)
- type Pod
- func (p *Pod) Containers(ns, n string, includeInit bool) ([]string, error)
- func (p *Pod) Delete(ns, n string, cascade, force bool) error
- func (p *Pod) Get(ns, name string) (interface{}, error)
- func (b Pod) GetFieldSelector() string
- func (b Pod) GetLabelSelector() string
- func (b Pod) HasSelectors() bool
- func (b Pod) Kill(ns, n string) error
- func (p *Pod) List(ns string) (Collection, error)
- func (p *Pod) Logs(ns, n string, opts *v1.PodLogOptions) *restclient.Request
- func (b Pod) SetFieldSelector(s string)
- func (b Pod) SetLabelSelector(s string)
- type PodDisruptionBudget
- func (p *PodDisruptionBudget) Delete(ns, n string, cascade, force bool) error
- func (p *PodDisruptionBudget) Get(ns, n string) (interface{}, error)
- func (b PodDisruptionBudget) GetFieldSelector() string
- func (b PodDisruptionBudget) GetLabelSelector() string
- func (b PodDisruptionBudget) HasSelectors() bool
- func (b PodDisruptionBudget) Kill(ns, n string) error
- func (p *PodDisruptionBudget) List(ns string) (Collection, error)
- func (b PodDisruptionBudget) SetFieldSelector(s string)
- func (b PodDisruptionBudget) SetLabelSelector(s string)
- type PodMetrics
- type PodsMetrics
- type PortForward
- func (p *PortForward) Active() bool
- func (p *PortForward) Age() string
- func (p *PortForward) Container() string
- func (p *PortForward) FQN() string
- func (p *PortForward) Path() string
- func (p *PortForward) Ports() []string
- func (p *PortForward) SetActive(b bool)
- func (p *PortForward) Start(path, co string, ports []string) (*portforward.PortForwarder, error)
- func (p *PortForward) Stop()
- type ReplicaSet
- func (r *ReplicaSet) Delete(ns, n string, cascade, force bool) error
- func (r *ReplicaSet) Get(ns, n string) (interface{}, error)
- func (b ReplicaSet) GetFieldSelector() string
- func (b ReplicaSet) GetLabelSelector() string
- func (b ReplicaSet) HasSelectors() bool
- func (b ReplicaSet) Kill(ns, n string) error
- func (r *ReplicaSet) List(ns string) (Collection, error)
- func (b ReplicaSet) SetFieldSelector(s string)
- func (b ReplicaSet) SetLabelSelector(s string)
- type ReplicationController
- func (r *ReplicationController) Delete(ns, n string, cascade, force bool) error
- func (r *ReplicationController) Get(ns, n string) (interface{}, error)
- func (b ReplicationController) GetFieldSelector() string
- func (b ReplicationController) GetLabelSelector() string
- func (b ReplicationController) HasSelectors() bool
- func (b ReplicationController) Kill(ns, n string) error
- func (r *ReplicationController) List(ns string) (Collection, error)
- func (r *ReplicationController) Scale(ns, n string, replicas int32) error
- func (b ReplicationController) SetFieldSelector(s string)
- func (b ReplicationController) SetLabelSelector(s string)
- type Resource
- func (r *Resource) Delete(ns, n string, cascade, force bool) error
- func (r *Resource) Get(ns, n string) (interface{}, error)
- func (b Resource) GetFieldSelector() string
- func (r *Resource) GetInfo() (string, string, string)
- func (b Resource) GetLabelSelector() string
- func (b Resource) HasSelectors() bool
- func (b Resource) Kill(ns, n string) error
- func (r *Resource) List(ns string) (Collection, error)
- func (b Resource) SetFieldSelector(s string)
- func (b Resource) SetLabelSelector(s string)
- type RestMapper
- type Role
- func (r *Role) Delete(ns, n string, cascade, force bool) error
- func (r *Role) Get(ns, n string) (interface{}, error)
- func (b Role) GetFieldSelector() string
- func (b Role) GetLabelSelector() string
- func (b Role) HasSelectors() bool
- func (b Role) Kill(ns, n string) error
- func (r *Role) List(ns string) (Collection, error)
- func (b Role) SetFieldSelector(s string)
- func (b Role) SetLabelSelector(s string)
- type RoleBinding
- func (r *RoleBinding) Delete(ns, n string, cascade, force bool) error
- func (r *RoleBinding) Get(ns, n string) (interface{}, error)
- func (b RoleBinding) GetFieldSelector() string
- func (b RoleBinding) GetLabelSelector() string
- func (b RoleBinding) HasSelectors() bool
- func (b RoleBinding) Kill(ns, n string) error
- func (r *RoleBinding) List(ns string) (Collection, error)
- func (b RoleBinding) SetFieldSelector(s string)
- func (b RoleBinding) SetLabelSelector(s string)
- type Secret
- func (s *Secret) Delete(ns, n string, cascade, force bool) error
- func (s *Secret) Get(ns, n string) (interface{}, error)
- func (b Secret) GetFieldSelector() string
- func (b Secret) GetLabelSelector() string
- func (b Secret) HasSelectors() bool
- func (b Secret) Kill(ns, n string) error
- func (s *Secret) List(ns string) (Collection, error)
- func (b Secret) SetFieldSelector(s string)
- func (b Secret) SetLabelSelector(s string)
- type Service
- func (s *Service) Delete(ns, n string, cascade, force bool) error
- func (s *Service) Get(ns, n string) (interface{}, error)
- func (b Service) GetFieldSelector() string
- func (b Service) GetLabelSelector() string
- func (b Service) HasSelectors() bool
- func (b Service) Kill(ns, n string) error
- func (s *Service) List(ns string) (Collection, error)
- func (b Service) SetFieldSelector(s string)
- func (b Service) SetLabelSelector(s string)
- type ServiceAccount
- func (s *ServiceAccount) Delete(ns, n string, cascade, force bool) error
- func (s *ServiceAccount) Get(ns, n string) (interface{}, error)
- func (b ServiceAccount) GetFieldSelector() string
- func (b ServiceAccount) GetLabelSelector() string
- func (b ServiceAccount) HasSelectors() bool
- func (b ServiceAccount) Kill(ns, n string) error
- func (s *ServiceAccount) List(ns string) (Collection, error)
- func (b ServiceAccount) SetFieldSelector(s string)
- func (b ServiceAccount) SetLabelSelector(s string)
- type StatefulSet
- func (s *StatefulSet) Delete(ns, n string, cascade, force bool) error
- func (s *StatefulSet) Get(ns, n string) (interface{}, error)
- func (b StatefulSet) GetFieldSelector() string
- func (b StatefulSet) GetLabelSelector() string
- func (b StatefulSet) HasSelectors() bool
- func (b StatefulSet) Kill(ns, n string) error
- func (s *StatefulSet) List(ns string) (Collection, error)
- func (s *StatefulSet) Scale(ns, n string, replicas int32) error
- func (b StatefulSet) SetFieldSelector(s string)
- func (b StatefulSet) SetLabelSelector(s string)
Constants ¶
const NA = "n/a"
NA Not available
Variables ¶
var ( // RestMapping holds k8s resource mapping // BOZO!! Has to be a better way... RestMapping = &RestMapper{} )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient represents a Kubernetes api client.
func InitConnectionOrDie ¶
InitConnectionOrDie initialize connection from command line args. Checks for connectivity with the api server.
func (*APIClient) CanIAccess ¶
CanIAccess checks if user has access to a certain resource.
func (*APIClient) CheckListNSAccess ¶
CheckListNSAccess check if current user can list namespaces.
func (*APIClient) CheckNSAccess ¶
CheckNSAccess asserts if user can access a namespace.
func (*APIClient) CurrentNamespaceName ¶
CurrentNamespaceName return namespace name set via either cli arg or cluster config.
func (*APIClient) DialOrDie ¶
func (a *APIClient) DialOrDie() kubernetes.Interface
DialOrDie returns a handle to api server or die.
func (*APIClient) DynDialOrDie ¶
DynDialOrDie returns a handle to a dynamic interface.
func (*APIClient) FetchNodes ¶
FetchNodes returns all available nodes.
func (*APIClient) HasMetrics ¶
HasMetrics returns true if the cluster supports metrics.
func (*APIClient) IsNamespaced ¶
IsNamespaced check on server if given resource is namespaced
func (*APIClient) NSDialOrDie ¶
func (a *APIClient) NSDialOrDie() dynamic.NamespaceableResourceInterface
NSDialOrDie returns a handle to a namespaced resource.
func (*APIClient) RestConfigOrDie ¶
func (a *APIClient) RestConfigOrDie() *restclient.Config
RestConfigOrDie returns a rest api client.
func (*APIClient) ServerVersion ¶
ServerVersion returns the current server version info.
func (*APIClient) SupportsRes ¶
SupportsRes checks latest supported version.
func (*APIClient) SupportsResource ¶
SupportsResource checks for resource supported version against the server.
func (*APIClient) SwitchContextOrDie ¶
SwitchContextOrDie handles kubeconfig context switches.
type Cluster ¶
type Cluster struct { Connection // contains filtered or unexported fields }
Cluster represents a Kubernetes cluster.
func NewCluster ¶
func NewCluster(c Connection, l *zerolog.Logger) *Cluster
NewCluster instantiates a new cluster.
func (*Cluster) ClusterName ¶
ClusterName return the currently active cluster name.
func (*Cluster) ContextName ¶
ContextName returns the currently active context.
type ClusterMetrics ¶
ClusterMetrics summarizes total node metrics as percentages.
type ClusterRole ¶
type ClusterRole struct { Connection // contains filtered or unexported fields }
ClusterRole represents a Kubernetes ClusterRole
func NewClusterRole ¶
func NewClusterRole(c Connection) *ClusterRole
NewClusterRole returns a new ClusterRole.
func (*ClusterRole) Delete ¶
func (c *ClusterRole) Delete(_, n string, cascade, force bool) error
Delete a ClusterRole.
func (*ClusterRole) Get ¶
func (c *ClusterRole) Get(_, n string) (interface{}, error)
Get a cluster role.
func (ClusterRole) GetFieldSelector ¶
func (b ClusterRole) GetFieldSelector() string
GetFieldSelector returns field selector.
func (ClusterRole) GetLabelSelector ¶
func (b ClusterRole) GetLabelSelector() string
GetLabelSelector returns label selector.
func (ClusterRole) HasSelectors ¶
func (b ClusterRole) HasSelectors() bool
func (*ClusterRole) List ¶
func (c *ClusterRole) List(_ string) (Collection, error)
List all ClusterRoles on a cluster.
func (ClusterRole) SetFieldSelector ¶
func (b ClusterRole) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (ClusterRole) SetLabelSelector ¶
func (b ClusterRole) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type ClusterRoleBinding ¶
type ClusterRoleBinding struct { Connection // contains filtered or unexported fields }
ClusterRoleBinding represents a Kubernetes ClusterRoleBinding
func NewClusterRoleBinding ¶
func NewClusterRoleBinding(c Connection) *ClusterRoleBinding
NewClusterRoleBinding returns a new ClusterRoleBinding.
func (*ClusterRoleBinding) Delete ¶
func (c *ClusterRoleBinding) Delete(_, n string, cascade, force bool) error
Delete a ClusterRoleBinding.
func (*ClusterRoleBinding) Get ¶
func (c *ClusterRoleBinding) Get(_, n string) (interface{}, error)
Get a service.
func (ClusterRoleBinding) GetFieldSelector ¶
func (b ClusterRoleBinding) GetFieldSelector() string
GetFieldSelector returns field selector.
func (ClusterRoleBinding) GetLabelSelector ¶
func (b ClusterRoleBinding) GetLabelSelector() string
GetLabelSelector returns label selector.
func (ClusterRoleBinding) HasSelectors ¶
func (b ClusterRoleBinding) HasSelectors() bool
func (*ClusterRoleBinding) List ¶
func (c *ClusterRoleBinding) List(_ string) (Collection, error)
List all ClusterRoleBindings on a cluster.
func (ClusterRoleBinding) SetFieldSelector ¶
func (b ClusterRoleBinding) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (ClusterRoleBinding) SetLabelSelector ¶
func (b ClusterRoleBinding) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config tracks a kubernetes configuration.
func NewConfig ¶
func NewConfig(f *genericclioptions.ConfigFlags) *Config
NewConfig returns a new k8s config or an error if the flags are invalid.
func (*Config) ClusterNameFromContext ¶
ClusterNameFromContext returns the cluster associated with the given context.
func (*Config) ClusterNames ¶
ClusterNames fetch all kubeconfig defined clusters.
func (*Config) ConfigAccess ¶
func (c *Config) ConfigAccess() (clientcmd.ConfigAccess, error)
ConfigAccess return the current kubeconfig api server access configuration.
func (*Config) ContextNames ¶
ContextNames fetch all available contexts.
func (*Config) Contexts ¶
func (c *Config) Contexts() (map[string]*clientcmdapi.Context, error)
Contexts fetch all available contexts.
func (*Config) CurrentClusterName ¶
CurrentClusterName returns the active cluster name.
func (*Config) CurrentContextName ¶
CurrentContextName returns the currently active config context.
func (*Config) CurrentGroupNames ¶
CurrentGroupNames retrieves the active group names.
func (*Config) CurrentNamespaceName ¶
CurrentNamespaceName retrieves the active namespace.
func (*Config) CurrentUserName ¶
CurrentUserName retrieves the active user name.
func (*Config) DelContext ¶
DelContext remove a given context from the configuration.
func (*Config) Flags ¶
func (c *Config) Flags() *genericclioptions.ConfigFlags
Flags returns configuration flags.
func (*Config) GetContext ¶
func (c *Config) GetContext(n string) (*clientcmdapi.Context, error)
GetContext fetch a given context or error if it does not exists.
func (*Config) NamespaceNames ¶
NamespaceNames fetch all available namespaces on current cluster.
func (*Config) RESTConfig ¶
func (c *Config) RESTConfig() (*restclient.Config, error)
RESTConfig fetch the current REST api service connection.
func (*Config) RawConfig ¶
func (c *Config) RawConfig() (clientcmdapi.Config, error)
RawConfig fetch the current kubeconfig with no overrides.
func (*Config) SwitchContext ¶
SwitchContext changes the kubeconfig context to a new cluster.
type ConfigMap ¶
type ConfigMap struct { Connection // contains filtered or unexported fields }
ConfigMap represents a Kubernetes ConfigMap
func NewConfigMap ¶
func NewConfigMap(c Connection) *ConfigMap
NewConfigMap returns a new ConfigMap.
func (ConfigMap) GetFieldSelector ¶
func (b ConfigMap) GetFieldSelector() string
GetFieldSelector returns field selector.
func (ConfigMap) GetLabelSelector ¶
func (b ConfigMap) GetLabelSelector() string
GetLabelSelector returns label selector.
func (ConfigMap) HasSelectors ¶
func (b ConfigMap) HasSelectors() bool
func (*ConfigMap) List ¶
func (c *ConfigMap) List(ns string) (Collection, error)
List all ConfigMaps in a given namespace.
func (ConfigMap) SetFieldSelector ¶
func (b ConfigMap) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (ConfigMap) SetLabelSelector ¶
func (b ConfigMap) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Connection ¶
type Connection interface { Config() *Config DialOrDie() kubernetes.Interface SwitchContextOrDie(ctx string) NSDialOrDie() dynamic.NamespaceableResourceInterface RestConfigOrDie() *restclient.Config MXDial() (*versioned.Clientset, error) DynDialOrDie() dynamic.Interface HasMetrics() bool IsNamespaced(n string) bool SupportsResource(group string) bool ValidNamespaces() ([]v1.Namespace, error) NodePods(node string) (*v1.PodList, error) SupportsRes(grp string, versions []string) (string, bool, error) ServerVersion() (*version.Info, error) FetchNodes() (*v1.NodeList, error) CurrentNamespaceName() (string, error) CheckNSAccess(ns string) error CheckListNSAccess() error CanIAccess(ns, resURL string, verbs []string) (bool, error) }
Connection represents a Kubenetes apiserver connection.
type Context ¶
type Context struct { Connection // contains filtered or unexported fields }
Context represents a Kubernetes Context.
func (Context) GetFieldSelector ¶
func (b Context) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Context) GetLabelSelector ¶
func (b Context) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Context) HasSelectors ¶
func (b Context) HasSelectors() bool
func (*Context) KubeUpdate ¶
KubeUpdate modifies kubeconfig default context.
func (*Context) List ¶
func (c *Context) List(string) (Collection, error)
List all Contexts on the current cluster.
func (*Context) MustCurrentContextName ¶
MustCurrentContextName return the active context name.
func (Context) SetFieldSelector ¶
func (b Context) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Context) SetLabelSelector ¶
func (b Context) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type CronJob ¶
type CronJob struct { Connection // contains filtered or unexported fields }
CronJob represents a Kubernetes CronJob.
func (CronJob) GetFieldSelector ¶
func (b CronJob) GetFieldSelector() string
GetFieldSelector returns field selector.
func (CronJob) GetLabelSelector ¶
func (b CronJob) GetLabelSelector() string
GetLabelSelector returns label selector.
func (CronJob) HasSelectors ¶
func (b CronJob) HasSelectors() bool
func (*CronJob) List ¶
func (c *CronJob) List(ns string) (Collection, error)
List all CronJobs in a given namespace.
func (CronJob) SetFieldSelector ¶
func (b CronJob) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (CronJob) SetLabelSelector ¶
func (b CronJob) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Cruder ¶
type Cruder interface { Get(ns string, name string) (interface{}, error) List(ns string) (Collection, error) Delete(ns string, name string) error SetFieldSelector(string) SetLabelSelector(string) }
Cruder represent a crudable Kubernetes resource.
type CustomResourceDefinition ¶
type CustomResourceDefinition struct { Connection // contains filtered or unexported fields }
CustomResourceDefinition represents a Kubernetes CustomResourceDefinition
func NewCustomResourceDefinition ¶
func NewCustomResourceDefinition(c Connection) *CustomResourceDefinition
NewCustomResourceDefinition returns a new CustomResourceDefinition.
func (*CustomResourceDefinition) Delete ¶
func (c *CustomResourceDefinition) Delete(_, n string, cascade, force bool) error
Delete a CustomResourceDefinition.
func (*CustomResourceDefinition) Get ¶
func (c *CustomResourceDefinition) Get(_, n string) (interface{}, error)
Get a CustomResourceDefinition.
func (CustomResourceDefinition) GetFieldSelector ¶
func (b CustomResourceDefinition) GetFieldSelector() string
GetFieldSelector returns field selector.
func (CustomResourceDefinition) GetLabelSelector ¶
func (b CustomResourceDefinition) GetLabelSelector() string
GetLabelSelector returns label selector.
func (CustomResourceDefinition) HasSelectors ¶
func (b CustomResourceDefinition) HasSelectors() bool
func (*CustomResourceDefinition) List ¶
func (c *CustomResourceDefinition) List(string) (Collection, error)
List all CustomResourceDefinitions in a given namespace.
func (CustomResourceDefinition) SetFieldSelector ¶
func (b CustomResourceDefinition) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (CustomResourceDefinition) SetLabelSelector ¶
func (b CustomResourceDefinition) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type DaemonSet ¶
type DaemonSet struct { Connection // contains filtered or unexported fields }
DaemonSet represents a Kubernetes DaemonSet
func NewDaemonSet ¶
func NewDaemonSet(c Connection) *DaemonSet
NewDaemonSet returns a new DaemonSet.
func (DaemonSet) GetFieldSelector ¶
func (b DaemonSet) GetFieldSelector() string
GetFieldSelector returns field selector.
func (DaemonSet) GetLabelSelector ¶
func (b DaemonSet) GetLabelSelector() string
GetLabelSelector returns label selector.
func (DaemonSet) HasSelectors ¶
func (b DaemonSet) HasSelectors() bool
func (*DaemonSet) List ¶
func (d *DaemonSet) List(ns string) (Collection, error)
List all DaemonSets in a given namespace.
func (DaemonSet) SetFieldSelector ¶
func (b DaemonSet) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (DaemonSet) SetLabelSelector ¶
func (b DaemonSet) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Deployment ¶
type Deployment struct { Connection // contains filtered or unexported fields }
Deployment represents a Kubernetes Deployment.
func NewDeployment ¶
func NewDeployment(c Connection) *Deployment
NewDeployment returns a new Deployment.
func (*Deployment) Delete ¶
func (d *Deployment) Delete(ns, n string, cascade, force bool) error
Delete a Deployment.
func (*Deployment) Get ¶
func (d *Deployment) Get(ns, n string) (interface{}, error)
Get a deployment.
func (Deployment) GetFieldSelector ¶
func (b Deployment) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Deployment) GetLabelSelector ¶
func (b Deployment) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Deployment) HasSelectors ¶
func (b Deployment) HasSelectors() bool
func (*Deployment) List ¶
func (d *Deployment) List(ns string) (Collection, error)
List all Deployments in a given namespace.
func (*Deployment) Scale ¶
func (d *Deployment) Scale(ns, n string, replicas int32) error
Scale a Deployment.
func (Deployment) SetFieldSelector ¶
func (b Deployment) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Deployment) SetLabelSelector ¶
func (b Deployment) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Endpoints ¶
type Endpoints struct { Connection // contains filtered or unexported fields }
Endpoints represents a Kubernetes Endpoints.
func NewEndpoints ¶
func NewEndpoints(c Connection) *Endpoints
NewEndpoints returns a new Endpoints.
func (Endpoints) GetFieldSelector ¶
func (b Endpoints) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Endpoints) GetLabelSelector ¶
func (b Endpoints) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Endpoints) HasSelectors ¶
func (b Endpoints) HasSelectors() bool
func (*Endpoints) List ¶
func (e *Endpoints) List(ns string) (Collection, error)
List all Endpoints in a given namespace.
func (Endpoints) SetFieldSelector ¶
func (b Endpoints) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Endpoints) SetLabelSelector ¶
func (b Endpoints) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Event ¶
type Event struct { Connection // contains filtered or unexported fields }
Event represents a Kubernetes Event.
func (Event) GetFieldSelector ¶
func (b Event) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Event) GetLabelSelector ¶
func (b Event) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Event) HasSelectors ¶
func (b Event) HasSelectors() bool
func (*Event) List ¶
func (e *Event) List(ns string) (Collection, error)
List all Events in a given namespace.
func (Event) SetFieldSelector ¶
func (b Event) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Event) SetLabelSelector ¶
func (b Event) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type HorizontalPodAutoscalerV1 ¶
type HorizontalPodAutoscalerV1 struct { Connection // contains filtered or unexported fields }
HorizontalPodAutoscalerV1 represents am HorizontalPodAutoscaler.
func NewHorizontalPodAutoscalerV1 ¶
func NewHorizontalPodAutoscalerV1(c Connection) *HorizontalPodAutoscalerV1
NewHorizontalPodAutoscalerV1 returns a new HorizontalPodAutoscaler.
func (*HorizontalPodAutoscalerV1) Delete ¶
func (h *HorizontalPodAutoscalerV1) Delete(ns, n string, cascade, force bool) error
Delete a HorizontalPodAutoscaler.
func (*HorizontalPodAutoscalerV1) Get ¶
func (h *HorizontalPodAutoscalerV1) Get(ns, n string) (interface{}, error)
Get a HorizontalPodAutoscaler.
func (HorizontalPodAutoscalerV1) GetFieldSelector ¶
func (b HorizontalPodAutoscalerV1) GetFieldSelector() string
GetFieldSelector returns field selector.
func (HorizontalPodAutoscalerV1) GetLabelSelector ¶
func (b HorizontalPodAutoscalerV1) GetLabelSelector() string
GetLabelSelector returns label selector.
func (HorizontalPodAutoscalerV1) HasSelectors ¶
func (b HorizontalPodAutoscalerV1) HasSelectors() bool
func (*HorizontalPodAutoscalerV1) List ¶
func (h *HorizontalPodAutoscalerV1) List(ns string) (Collection, error)
List all HorizontalPodAutoscalers in a given namespace.
func (HorizontalPodAutoscalerV1) SetFieldSelector ¶
func (b HorizontalPodAutoscalerV1) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (HorizontalPodAutoscalerV1) SetLabelSelector ¶
func (b HorizontalPodAutoscalerV1) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type HorizontalPodAutoscalerV2Beta1 ¶
type HorizontalPodAutoscalerV2Beta1 struct { Connection // contains filtered or unexported fields }
HorizontalPodAutoscalerV2Beta1 represents am HorizontalPodAutoscaler.
func NewHorizontalPodAutoscalerV2Beta1 ¶
func NewHorizontalPodAutoscalerV2Beta1(c Connection) *HorizontalPodAutoscalerV2Beta1
NewHorizontalPodAutoscalerV2Beta1 returns a new HorizontalPodAutoscaler.
func (*HorizontalPodAutoscalerV2Beta1) Delete ¶
func (h *HorizontalPodAutoscalerV2Beta1) Delete(ns, n string, cascade, force bool) error
Delete a HorizontalPodAutoscaler.
func (*HorizontalPodAutoscalerV2Beta1) Get ¶
func (h *HorizontalPodAutoscalerV2Beta1) Get(ns, n string) (interface{}, error)
Get a HorizontalPodAutoscaler.
func (HorizontalPodAutoscalerV2Beta1) GetFieldSelector ¶
func (b HorizontalPodAutoscalerV2Beta1) GetFieldSelector() string
GetFieldSelector returns field selector.
func (HorizontalPodAutoscalerV2Beta1) GetLabelSelector ¶
func (b HorizontalPodAutoscalerV2Beta1) GetLabelSelector() string
GetLabelSelector returns label selector.
func (HorizontalPodAutoscalerV2Beta1) HasSelectors ¶
func (b HorizontalPodAutoscalerV2Beta1) HasSelectors() bool
func (*HorizontalPodAutoscalerV2Beta1) List ¶
func (h *HorizontalPodAutoscalerV2Beta1) List(ns string) (Collection, error)
List all HorizontalPodAutoscalers in a given namespace.
func (HorizontalPodAutoscalerV2Beta1) SetFieldSelector ¶
func (b HorizontalPodAutoscalerV2Beta1) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (HorizontalPodAutoscalerV2Beta1) SetLabelSelector ¶
func (b HorizontalPodAutoscalerV2Beta1) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type HorizontalPodAutoscalerV2Beta2 ¶
type HorizontalPodAutoscalerV2Beta2 struct { Connection // contains filtered or unexported fields }
HorizontalPodAutoscalerV2Beta2 represents am HorizontalPodAutoscaler.
func NewHorizontalPodAutoscalerV2Beta2 ¶
func NewHorizontalPodAutoscalerV2Beta2(c Connection) *HorizontalPodAutoscalerV2Beta2
NewHorizontalPodAutoscalerV2Beta2 returns a new HorizontalPodAutoscalerV2Beta2.
func (*HorizontalPodAutoscalerV2Beta2) Delete ¶
func (h *HorizontalPodAutoscalerV2Beta2) Delete(ns, n string, cascade, force bool) error
Delete a HorizontalPodAutoscalerV2Beta2.
func (*HorizontalPodAutoscalerV2Beta2) Get ¶
func (h *HorizontalPodAutoscalerV2Beta2) Get(ns, n string) (interface{}, error)
Get a HorizontalPodAutoscalerV2Beta2.
func (HorizontalPodAutoscalerV2Beta2) GetFieldSelector ¶
func (b HorizontalPodAutoscalerV2Beta2) GetFieldSelector() string
GetFieldSelector returns field selector.
func (HorizontalPodAutoscalerV2Beta2) GetLabelSelector ¶
func (b HorizontalPodAutoscalerV2Beta2) GetLabelSelector() string
GetLabelSelector returns label selector.
func (HorizontalPodAutoscalerV2Beta2) HasSelectors ¶
func (b HorizontalPodAutoscalerV2Beta2) HasSelectors() bool
func (*HorizontalPodAutoscalerV2Beta2) List ¶
func (h *HorizontalPodAutoscalerV2Beta2) List(ns string) (Collection, error)
List all HorizontalPodAutoscalerV2Beta2s in a given namespace.
func (HorizontalPodAutoscalerV2Beta2) SetFieldSelector ¶
func (b HorizontalPodAutoscalerV2Beta2) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (HorizontalPodAutoscalerV2Beta2) SetLabelSelector ¶
func (b HorizontalPodAutoscalerV2Beta2) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Ingress ¶
type Ingress struct { Connection // contains filtered or unexported fields }
Ingress represents a Kubernetes Ingress.
func (Ingress) GetFieldSelector ¶
func (b Ingress) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Ingress) GetLabelSelector ¶
func (b Ingress) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Ingress) HasSelectors ¶
func (b Ingress) HasSelectors() bool
func (*Ingress) List ¶
func (i *Ingress) List(ns string) (Collection, error)
List all Ingresss in a given namespace.
func (Ingress) SetFieldSelector ¶
func (b Ingress) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Ingress) SetLabelSelector ¶
func (b Ingress) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Job ¶
type Job struct { Connection // contains filtered or unexported fields }
Job represents a Kubernetes Job.
func (*Job) Containers ¶
Containers returns all container names on job.
func (Job) GetFieldSelector ¶
func (b Job) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Job) GetLabelSelector ¶
func (b Job) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Job) HasSelectors ¶
func (b Job) HasSelectors() bool
func (*Job) List ¶
func (j *Job) List(ns string) (Collection, error)
List all Jobs in a given namespace.
func (*Job) Logs ¶
func (j *Job) Logs(ns, n string, opts *v1.PodLogOptions) *restclient.Request
Logs fetch container logs for a given job and container.
func (Job) SetFieldSelector ¶
func (b Job) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Job) SetLabelSelector ¶
func (b Job) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Loggable ¶
type Loggable interface { Containers(ns, n string, includeInit bool) ([]string, error) Logs(ns, n string, opts *v1.PodLogOptions) *restclient.Request }
Loggable represents a K8s resource that has containers and can be logged.
type MetricsServer ¶
type MetricsServer struct { Connection // contains filtered or unexported fields }
MetricsServer serves cluster metrics for nodes and pods.
func NewMetricsServer ¶
func NewMetricsServer(c Connection) *MetricsServer
NewMetricsServer return a metric server instance.
func (*MetricsServer) ClusterLoad ¶
func (m *MetricsServer) ClusterLoad(nos Collection, nmx Collection, mx *ClusterMetrics)
ClusterLoad retrieves all cluster nodes metrics.
func (*MetricsServer) FetchNodesMetrics ¶
func (m *MetricsServer) FetchNodesMetrics() (*mv1beta1.NodeMetricsList, error)
FetchNodesMetrics return all metrics for pods in a given namespace.
func (*MetricsServer) FetchPodsMetrics ¶
func (m *MetricsServer) FetchPodsMetrics(ns string) (*mv1beta1.PodMetricsList, error)
FetchPodsMetrics return all metrics for pods in a given namespace.
func (MetricsServer) GetFieldSelector ¶
func (b MetricsServer) GetFieldSelector() string
GetFieldSelector returns field selector.
func (MetricsServer) GetLabelSelector ¶
func (b MetricsServer) GetLabelSelector() string
GetLabelSelector returns label selector.
func (MetricsServer) HasSelectors ¶
func (b MetricsServer) HasSelectors() bool
func (*MetricsServer) NodesMetrics ¶
func (m *MetricsServer) NodesMetrics(nodes Collection, metrics *mv1beta1.NodeMetricsList, mmx NodesMetrics)
NodesMetrics retrieves metrics for a given set of nodes.
func (*MetricsServer) PodsMetrics ¶
func (m *MetricsServer) PodsMetrics(pods *mv1beta1.PodMetricsList, mmx PodsMetrics)
PodsMetrics retrieves metrics for all pods in a given namespace.
func (MetricsServer) SetFieldSelector ¶
func (b MetricsServer) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (MetricsServer) SetLabelSelector ¶
func (b MetricsServer) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type NamedContext ¶
type NamedContext struct { Name string Context *api.Context // contains filtered or unexported fields }
NamedContext represents a named cluster context.
func NewNamedContext ¶
func NewNamedContext(c *Config, n string, ctx *api.Context) *NamedContext
NewNamedContext returns a new named context.
func (*NamedContext) MustCurrentContextName ¶
func (c *NamedContext) MustCurrentContextName() string
MustCurrentContextName return the active context name.
type Namespace ¶
type Namespace struct { Connection // contains filtered or unexported fields }
Namespace represents a Kubernetes namespace.
func NewNamespace ¶
func NewNamespace(c Connection) *Namespace
NewNamespace returns a new Namespace.
func (Namespace) GetFieldSelector ¶
func (b Namespace) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Namespace) GetLabelSelector ¶
func (b Namespace) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Namespace) HasSelectors ¶
func (b Namespace) HasSelectors() bool
func (*Namespace) List ¶
func (n *Namespace) List(_ string) (Collection, error)
List all active namespaces on the cluster.
func (Namespace) SetFieldSelector ¶
func (b Namespace) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Namespace) SetLabelSelector ¶
func (b Namespace) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type NetworkPolicy ¶
type NetworkPolicy struct { Connection // contains filtered or unexported fields }
NetworkPolicy represents a Kubernetes NetworkPolicy
func NewNetworkPolicy ¶
func NewNetworkPolicy(c Connection) *NetworkPolicy
NewNetworkPolicy returns a new NetworkPolicy.
func (*NetworkPolicy) Delete ¶
func (d *NetworkPolicy) Delete(ns, n string, cascade, force bool) error
Delete a NetworkPolicy.
func (*NetworkPolicy) Get ¶
func (d *NetworkPolicy) Get(ns, n string) (interface{}, error)
Get a NetworkPolicy.
func (NetworkPolicy) GetFieldSelector ¶
func (b NetworkPolicy) GetFieldSelector() string
GetFieldSelector returns field selector.
func (NetworkPolicy) GetLabelSelector ¶
func (b NetworkPolicy) GetLabelSelector() string
GetLabelSelector returns label selector.
func (NetworkPolicy) HasSelectors ¶
func (b NetworkPolicy) HasSelectors() bool
func (*NetworkPolicy) List ¶
func (d *NetworkPolicy) List(ns string) (Collection, error)
List all NetworkPolicys in a given namespace.
func (NetworkPolicy) SetFieldSelector ¶
func (b NetworkPolicy) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (NetworkPolicy) SetLabelSelector ¶
func (b NetworkPolicy) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Node ¶
type Node struct { Connection // contains filtered or unexported fields }
Node represents a Kubernetes node.
func (Node) GetFieldSelector ¶
func (b Node) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Node) GetLabelSelector ¶
func (b Node) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Node) HasSelectors ¶
func (b Node) HasSelectors() bool
func (*Node) List ¶
func (n *Node) List(_ string) (Collection, error)
List all nodes on the cluster.
func (Node) SetFieldSelector ¶
func (b Node) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Node) SetLabelSelector ¶
func (b Node) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type NodeMetrics ¶
type NodeMetrics struct { AvailCPU int64 AvailMEM float64 TotalCPU int64 TotalMEM float64 // contains filtered or unexported fields }
NodeMetrics describes raw node metrics.
type NodesMetrics ¶
type NodesMetrics map[string]NodeMetrics
NodesMetrics tracks usage metrics per nodes.
type PeristentVolume ¶
type PeristentVolume struct { Connection // contains filtered or unexported fields }
PeristentVolume represents a Kubernetes PersistentVolume.
func NewPersistentVolume ¶
func NewPersistentVolume(c Connection) *PeristentVolume
NewPersistentVolume returns a new PeristentVolume.
func (*PeristentVolume) Delete ¶
func (p *PeristentVolume) Delete(_, n string, cascade, force bool) error
Delete a PeristentVolume.
func (*PeristentVolume) Get ¶
func (p *PeristentVolume) Get(_, n string) (interface{}, error)
Get a PeristentVolume.
func (PeristentVolume) GetFieldSelector ¶
func (b PeristentVolume) GetFieldSelector() string
GetFieldSelector returns field selector.
func (PeristentVolume) GetLabelSelector ¶
func (b PeristentVolume) GetLabelSelector() string
GetLabelSelector returns label selector.
func (PeristentVolume) HasSelectors ¶
func (b PeristentVolume) HasSelectors() bool
func (*PeristentVolume) List ¶
func (p *PeristentVolume) List(_ string) (Collection, error)
List all PeristentVolumes in a given namespace.
func (PeristentVolume) SetFieldSelector ¶
func (b PeristentVolume) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (PeristentVolume) SetLabelSelector ¶
func (b PeristentVolume) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type PersistentVolumeClaim ¶
type PersistentVolumeClaim struct { Connection // contains filtered or unexported fields }
PersistentVolumeClaim represents a Kubernetes PersistentVolumeClaim.
func NewPersistentVolumeClaim ¶
func NewPersistentVolumeClaim(c Connection) *PersistentVolumeClaim
NewPersistentVolumeClaim returns a new PersistentVolumeClaim.
func (*PersistentVolumeClaim) Delete ¶
func (p *PersistentVolumeClaim) Delete(ns, n string, cascade, force bool) error
Delete a PersistentVolumeClaim.
func (*PersistentVolumeClaim) Get ¶
func (p *PersistentVolumeClaim) Get(ns, n string) (interface{}, error)
Get a PersistentVolumeClaim.
func (PersistentVolumeClaim) GetFieldSelector ¶
func (b PersistentVolumeClaim) GetFieldSelector() string
GetFieldSelector returns field selector.
func (PersistentVolumeClaim) GetLabelSelector ¶
func (b PersistentVolumeClaim) GetLabelSelector() string
GetLabelSelector returns label selector.
func (PersistentVolumeClaim) HasSelectors ¶
func (b PersistentVolumeClaim) HasSelectors() bool
func (*PersistentVolumeClaim) List ¶
func (p *PersistentVolumeClaim) List(ns string) (Collection, error)
List all PersistentVolumeClaims in a given namespace.
func (PersistentVolumeClaim) SetFieldSelector ¶
func (b PersistentVolumeClaim) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (PersistentVolumeClaim) SetLabelSelector ¶
func (b PersistentVolumeClaim) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Pod ¶
type Pod struct { Connection // contains filtered or unexported fields }
Pod represents a Kubernetes Pod.
func (*Pod) Containers ¶
Containers returns all container names on pod
func (Pod) GetFieldSelector ¶
func (b Pod) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Pod) GetLabelSelector ¶
func (b Pod) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Pod) HasSelectors ¶
func (b Pod) HasSelectors() bool
func (*Pod) List ¶
func (p *Pod) List(ns string) (Collection, error)
List all pods in a given namespace.
func (*Pod) Logs ¶
func (p *Pod) Logs(ns, n string, opts *v1.PodLogOptions) *restclient.Request
Logs fetch container logs for a given pod and container.
func (Pod) SetFieldSelector ¶
func (b Pod) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Pod) SetLabelSelector ¶
func (b Pod) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type PodDisruptionBudget ¶
type PodDisruptionBudget struct { Connection // contains filtered or unexported fields }
PodDisruptionBudget represents a Kubernetes PodDisruptionBudget.
func NewPodDisruptionBudget ¶
func NewPodDisruptionBudget(c Connection) *PodDisruptionBudget
NewPodDisruptionBudget returns a new PodDisruptionBudget.
func (*PodDisruptionBudget) Delete ¶
func (p *PodDisruptionBudget) Delete(ns, n string, cascade, force bool) error
Delete a pdb.
func (*PodDisruptionBudget) Get ¶
func (p *PodDisruptionBudget) Get(ns, n string) (interface{}, error)
Get a pdb.
func (PodDisruptionBudget) GetFieldSelector ¶
func (b PodDisruptionBudget) GetFieldSelector() string
GetFieldSelector returns field selector.
func (PodDisruptionBudget) GetLabelSelector ¶
func (b PodDisruptionBudget) GetLabelSelector() string
GetLabelSelector returns label selector.
func (PodDisruptionBudget) HasSelectors ¶
func (b PodDisruptionBudget) HasSelectors() bool
func (*PodDisruptionBudget) List ¶
func (p *PodDisruptionBudget) List(ns string) (Collection, error)
List all pdbs in a given namespace.
func (PodDisruptionBudget) SetFieldSelector ¶
func (b PodDisruptionBudget) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (PodDisruptionBudget) SetLabelSelector ¶
func (b PodDisruptionBudget) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type PodMetrics ¶
type PodMetrics currentMetrics
PodMetrics represent an aggregation of all pod containers metrics.
type PodsMetrics ¶
type PodsMetrics map[string]PodMetrics
PodsMetrics tracks usage metrics per pods.
type PortForward ¶
type PortForward struct { Connection genericclioptions.IOStreams // contains filtered or unexported fields }
PortForward tracks a port forward stream.
func NewPortForward ¶
func NewPortForward(c Connection, l *zerolog.Logger) *PortForward
NewPortForward returns a new port forward streamer.
func (*PortForward) Container ¶
func (p *PortForward) Container() string
Container returns the targetes container.
func (*PortForward) Ports ¶
func (p *PortForward) Ports() []string
Ports returns the forwarded ports mappings.
func (*PortForward) SetActive ¶
func (p *PortForward) SetActive(b bool)
SetActive mark a portforward as active.
func (*PortForward) Start ¶
func (p *PortForward) Start(path, co string, ports []string) (*portforward.PortForwarder, error)
Start initiates a port forward session for a given pod and ports.
type ReplicaSet ¶
type ReplicaSet struct { Connection // contains filtered or unexported fields }
ReplicaSet represents a Kubernetes ReplicaSet.
func NewReplicaSet ¶
func NewReplicaSet(c Connection) *ReplicaSet
NewReplicaSet returns a new ReplicaSet.
func (*ReplicaSet) Delete ¶
func (r *ReplicaSet) Delete(ns, n string, cascade, force bool) error
Delete a ReplicaSet.
func (*ReplicaSet) Get ¶
func (r *ReplicaSet) Get(ns, n string) (interface{}, error)
Get a ReplicaSet.
func (ReplicaSet) GetFieldSelector ¶
func (b ReplicaSet) GetFieldSelector() string
GetFieldSelector returns field selector.
func (ReplicaSet) GetLabelSelector ¶
func (b ReplicaSet) GetLabelSelector() string
GetLabelSelector returns label selector.
func (ReplicaSet) HasSelectors ¶
func (b ReplicaSet) HasSelectors() bool
func (*ReplicaSet) List ¶
func (r *ReplicaSet) List(ns string) (Collection, error)
List all ReplicaSets in a given namespace.
func (ReplicaSet) SetFieldSelector ¶
func (b ReplicaSet) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (ReplicaSet) SetLabelSelector ¶
func (b ReplicaSet) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type ReplicationController ¶
type ReplicationController struct { Connection // contains filtered or unexported fields }
ReplicationController represents a Kubernetes ReplicationController.
func NewReplicationController ¶
func NewReplicationController(c Connection) *ReplicationController
NewReplicationController returns a new ReplicationController.
func (*ReplicationController) Delete ¶
func (r *ReplicationController) Delete(ns, n string, cascade, force bool) error
Delete a RC.
func (*ReplicationController) Get ¶
func (r *ReplicationController) Get(ns, n string) (interface{}, error)
Get a RC.
func (ReplicationController) GetFieldSelector ¶
func (b ReplicationController) GetFieldSelector() string
GetFieldSelector returns field selector.
func (ReplicationController) GetLabelSelector ¶
func (b ReplicationController) GetLabelSelector() string
GetLabelSelector returns label selector.
func (ReplicationController) HasSelectors ¶
func (b ReplicationController) HasSelectors() bool
func (*ReplicationController) List ¶
func (r *ReplicationController) List(ns string) (Collection, error)
List all RCs in a given namespace.
func (*ReplicationController) Scale ¶
func (r *ReplicationController) Scale(ns, n string, replicas int32) error
Scale a ReplicationController.
func (ReplicationController) SetFieldSelector ¶
func (b ReplicationController) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (ReplicationController) SetLabelSelector ¶
func (b ReplicationController) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Resource ¶
type Resource struct { Connection // contains filtered or unexported fields }
Resource represents a Kubernetes Resource
func NewResource ¶
func NewResource(c Connection, group, version, name string) *Resource
NewResource returns a new Resource.
func (Resource) GetFieldSelector ¶
func (b Resource) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Resource) GetLabelSelector ¶
func (b Resource) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Resource) HasSelectors ¶
func (b Resource) HasSelectors() bool
func (*Resource) List ¶
func (r *Resource) List(ns string) (Collection, error)
List all Resources in a given namespace.
func (Resource) SetFieldSelector ¶
func (b Resource) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Resource) SetLabelSelector ¶
func (b Resource) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type RestMapper ¶
type RestMapper struct {
Connection
}
RestMapper map resource to REST mapping ie kind, group, version.
func (*RestMapper) Find ¶
func (*RestMapper) Find(res string) (*meta.RESTMapping, error)
Find a mapping given a resource name.
func (*RestMapper) Name ¶
func (*RestMapper) Name() meta.RESTScopeName
Name protocol returns rest scope name.
func (*RestMapper) ResourceFor ¶
func (r *RestMapper) ResourceFor(resourceArg string) (*meta.RESTMapping, error)
ResourceFor produces a rest mapping from a given resource. Support full res name ie deployment.v1.apps.
func (*RestMapper) ToRESTMapper ¶
func (r *RestMapper) ToRESTMapper() (meta.RESTMapper, error)
ToRESTMapper map resources to kind, and map kind and version to interfaces for manipulating K8s objects.
type Role ¶
type Role struct { Connection // contains filtered or unexported fields }
Role represents a Kubernetes Role.
func (Role) GetFieldSelector ¶
func (b Role) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Role) GetLabelSelector ¶
func (b Role) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Role) HasSelectors ¶
func (b Role) HasSelectors() bool
func (*Role) List ¶
func (r *Role) List(ns string) (Collection, error)
List all Roles in a given namespace.
func (Role) SetFieldSelector ¶
func (b Role) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Role) SetLabelSelector ¶
func (b Role) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type RoleBinding ¶
type RoleBinding struct { Connection // contains filtered or unexported fields }
RoleBinding represents a Kubernetes RoleBinding.
func NewRoleBinding ¶
func NewRoleBinding(c Connection) *RoleBinding
NewRoleBinding returns a new RoleBinding.
func (*RoleBinding) Delete ¶
func (r *RoleBinding) Delete(ns, n string, cascade, force bool) error
Delete a RoleBinding.
func (*RoleBinding) Get ¶
func (r *RoleBinding) Get(ns, n string) (interface{}, error)
Get a RoleBinding.
func (RoleBinding) GetFieldSelector ¶
func (b RoleBinding) GetFieldSelector() string
GetFieldSelector returns field selector.
func (RoleBinding) GetLabelSelector ¶
func (b RoleBinding) GetLabelSelector() string
GetLabelSelector returns label selector.
func (RoleBinding) HasSelectors ¶
func (b RoleBinding) HasSelectors() bool
func (*RoleBinding) List ¶
func (r *RoleBinding) List(ns string) (Collection, error)
List all RoleBindings in a given namespace.
func (RoleBinding) SetFieldSelector ¶
func (b RoleBinding) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (RoleBinding) SetLabelSelector ¶
func (b RoleBinding) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Secret ¶
type Secret struct { Connection // contains filtered or unexported fields }
Secret represents a Kubernetes Secret.
func (Secret) GetFieldSelector ¶
func (b Secret) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Secret) GetLabelSelector ¶
func (b Secret) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Secret) HasSelectors ¶
func (b Secret) HasSelectors() bool
func (*Secret) List ¶
func (s *Secret) List(ns string) (Collection, error)
List all Secrets in a given namespace.
func (Secret) SetFieldSelector ¶
func (b Secret) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Secret) SetLabelSelector ¶
func (b Secret) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type Service ¶
type Service struct { Connection // contains filtered or unexported fields }
Service represents a Kubernetes Service.
func (Service) GetFieldSelector ¶
func (b Service) GetFieldSelector() string
GetFieldSelector returns field selector.
func (Service) GetLabelSelector ¶
func (b Service) GetLabelSelector() string
GetLabelSelector returns label selector.
func (Service) HasSelectors ¶
func (b Service) HasSelectors() bool
func (*Service) List ¶
func (s *Service) List(ns string) (Collection, error)
List all Services in a given namespace.
func (Service) SetFieldSelector ¶
func (b Service) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (Service) SetLabelSelector ¶
func (b Service) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type ServiceAccount ¶
type ServiceAccount struct { Connection // contains filtered or unexported fields }
ServiceAccount manages a Kubernetes ServiceAccount.
func NewServiceAccount ¶
func NewServiceAccount(c Connection) *ServiceAccount
NewServiceAccount instantiates a new ServiceAccount.
func (*ServiceAccount) Delete ¶
func (s *ServiceAccount) Delete(ns, n string, cascade, force bool) error
Delete a ServiceAccount.
func (*ServiceAccount) Get ¶
func (s *ServiceAccount) Get(ns, n string) (interface{}, error)
Get a ServiceAccount.
func (ServiceAccount) GetFieldSelector ¶
func (b ServiceAccount) GetFieldSelector() string
GetFieldSelector returns field selector.
func (ServiceAccount) GetLabelSelector ¶
func (b ServiceAccount) GetLabelSelector() string
GetLabelSelector returns label selector.
func (ServiceAccount) HasSelectors ¶
func (b ServiceAccount) HasSelectors() bool
func (*ServiceAccount) List ¶
func (s *ServiceAccount) List(ns string) (Collection, error)
List all ServiceAccounts in a given namespace.
func (ServiceAccount) SetFieldSelector ¶
func (b ServiceAccount) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (ServiceAccount) SetLabelSelector ¶
func (b ServiceAccount) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
type StatefulSet ¶
type StatefulSet struct { Connection // contains filtered or unexported fields }
StatefulSet manages a Kubernetes StatefulSet.
func NewStatefulSet ¶
func NewStatefulSet(c Connection) *StatefulSet
NewStatefulSet instantiates a new StatefulSet.
func (*StatefulSet) Delete ¶
func (s *StatefulSet) Delete(ns, n string, cascade, force bool) error
Delete a StatefulSet.
func (*StatefulSet) Get ¶
func (s *StatefulSet) Get(ns, n string) (interface{}, error)
Get a StatefulSet.
func (StatefulSet) GetFieldSelector ¶
func (b StatefulSet) GetFieldSelector() string
GetFieldSelector returns field selector.
func (StatefulSet) GetLabelSelector ¶
func (b StatefulSet) GetLabelSelector() string
GetLabelSelector returns label selector.
func (StatefulSet) HasSelectors ¶
func (b StatefulSet) HasSelectors() bool
func (*StatefulSet) List ¶
func (s *StatefulSet) List(ns string) (Collection, error)
List all StatefulSets in a given namespace.
func (*StatefulSet) Scale ¶
func (s *StatefulSet) Scale(ns, n string, replicas int32) error
Scale a StatefulSet.
func (StatefulSet) SetFieldSelector ¶
func (b StatefulSet) SetFieldSelector(s string)
SetFieldSelector refines query results via selector.
func (StatefulSet) SetLabelSelector ¶
func (b StatefulSet) SetLabelSelector(s string)
SetLabelSelector refines query results via labels.
Source Files ¶
- api.go
- base.go
- cluster.go
- cluster_role.go
- cluster_roleb.go
- cm.go
- config.go
- context.go
- crd.go
- cronjob.go
- dp.go
- ds.go
- ep.go
- evt.go
- helpers.go
- hpa_v1.go
- hpa_v2beta1.go
- hpa_v2beta2.go
- ing.go
- job.go
- mapper.go
- metrics.go
- no.go
- np.go
- ns.go
- pdb.go
- pod.go
- port_forward.go
- pv.go
- pvc.go
- rc.go
- resource.go
- role.go
- role_binding.go
- rs.go
- sa.go
- secret.go
- sts.go
- svc.go