Documentation
¶
Index ¶
- Constants
- func AsPerc(f float64) string
- func FQN(ns, n string) string
- func MetaFQN(m metav1.ObjectMeta) string
- func Namespaced(n string) (string, string)
- func NewList(ns, name string, res Resource, verbs int) *list
- func ToMi(v float64) string
- func ToMillicore(v int64) string
- func Truncate(str string, width int) string
- type Base
- func (b *Base) Delete(path string, cascade, force bool) error
- func (b *Base) Describe(kind, pa string) (string, error)
- func (*Base) ExtFields() Properties
- func (b *Base) Get(path string) (Columnar, error)
- func (b *Base) GetFieldSelector() string
- func (b *Base) GetLabelSelector() string
- func (b *Base) HasSelectors() bool
- func (b *Base) List(ns string) (Columnars, error)
- func (b *Base) Name() string
- func (*Base) NumCols(n string) map[string]bool
- func (b *Base) SetFieldSelector(s string)
- func (b *Base) SetLabelSelector(s string)
- func (b *Base) SetNodeMetrics(*mv1beta1.NodeMetrics)
- func (b *Base) SetPodMetrics(*mv1beta1.PodMetrics)
- type Cluster
- type ClusterMeta
- type ClusterRole
- type ClusterRoleBinding
- type Columnar
- type Columnars
- type ConfigMap
- type Connection
- type Container
- func (r *Container) Fields(ns string) Row
- func (*Container) Header(ns string) Row
- func (r *Container) List(ns string) (Columnars, error)
- func (r *Container) Logs(ctx context.Context, c chan<- string, opts LogOptions) error
- func (r *Container) Marshal(path string) (string, error)
- func (r *Container) New(i interface{}) Columnar
- func (*Container) NumCols(n string) map[string]bool
- func (r *Container) SetPodMetrics(m *mv1beta1.PodMetrics)
- type Containers
- type Context
- type CronJob
- type Cruder
- type Custom
- type CustomResourceDefinition
- func (r *CustomResourceDefinition) ExtFields() Properties
- func (r *CustomResourceDefinition) Fields(ns string) Row
- func (*CustomResourceDefinition) Header(ns string) Row
- func (r *CustomResourceDefinition) Marshal(path string) (string, error)
- func (r *CustomResourceDefinition) New(i interface{}) Columnar
- type DaemonSet
- type Deployment
- func (r *Deployment) Fields(ns string) Row
- func (*Deployment) Header(ns string) Row
- func (r *Deployment) Logs(ctx context.Context, c chan<- string, opts LogOptions) error
- func (r *Deployment) Marshal(path string) (string, error)
- func (r *Deployment) New(i interface{}) Columnar
- func (*Deployment) NumCols(n string) map[string]bool
- func (r *Deployment) Scale(ns, n string, replicas int32) error
- type Endpoints
- type Event
- type Factory
- type Fqn
- type HorizontalPodAutoscaler
- type HorizontalPodAutoscalerV1
- type HorizontalPodAutoscalerV2Beta1
- type IKey
- type Ingress
- type Job
- func (r *Job) Containers(path string, includeInit bool) ([]string, error)
- func (r *Job) Fields(ns string) Row
- func (*Job) Header(ns string) Row
- func (r *Job) Logs(ctx context.Context, c chan<- string, opts LogOptions) error
- func (r *Job) Marshal(path string) (string, error)
- func (r *Job) New(i interface{}) Columnar
- type List
- func NewClusterRoleBindingList(c Connection, _ string) List
- func NewClusterRoleList(c Connection, ns string) List
- func NewConfigMapList(c Connection, ns string) List
- func NewContainerList(c Connection, pod *v1.Pod) List
- func NewContextList(c Connection, ns string) List
- func NewCronJobList(c Connection, ns string) List
- func NewCustomList(c k8s.Connection, ns, group, version, name string) List
- func NewCustomResourceDefinitionList(c Connection, ns string) List
- func NewDaemonSetList(c Connection, ns string) List
- func NewDeploymentList(c Connection, ns string) List
- func NewEndpointsList(c Connection, ns string) List
- func NewEventList(c Connection, ns string) List
- func NewHorizontalPodAutoscalerList(c Connection, ns string) List
- func NewHorizontalPodAutoscalerV1List(c Connection, ns string) List
- func NewHorizontalPodAutoscalerV2Beta1List(c Connection, ns string) List
- func NewIngressList(c Connection, ns string) List
- func NewJobList(c Connection, ns string) List
- func NewNamespaceList(c Connection, ns string) List
- func NewNetworkPolicyList(c Connection, ns string) List
- func NewNodeList(c Connection, _ string) List
- func NewPDBList(c Connection, ns string) List
- func NewPersistentVolumeClaimList(c Connection, ns string) List
- func NewPersistentVolumeList(c Connection, ns string) List
- func NewPodList(c Connection, ns string) List
- func NewReplicaSetList(c Connection, ns string) List
- func NewReplicationControllerList(c Connection, ns string) List
- func NewRoleBindingList(c Connection, ns string) List
- func NewRoleList(c Connection, ns string) List
- func NewSecretList(c Connection, ns string) List
- func NewServiceAccountList(c Connection, ns string) List
- func NewServiceList(c Connection, ns string) List
- func NewStatefulSetList(c Connection, ns string) List
- type LogOptions
- type MetricsServer
- type MetricsService
- type Namespace
- type NetworkPolicy
- type Node
- func (r *Node) Fields(ns string) Row
- func (*Node) Header(ns string) Row
- func (r *Node) List(ns string) (Columnars, error)
- func (r *Node) Marshal(path string) (string, error)
- func (r *Node) New(i interface{}) Columnar
- func (*Node) NumCols(n string) map[string]bool
- func (r *Node) SetNodeMetrics(m *mv1beta1.NodeMetrics)
- type PersistentVolume
- type PersistentVolumeClaim
- type Pod
- func (r *Pod) Containers(path string, includeInit bool) ([]string, error)
- func (r *Pod) Fields(ns string) Row
- func (*Pod) Header(ns string) Row
- func (r *Pod) List(ns string) (Columnars, error)
- func (r *Pod) Logs(ctx context.Context, c chan<- string, opts LogOptions) error
- func (r *Pod) Marshal(path string) (string, error)
- func (r *Pod) New(i interface{}) Columnar
- func (*Pod) NumCols(n string) map[string]bool
- func (r *Pod) PodLogs(ctx context.Context, c chan<- string, opts LogOptions) error
- func (r *Pod) SetPodMetrics(m *mv1beta1.PodMetrics)
- type PodDisruptionBudget
- type Properties
- type ReplicaSet
- type ReplicationController
- func (r *ReplicationController) Fields(ns string) Row
- func (*ReplicationController) Header(ns string) Row
- func (r *ReplicationController) Marshal(path string) (string, error)
- func (r *ReplicationController) New(i interface{}) Columnar
- func (r *ReplicationController) Scale(ns, n string, replicas int32) error
- type Resource
- type Role
- type RoleBinding
- type Row
- type RowEvent
- type RowEvents
- type Rows
- type Runnable
- type Runner
- type Scalable
- type Secret
- type Service
- type ServiceAccount
- type StatefulSet
- func (r *StatefulSet) Fields(ns string) Row
- func (*StatefulSet) Header(ns string) Row
- func (r *StatefulSet) Logs(ctx context.Context, c chan<- string, opts LogOptions) error
- func (r *StatefulSet) Marshal(path string) (string, error)
- func (r *StatefulSet) New(i interface{}) Columnar
- func (*StatefulSet) NumCols(n string) map[string]bool
- func (r *StatefulSet) Scale(ns, n string, replicas int32) error
- type Switchable
- type SwitchableCruder
- type TableData
- type Tailable
- type TailableResource
Constants ¶
const ( // DefaultNamespace indicator to fetch default namespace. DefaultNamespace = "default" // AllNamespace namespace name to span all namespaces. AllNamespace = "all" // AllNamespaces indicator to retrieve K8s resource for all namespaces. AllNamespaces = "" // NotNamespaced indicator for non namespaced resource. NotNamespaced = "-" // New track new resource events. New watch.EventType = "NEW" // Unchanged provides no change events. Unchanged watch.EventType = "UNCHANGED" // MissingValue indicates an unset value. MissingValue = "<none>" // NAValue indicates a value that does not pertain. NAValue = "n/a" )
const ( // GetAccess set if resource can be fetched. GetAccess = 1 << iota // ListAccess set if resource can be listed. ListAccess // EditAccess set if resource can be edited. EditAccess // DeleteAccess set if resource can be deleted. DeleteAccess // ViewAccess set if resource can be viewed. ViewAccess // NamespaceAccess set if namespaced resource. NamespaceAccess // DescribeAccess set if resource can be described. DescribeAccess // SwitchAccess set if resource can be switched (Context). SwitchAccess // CRUDAccess Verbs. CRUDAccess = GetAccess | ListAccess | DeleteAccess | ViewAccess | EditAccess // AllVerbsAccess super powers. AllVerbsAccess = CRUDAccess | NamespaceAccess )
Variables ¶
This section is empty.
Functions ¶
func MetaFQN ¶
func MetaFQN(m metav1.ObjectMeta) string
MetaFQN returns a fully qualified resource name.
func Namespaced ¶
Namespaced return a namesapace and a name.
Types ¶
type Base ¶
type Base struct { Factory Connection Connection Resource Cruder // contains filtered or unexported fields }
Base resource.
func (*Base) ExtFields ¶
func (*Base) ExtFields() Properties
ExtFields returns extended fields in relation to headers.
func (*Base) GetFieldSelector ¶
GetFieldSelector returns field selector.
func (*Base) GetLabelSelector ¶
GetLabelSelector returns label selector.
func (*Base) HasSelectors ¶
HasSelectors returns true if field or label selectors are set.
func (*Base) SetFieldSelector ¶
SetFieldSelector refines query results via selector.
func (*Base) SetLabelSelector ¶
SetLabelSelector refines query results via labels.
func (*Base) SetNodeMetrics ¶
func (b *Base) SetNodeMetrics(*mv1beta1.NodeMetrics)
SetNodeMetrics attach node metrics to resource.
func (*Base) SetPodMetrics ¶
func (b *Base) SetPodMetrics(*mv1beta1.PodMetrics)
SetPodMetrics attach pod metrics to resource.
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster represents a kubernetes resource.
func NewCluster ¶
func NewCluster(c Connection, log *zerolog.Logger, mx MetricsServer) *Cluster
NewCluster returns a new cluster info resource.
func NewClusterWithArgs ¶
func NewClusterWithArgs(ci ClusterMeta, mx MetricsServer) *Cluster
NewClusterWithArgs for tests only!
func (*Cluster) ClusterName ¶
ClusterName returns the cluster name.
func (*Cluster) ContextName ¶
ContextName returns the context name.
func (*Cluster) Metrics ¶
func (c *Cluster) Metrics(nos k8s.Collection, nmx k8s.Collection, mx *k8s.ClusterMetrics)
Metrics gathers node level metrics and compute utilization percentages.
type ClusterMeta ¶
type ClusterMeta interface { Connection Version() (string, error) ContextName() string ClusterName() string UserName() string GetNodes() (*v1.NodeList, error) }
ClusterMeta represents metadata about a Kubernetes cluster.
type ClusterRole ¶
type ClusterRole struct { *Base // contains filtered or unexported fields }
ClusterRole tracks a kubernetes resource.
func NewClusterRole ¶
func NewClusterRole(c Connection) *ClusterRole
NewClusterRole instantiates a new ClusterRole.
func (*ClusterRole) Fields ¶
func (r *ClusterRole) Fields(ns string) Row
Fields retrieves displayable fields.
func (*ClusterRole) Header ¶
func (*ClusterRole) Header(ns string) Row
Header return resource header.
func (*ClusterRole) Marshal ¶
func (r *ClusterRole) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*ClusterRole) New ¶
func (r *ClusterRole) New(i interface{}) Columnar
New builds a new ClusterRole instance from a k8s resource.
type ClusterRoleBinding ¶
type ClusterRoleBinding struct { *Base // contains filtered or unexported fields }
ClusterRoleBinding tracks a kubernetes resource.
func NewClusterRoleBinding ¶
func NewClusterRoleBinding(c Connection) *ClusterRoleBinding
NewClusterRoleBinding instantiates a new ClusterRoleBinding.
func (*ClusterRoleBinding) Fields ¶
func (r *ClusterRoleBinding) Fields(ns string) Row
Fields retrieves displayable fields.
func (*ClusterRoleBinding) Header ¶
func (*ClusterRoleBinding) Header(_ string) Row
Header return resource header.
func (*ClusterRoleBinding) Marshal ¶
func (r *ClusterRoleBinding) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*ClusterRoleBinding) New ¶
func (r *ClusterRoleBinding) New(i interface{}) Columnar
New builds a new tabular instance from a k8s resource.
type Columnar ¶
type Columnar interface { Header(ns string) Row Fields(ns string) Row ExtFields() Properties Name() string SetPodMetrics(*mv1beta1.PodMetrics) SetNodeMetrics(*mv1beta1.NodeMetrics) }
Columnar tracks resources that can be diplayed in a tabular fashion.
type ConfigMap ¶
type ConfigMap struct { *Base // contains filtered or unexported fields }
ConfigMap tracks a kubernetes resource.
func NewConfigMap ¶
func NewConfigMap(c Connection) *ConfigMap
NewConfigMap instantiates a new ConfigMap.
type Connection ¶
type Connection k8s.Connection
Connection represents a Kubenetes apiserver connection.
type Container ¶
type Container struct { *Base // contains filtered or unexported fields }
Container represents a container on a pod.
func NewContainer ¶
func NewContainer(c Connection, pod *v1.Pod) *Container
NewContainer returns a new set of containers.
func (*Container) SetPodMetrics ¶
func (r *Container) SetPodMetrics(m *mv1beta1.PodMetrics)
SetPodMetrics set the current k8s resource metrics on associated pod.
type Containers ¶
Containers represents a resource that supports containers.
type Context ¶
type Context struct { *Base // contains filtered or unexported fields }
Context tracks a kubernetes resource.
type CronJob ¶
type CronJob struct { *Base // contains filtered or unexported fields }
CronJob tracks a kubernetes resource.
type Cruder ¶
type Cruder interface { Get(ns string, name string) (interface{}, error) List(ns string) (k8s.Collection, error) Delete(ns string, name string, cascade, force bool) error SetLabelSelector(string) SetFieldSelector(string) GetLabelSelector() string GetFieldSelector() string HasSelectors() bool }
Cruder represents a crudable Kubernetes resource.
type Custom ¶
type Custom struct { *Base // contains filtered or unexported fields }
Custom tracks a kubernetes resource.
func NewCustom ¶
func NewCustom(c k8s.Connection, group, version, name string) *Custom
NewCustom instantiates a new Kubernetes Resource.
type CustomResourceDefinition ¶
type CustomResourceDefinition struct { *Base // contains filtered or unexported fields }
CustomResourceDefinition tracks a kubernetes resource.
func NewCustomResourceDefinition ¶
func NewCustomResourceDefinition(c Connection) *CustomResourceDefinition
NewCustomResourceDefinition instantiates a new CustomResourceDefinition.
func (*CustomResourceDefinition) ExtFields ¶
func (r *CustomResourceDefinition) ExtFields() Properties
ExtFields returns extended fields.
func (*CustomResourceDefinition) Fields ¶
func (r *CustomResourceDefinition) Fields(ns string) Row
Fields retrieves displayable fields.
func (*CustomResourceDefinition) Header ¶
func (*CustomResourceDefinition) Header(ns string) Row
Header return the resource header.
func (*CustomResourceDefinition) Marshal ¶
func (r *CustomResourceDefinition) Marshal(path string) (string, error)
Marshal a resource.
func (*CustomResourceDefinition) New ¶
func (r *CustomResourceDefinition) New(i interface{}) Columnar
New builds a new CustomResourceDefinition instance from a k8s resource.
type DaemonSet ¶
type DaemonSet struct { *Base // contains filtered or unexported fields }
DaemonSet tracks a kubernetes resource.
func NewDaemonSet ¶
func NewDaemonSet(c Connection) *DaemonSet
NewDaemonSet instantiates a new DaemonSet.
type Deployment ¶
type Deployment struct { *Base // contains filtered or unexported fields }
Deployment tracks a kubernetes resource.
func NewDeployment ¶
func NewDeployment(c Connection) *Deployment
NewDeployment instantiates a new Deployment.
func (*Deployment) Fields ¶
func (r *Deployment) Fields(ns string) Row
Fields retrieves displayable fields.
func (*Deployment) Logs ¶
func (r *Deployment) Logs(ctx context.Context, c chan<- string, opts LogOptions) error
Logs tail logs for all pods represented by this deployment.
func (*Deployment) Marshal ¶
func (r *Deployment) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*Deployment) New ¶
func (r *Deployment) New(i interface{}) Columnar
New builds a new Deployment instance from a k8s resource.
type Endpoints ¶
type Endpoints struct { *Base // contains filtered or unexported fields }
Endpoints tracks a kubernetes resource.
func NewEndpoints ¶
func NewEndpoints(c Connection) *Endpoints
NewEndpoints instantiates a new Endpoints.
type Event ¶
type Event struct { *Base // contains filtered or unexported fields }
Event tracks a kubernetes resource.
type Factory ¶
type Factory interface {
New(interface{}) Columnar
}
Factory creates new tabular resources.
type HorizontalPodAutoscaler ¶
type HorizontalPodAutoscaler struct { *Base // contains filtered or unexported fields }
HorizontalPodAutoscaler tracks a kubernetes resource.
func NewHorizontalPodAutoscaler ¶
func NewHorizontalPodAutoscaler(c Connection) *HorizontalPodAutoscaler
NewHorizontalPodAutoscaler instantiates a new HorizontalPodAutoscaler.
func (*HorizontalPodAutoscaler) Fields ¶
func (r *HorizontalPodAutoscaler) Fields(ns string) Row
Fields retrieves displayable fields.
func (*HorizontalPodAutoscaler) Header ¶
func (*HorizontalPodAutoscaler) Header(ns string) Row
Header return resource header.
func (*HorizontalPodAutoscaler) Marshal ¶
func (r *HorizontalPodAutoscaler) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*HorizontalPodAutoscaler) New ¶
func (r *HorizontalPodAutoscaler) New(i interface{}) Columnar
New builds a new HorizontalPodAutoscaler instance from a k8s resource.
type HorizontalPodAutoscalerV1 ¶
type HorizontalPodAutoscalerV1 struct { *Base // contains filtered or unexported fields }
HorizontalPodAutoscalerV1 tracks a kubernetes resource.
func NewHorizontalPodAutoscalerV1 ¶
func NewHorizontalPodAutoscalerV1(c Connection) *HorizontalPodAutoscalerV1
NewHorizontalPodAutoscalerV1 instantiates a new HorizontalPodAutoscalerV1.
func (*HorizontalPodAutoscalerV1) Fields ¶
func (r *HorizontalPodAutoscalerV1) Fields(ns string) Row
Fields retrieves displayable fields.
func (*HorizontalPodAutoscalerV1) Header ¶
func (*HorizontalPodAutoscalerV1) Header(ns string) Row
Header return resource header.
func (*HorizontalPodAutoscalerV1) Marshal ¶
func (r *HorizontalPodAutoscalerV1) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*HorizontalPodAutoscalerV1) New ¶
func (r *HorizontalPodAutoscalerV1) New(i interface{}) Columnar
New builds a new HorizontalPodAutoscalerV1 instance from a k8s resource.
type HorizontalPodAutoscalerV2Beta1 ¶
type HorizontalPodAutoscalerV2Beta1 struct { *Base // contains filtered or unexported fields }
HorizontalPodAutoscalerV2Beta1 tracks a kubernetes resource.
func NewHorizontalPodAutoscalerV2Beta1 ¶
func NewHorizontalPodAutoscalerV2Beta1(c Connection) *HorizontalPodAutoscalerV2Beta1
NewHorizontalPodAutoscalerV2Beta1 instantiates a new HorizontalPodAutoscalerV2Beta1.
func (*HorizontalPodAutoscalerV2Beta1) Fields ¶
func (r *HorizontalPodAutoscalerV2Beta1) Fields(ns string) Row
Fields retrieves displayable fields.
func (*HorizontalPodAutoscalerV2Beta1) Header ¶
func (*HorizontalPodAutoscalerV2Beta1) Header(ns string) Row
Header return resource header.
func (*HorizontalPodAutoscalerV2Beta1) Marshal ¶
func (r *HorizontalPodAutoscalerV2Beta1) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*HorizontalPodAutoscalerV2Beta1) New ¶
func (r *HorizontalPodAutoscalerV2Beta1) New(i interface{}) Columnar
New builds a new HorizontalPodAutoscalerV2Beta1 instance from a k8s resource.
type Ingress ¶
type Ingress struct { *Base // contains filtered or unexported fields }
Ingress tracks a kubernetes resource.
type Job ¶
type Job struct { *Base // contains filtered or unexported fields }
Job tracks a kubernetes resource.
func (*Job) Containers ¶
Containers fetch all the containers on this job, may include init containers.
type List ¶
type List interface { Data() TableData Resource() Resource Namespaced() bool AllNamespaces() bool GetNamespace() string SetNamespace(string) Reconcile(informer *wa.Informer, path *string) error GetName() string Access(flag int) bool GetAccess() int SetAccess(int) SetFieldSelector(string) SetLabelSelector(string) HasSelectors() bool }
List protocol to display and update a collection of resources
func NewClusterRoleBindingList ¶
func NewClusterRoleBindingList(c Connection, _ string) List
NewClusterRoleBindingList returns a new resource list.
func NewClusterRoleList ¶
func NewClusterRoleList(c Connection, ns string) List
NewClusterRoleList returns a new resource list.
func NewConfigMapList ¶
func NewConfigMapList(c Connection, ns string) List
NewConfigMapList returns a new resource list.
func NewContainerList ¶
func NewContainerList(c Connection, pod *v1.Pod) List
NewContainerList returns a collection of container.
func NewContextList ¶
func NewContextList(c Connection, ns string) List
NewContextList returns a new resource list.
func NewCronJobList ¶
func NewCronJobList(c Connection, ns string) List
NewCronJobList returns a new resource list.
func NewCustomList ¶
func NewCustomList(c k8s.Connection, ns, group, version, name string) List
NewCustomList returns a new resource list.
func NewCustomResourceDefinitionList ¶
func NewCustomResourceDefinitionList(c Connection, ns string) List
NewCustomResourceDefinitionList returns a new resource list.
func NewDaemonSetList ¶
func NewDaemonSetList(c Connection, ns string) List
NewDaemonSetList returns a new resource list.
func NewDeploymentList ¶
func NewDeploymentList(c Connection, ns string) List
NewDeploymentList returns a new resource list.
func NewEndpointsList ¶
func NewEndpointsList(c Connection, ns string) List
NewEndpointsList returns a new resource list.
func NewEventList ¶
func NewEventList(c Connection, ns string) List
NewEventList returns a new resource list.
func NewHorizontalPodAutoscalerList ¶
func NewHorizontalPodAutoscalerList(c Connection, ns string) List
NewHorizontalPodAutoscalerList returns a new resource list.
func NewHorizontalPodAutoscalerV1List ¶
func NewHorizontalPodAutoscalerV1List(c Connection, ns string) List
NewHorizontalPodAutoscalerV1List returns a new resource list.
func NewHorizontalPodAutoscalerV2Beta1List ¶
func NewHorizontalPodAutoscalerV2Beta1List(c Connection, ns string) List
NewHorizontalPodAutoscalerV2Beta1List returns a new resource list.
func NewIngressList ¶
func NewIngressList(c Connection, ns string) List
NewIngressList returns a new resource list.
func NewJobList ¶
func NewJobList(c Connection, ns string) List
NewJobList returns a new resource list.
func NewNamespaceList ¶
func NewNamespaceList(c Connection, ns string) List
NewNamespaceList returns a new resource list.
func NewNetworkPolicyList ¶
func NewNetworkPolicyList(c Connection, ns string) List
NewNetworkPolicyList returns a new resource list.
func NewNodeList ¶
func NewNodeList(c Connection, _ string) List
NewNodeList returns a new resource list.
func NewPDBList ¶
func NewPDBList(c Connection, ns string) List
NewPDBList returns a new resource list.
func NewPersistentVolumeClaimList ¶
func NewPersistentVolumeClaimList(c Connection, ns string) List
NewPersistentVolumeClaimList returns a new resource list.
func NewPersistentVolumeList ¶
func NewPersistentVolumeList(c Connection, ns string) List
NewPersistentVolumeList returns a new resource list.
func NewPodList ¶
func NewPodList(c Connection, ns string) List
NewPodList returns a new resource list.
func NewReplicaSetList ¶
func NewReplicaSetList(c Connection, ns string) List
NewReplicaSetList returns a new resource list.
func NewReplicationControllerList ¶
func NewReplicationControllerList(c Connection, ns string) List
NewReplicationControllerList returns a new resource list.
func NewRoleBindingList ¶
func NewRoleBindingList(c Connection, ns string) List
NewRoleBindingList returns a new resource list.
func NewRoleList ¶
func NewRoleList(c Connection, ns string) List
NewRoleList returns a new resource list.
func NewSecretList ¶
func NewSecretList(c Connection, ns string) List
NewSecretList returns a new resource list.
func NewServiceAccountList ¶
func NewServiceAccountList(c Connection, ns string) List
NewServiceAccountList returns a new resource list.
func NewServiceList ¶
func NewServiceList(c Connection, ns string) List
NewServiceList returns a new resource list.
func NewStatefulSetList ¶
func NewStatefulSetList(c Connection, ns string) List
NewStatefulSetList returns a new resource list.
type LogOptions ¶
type LogOptions struct { Fqn Lines int64 Previous bool Color color.Paint SingleContainer bool MultiPods bool }
LogOptions represent logger options.
func (LogOptions) DecorateLog ¶
func (o LogOptions) DecorateLog(msg string) string
DecorateLog add a log header to display po/co information along with the log message.
func (LogOptions) FixedSizeName ¶
func (o LogOptions) FixedSizeName() string
FixedSizeName returns a normalize fixed size pod name if possible.
func (LogOptions) HasContainer ¶
func (o LogOptions) HasContainer() bool
HasContainer checks if a container is present.
type MetricsServer ¶
type MetricsServer interface { MetricsService ClusterLoad(nodes k8s.Collection, metrics k8s.Collection, cmx *k8s.ClusterMetrics) NodesMetrics(k8s.Collection, *mv1beta1.NodeMetricsList, k8s.NodesMetrics) PodsMetrics(*mv1beta1.PodMetricsList, k8s.PodsMetrics) }
MetricsServer gather metrics information from pods and nodes.
type MetricsService ¶
type MetricsService interface { HasMetrics() bool FetchNodesMetrics() (*mv1beta1.NodeMetricsList, error) FetchPodsMetrics(ns string) (*mv1beta1.PodMetricsList, error) }
MetricsService calls the metrics server for metrics info.
type Namespace ¶
type Namespace struct { *Base // contains filtered or unexported fields }
Namespace tracks a kubernetes resource.
func NewNamespace ¶
func NewNamespace(c Connection) *Namespace
NewNamespace instantiates a new Namespace.
type NetworkPolicy ¶
type NetworkPolicy struct { *Base // contains filtered or unexported fields }
NetworkPolicy tracks a kubernetes resource.
func NewNetworkPolicy ¶
func NewNetworkPolicy(c Connection) *NetworkPolicy
NewNetworkPolicy instantiates a new NetworkPolicy.
func (*NetworkPolicy) Fields ¶
func (r *NetworkPolicy) Fields(ns string) Row
Fields retrieves displayable fields.
func (*NetworkPolicy) Header ¶
func (*NetworkPolicy) Header(ns string) Row
Header return resource header.
func (*NetworkPolicy) Marshal ¶
func (r *NetworkPolicy) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*NetworkPolicy) New ¶
func (r *NetworkPolicy) New(i interface{}) Columnar
New builds a new NetworkPolicy instance from a k8s resource.
type Node ¶
type Node struct { *Base // contains filtered or unexported fields }
Node tracks a kubernetes resource.
func (*Node) SetNodeMetrics ¶
func (r *Node) SetNodeMetrics(m *mv1beta1.NodeMetrics)
SetNodeMetrics set the current k8s resource metrics on a given node.
type PersistentVolume ¶
type PersistentVolume struct { *Base // contains filtered or unexported fields }
PersistentVolume tracks a kubernetes resource.
func NewPersistentVolume ¶
func NewPersistentVolume(c Connection) *PersistentVolume
NewPersistentVolume instantiates a new PersistentVolume.
func (*PersistentVolume) Fields ¶
func (r *PersistentVolume) Fields(ns string) Row
Fields retrieves displayable fields.
func (*PersistentVolume) Header ¶
func (*PersistentVolume) Header(ns string) Row
Header return resource header.
func (*PersistentVolume) Marshal ¶
func (r *PersistentVolume) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*PersistentVolume) New ¶
func (r *PersistentVolume) New(i interface{}) Columnar
New builds a new PersistentVolume instance from a k8s resource.
type PersistentVolumeClaim ¶
type PersistentVolumeClaim struct { *Base // contains filtered or unexported fields }
PersistentVolumeClaim tracks a kubernetes resource.
func NewPersistentVolumeClaim ¶
func NewPersistentVolumeClaim(c Connection) *PersistentVolumeClaim
NewPersistentVolumeClaim instantiates a new PersistentVolumeClaim.
func (*PersistentVolumeClaim) Fields ¶
func (r *PersistentVolumeClaim) Fields(ns string) Row
Fields retrieves displayable fields.
func (*PersistentVolumeClaim) Header ¶
func (*PersistentVolumeClaim) Header(ns string) Row
Header return resource header.
func (*PersistentVolumeClaim) Marshal ¶
func (r *PersistentVolumeClaim) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*PersistentVolumeClaim) New ¶
func (r *PersistentVolumeClaim) New(i interface{}) Columnar
New builds a new PersistentVolumeClaim instance from a k8s resource.
type Pod ¶
type Pod struct { *Base // contains filtered or unexported fields }
Pod that can be displayed in a table and interacted with.
func (*Pod) Containers ¶
Containers lists out all the docker containers name contained in a pod.
func (*Pod) SetPodMetrics ¶
func (r *Pod) SetPodMetrics(m *mv1beta1.PodMetrics)
SetPodMetrics set the current k8s resource metrics on a given pod.
type PodDisruptionBudget ¶
type PodDisruptionBudget struct { *Base // contains filtered or unexported fields }
PodDisruptionBudget that can be displayed in a table and interacted with.
func (*PodDisruptionBudget) Fields ¶
func (r *PodDisruptionBudget) Fields(ns string) Row
Fields retrieves displayable fields.
func (*PodDisruptionBudget) Header ¶
func (*PodDisruptionBudget) Header(ns string) Row
Header return resource header.
func (*PodDisruptionBudget) Marshal ¶
func (r *PodDisruptionBudget) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*PodDisruptionBudget) New ¶
func (r *PodDisruptionBudget) New(i interface{}) Columnar
New builds a new PDB instance from a k8s resource.
type Properties ¶
type Properties map[string]interface{}
Properties a collection of extra properties on a K8s resource.
type ReplicaSet ¶
type ReplicaSet struct { *Base // contains filtered or unexported fields }
ReplicaSet tracks a kubernetes resource.
func NewReplicaSet ¶
func NewReplicaSet(c Connection) *ReplicaSet
NewReplicaSet instantiates a new ReplicaSet.
func (*ReplicaSet) Fields ¶
func (r *ReplicaSet) Fields(ns string) Row
Fields retrieves displayable fields.
func (*ReplicaSet) Marshal ¶
func (r *ReplicaSet) Marshal(path string) (string, error)
Marshal a deployment given a namespaced name.
func (*ReplicaSet) New ¶
func (r *ReplicaSet) New(i interface{}) Columnar
New builds a new ReplicaSet instance from a k8s resource.
type ReplicationController ¶
type ReplicationController struct { *Base // contains filtered or unexported fields }
ReplicationController tracks a kubernetes resource.
func NewReplicationController ¶
func NewReplicationController(c Connection) *ReplicationController
NewReplicationController instantiates a new ReplicationController.
func (*ReplicationController) Fields ¶
func (r *ReplicationController) Fields(ns string) Row
Fields retrieves displayable fields.
func (*ReplicationController) Header ¶
func (*ReplicationController) Header(ns string) Row
Header return resource header.
func (*ReplicationController) Marshal ¶
func (r *ReplicationController) Marshal(path string) (string, error)
Marshal a deployment given a namespaced name.
func (*ReplicationController) New ¶
func (r *ReplicationController) New(i interface{}) Columnar
New builds a new ReplicationController instance from a k8s resource.
type Resource ¶
type Resource interface { New(interface{}) Columnar Get(path string) (Columnar, error) List(ns string) (Columnars, error) Delete(path string, cascade, force bool) error Describe(kind, pa string) (string, error) Marshal(pa string) (string, error) Header(ns string) Row NumCols(ns string) map[string]bool SetFieldSelector(string) SetLabelSelector(string) GetFieldSelector() string GetLabelSelector() string HasSelectors() bool }
Resource represents a tabular Kubernetes resource.
type Role ¶
type Role struct { *Base // contains filtered or unexported fields }
Role tracks a kubernetes resource.
type RoleBinding ¶
type RoleBinding struct { *Base // contains filtered or unexported fields }
RoleBinding tracks a kubernetes resource.
func NewRoleBinding ¶
func NewRoleBinding(c Connection) *RoleBinding
NewRoleBinding instantiates a new RoleBinding.
func (*RoleBinding) Fields ¶
func (r *RoleBinding) Fields(ns string) Row
Fields retrieves displayable fields.
func (*RoleBinding) Header ¶
func (*RoleBinding) Header(ns string) Row
Header return resource header.
func (*RoleBinding) Marshal ¶
func (r *RoleBinding) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*RoleBinding) New ¶
func (r *RoleBinding) New(i interface{}) Columnar
New builds a new RoleBinding instance from a k8s resource.
type RowEvent ¶
RowEvent represents a call for action after a resource reconciliation. Tracks whether a resource got added, deleted or updated.
type Secret ¶
type Secret struct { *Base // contains filtered or unexported fields }
Secret tracks a kubernetes resource.
type Service ¶
type Service struct { *Base // contains filtered or unexported fields }
Service tracks a kubernetes resource.
type ServiceAccount ¶
type ServiceAccount struct { *Base // contains filtered or unexported fields }
ServiceAccount represents a Kubernetes resource.
func NewServiceAccount ¶
func NewServiceAccount(c Connection) *ServiceAccount
NewServiceAccount instantiates a new ServiceAccount.
func (*ServiceAccount) Fields ¶
func (r *ServiceAccount) Fields(ns string) Row
Fields retrieves displayable fields.
func (*ServiceAccount) Header ¶
func (*ServiceAccount) Header(ns string) Row
Header return resource header.
func (*ServiceAccount) Marshal ¶
func (r *ServiceAccount) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*ServiceAccount) New ¶
func (r *ServiceAccount) New(i interface{}) Columnar
New builds a new ServiceAccount instance from a k8s resource.
type StatefulSet ¶
type StatefulSet struct { *Base // contains filtered or unexported fields }
StatefulSet tracks a kubernetes resource.
func NewStatefulSet ¶
func NewStatefulSet(c Connection) *StatefulSet
NewStatefulSet instantiates a new StatefulSet.
func (*StatefulSet) Fields ¶
func (r *StatefulSet) Fields(ns string) Row
Fields retrieves displayable fields.
func (*StatefulSet) Header ¶
func (*StatefulSet) Header(ns string) Row
Header return resource header.
func (*StatefulSet) Logs ¶
func (r *StatefulSet) Logs(ctx context.Context, c chan<- string, opts LogOptions) error
Logs tail logs for all pods represented by this statefulset.
func (*StatefulSet) Marshal ¶
func (r *StatefulSet) Marshal(path string) (string, error)
Marshal resource to yaml.
func (*StatefulSet) New ¶
func (r *StatefulSet) New(i interface{}) Columnar
New builds a new StatefulSet instance from a k8s resource.
type Switchable ¶
Switchable represents a switchable resource.
type SwitchableCruder ¶
type SwitchableCruder interface { Cruder Switchable }
SwitchableCruder represents a resource that can be switched.
type Tailable ¶
type Tailable interface {
Logs(ctx context.Context, c chan<- string, opts LogOptions) error
}
Tailable represents a resource with tailable logs.
type TailableResource ¶
TailableResource is a resource that have tailable logs.
Source Files
¶
- base.go
- cluster.go
- cm.go
- container.go
- context.go
- cr.go
- cr_binding.go
- crd.go
- cronjob.go
- custom.go
- dp.go
- ds.go
- ep.go
- evt.go
- helpers.go
- hpa_v1.go
- hpa_v2beta1.go
- hpa_v2beta2.go
- ing.go
- job.go
- list.go
- log_options.go
- no.go
- np.go
- ns.go
- pdb.go
- pod.go
- pv.go
- pvc.go
- rc.go
- ro.go
- ro_binding.go
- rs.go
- sa.go
- secret.go
- sts.go
- svc.go