k8s

package
v0.0.0-...-8acee00 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const NA = "n/a"

NA Not available

Variables

View Source
var (
	// RestMapping holds k8s resource mapping
	// BOZO!! Has to be a better way...
	RestMapping = &RestMapper{}
)

Functions

func ToMB

func ToMB(v int64) float64

ToMB converts bytes to megabytes.

Types

type APIClient

type APIClient struct {
	// contains filtered or unexported fields
}

APIClient represents a Kubernetes api client.

func InitConnectionOrDie

func InitConnectionOrDie(config *Config, logger zerolog.Logger) *APIClient

InitConnectionOrDie initialize connection from command line args. Checks for connectivity with the api server.

func (*APIClient) CanIAccess

func (a *APIClient) CanIAccess(ns, resURL string, verbs []string) (bool, error)

CanIAccess checks if user has access to a certain resource.

func (*APIClient) CheckListNSAccess

func (a *APIClient) CheckListNSAccess() error

CheckListNSAccess check if current user can list namespaces.

func (*APIClient) CheckNSAccess

func (a *APIClient) CheckNSAccess(n string) error

CheckNSAccess asserts if user can access a namespace.

func (*APIClient) Config

func (a *APIClient) Config() *Config

Config return a kubernetes configuration.

func (*APIClient) CurrentNamespaceName

func (a *APIClient) CurrentNamespaceName() (string, error)

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

func (a *APIClient) DynDialOrDie() dynamic.Interface

DynDialOrDie returns a handle to a dynamic interface.

func (*APIClient) FetchNodes

func (a *APIClient) FetchNodes() (*v1.NodeList, error)

FetchNodes returns all available nodes.

func (*APIClient) HasMetrics

func (a *APIClient) HasMetrics() bool

HasMetrics returns true if the cluster supports metrics.

func (*APIClient) IsNamespaced

func (a *APIClient) IsNamespaced(res string) bool

IsNamespaced check on server if given resource is namespaced

func (*APIClient) MXDial

func (a *APIClient) MXDial() (*versioned.Clientset, error)

MXDial returns a handle to the metrics server.

func (*APIClient) NSDialOrDie

NSDialOrDie returns a handle to a namespaced resource.

func (*APIClient) NodePods

func (a *APIClient) NodePods(node string) (*v1.PodList, error)

NodePods returns a collection of all available pods on a given node.

func (*APIClient) RestConfigOrDie

func (a *APIClient) RestConfigOrDie() *restclient.Config

RestConfigOrDie returns a rest api client.

func (*APIClient) ServerVersion

func (a *APIClient) ServerVersion() (*version.Info, error)

ServerVersion returns the current server version info.

func (*APIClient) SupportsRes

func (a *APIClient) SupportsRes(group string, versions []string) (string, bool, error)

SupportsRes checks latest supported version.

func (*APIClient) SupportsResource

func (a *APIClient) SupportsResource(group string) bool

SupportsResource checks for resource supported version against the server.

func (*APIClient) SwitchContextOrDie

func (a *APIClient) SwitchContextOrDie(ctx string)

SwitchContextOrDie handles kubeconfig context switches.

func (*APIClient) ValidNamespaces

func (a *APIClient) ValidNamespaces() ([]v1.Namespace, error)

ValidNamespaces returns all available namespaces.

type APIGroup

type APIGroup struct {
	GKV

	Resource         string
	Plural, Singular string
	Aliases          []string
}

APIGroup represents a K8s resource descriptor.

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

func (c *Cluster) ClusterName() string

ClusterName return the currently active cluster name.

func (*Cluster) ContextName

func (c *Cluster) ContextName() string

ContextName returns the currently active context.

func (*Cluster) GetNodes

func (c *Cluster) GetNodes() (*v1.NodeList, error)

GetNodes get all available nodes in the cluster.

func (*Cluster) UserName

func (c *Cluster) UserName() string

UserName returns the currently active user.

func (*Cluster) Version

func (c *Cluster) Version() (string, error)

Version returns the current cluster git version.

type ClusterMetrics

type ClusterMetrics struct {
	PercCPU float64
	PercMEM float64
}

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) Kill

func (b ClusterRole) Kill(ns, n string) error

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) Kill

func (b ClusterRoleBinding) Kill(ns, n string) error

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 Collection

type Collection []interface{}

Collection of empty interfaces.

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

func (c *Config) ClusterNameFromContext(ctx string) (string, error)

ClusterNameFromContext returns the cluster associated with the given context.

func (*Config) ClusterNames

func (c *Config) ClusterNames() ([]string, error)

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

func (c *Config) ContextNames() ([]string, error)

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

func (c *Config) CurrentClusterName() (string, error)

CurrentClusterName returns the active cluster name.

func (*Config) CurrentContextName

func (c *Config) CurrentContextName() (string, error)

CurrentContextName returns the currently active config context.

func (*Config) CurrentGroupNames

func (c *Config) CurrentGroupNames() ([]string, error)

CurrentGroupNames retrieves the active group names.

func (*Config) CurrentNamespaceName

func (c *Config) CurrentNamespaceName() (string, error)

CurrentNamespaceName retrieves the active namespace.

func (*Config) CurrentUserName

func (c *Config) CurrentUserName() (string, error)

CurrentUserName retrieves the active user name.

func (*Config) DelContext

func (c *Config) DelContext(n string) error

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

func (c *Config) NamespaceNames(nns []v1.Namespace) []string

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

func (c *Config) SwitchContext(name string) error

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) Delete

func (c *ConfigMap) Delete(ns, n string, cascade, force bool) error

Delete a ConfigMap.

func (*ConfigMap) Get

func (c *ConfigMap) Get(ns, n string) (interface{}, error)

Get a 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) Kill

func (b ConfigMap) Kill(ns, n string) error

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 NewContext

func NewContext(c Connection) *Context

NewContext returns a new Context.

func (*Context) Delete

func (c *Context) Delete(_, n string, cascade, force bool) error

Delete a Context.

func (*Context) Get

func (c *Context) Get(_, n string) (interface{}, error)

Get a 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) Kill

func (b Context) Kill(ns, n string) error

func (*Context) KubeUpdate

func (c *Context) KubeUpdate(n string) error

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

func (c *Context) MustCurrentContextName() string

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.

func (*Context) Switch

func (c *Context) Switch(ctx string) error

Switch to another context.

type CronJob

type CronJob struct {
	Connection
	// contains filtered or unexported fields
}

CronJob represents a Kubernetes CronJob.

func NewCronJob

func NewCronJob(c Connection) *CronJob

NewCronJob returns a new CronJob.

func (*CronJob) Delete

func (c *CronJob) Delete(ns, n string, cascade, force bool) error

Delete a CronJob.

func (*CronJob) Get

func (c *CronJob) Get(ns, n string) (interface{}, error)

Get a 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) Kill

func (b CronJob) Kill(ns, n string) error

func (*CronJob) List

func (c *CronJob) List(ns string) (Collection, error)

List all CronJobs in a given namespace.

func (*CronJob) Run

func (c *CronJob) Run(ns, n string) error

Run the job associated with this cronjob.

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) Kill

func (b CustomResourceDefinition) Kill(ns, n string) error

func (*CustomResourceDefinition) List

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) Delete

func (d *DaemonSet) Delete(ns, n string, cascade, force bool) error

Delete a DaemonSet.

func (*DaemonSet) Get

func (d *DaemonSet) Get(ns, n string) (interface{}, error)

Get a 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) Kill

func (b DaemonSet) Kill(ns, n string) error

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) Kill

func (b Deployment) Kill(ns, n string) error

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) Delete

func (e *Endpoints) Delete(ns, n string, cascade, force bool) error

Delete a Endpoint.

func (*Endpoints) Get

func (e *Endpoints) Get(ns, n string) (interface{}, error)

Get a Endpoint.

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) Kill

func (b Endpoints) Kill(ns, n string) error

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 NewEvent

func NewEvent(c Connection) *Event

NewEvent returns a new Event.

func (*Event) Delete

func (e *Event) Delete(ns, n string, cascade, force bool) error

Delete an Event.

func (*Event) Get

func (e *Event) Get(ns, n string) (interface{}, error)

Get a 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) Kill

func (b Event) Kill(ns, n string) error

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 GKV

type GKV struct {
	Group, Kind, Version string
}

GKV tracks api resource version info.

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) Kill

func (b HorizontalPodAutoscalerV1) Kill(ns, n string) error

func (*HorizontalPodAutoscalerV1) List

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) Kill

func (b HorizontalPodAutoscalerV2Beta1) Kill(ns, n string) error

func (*HorizontalPodAutoscalerV2Beta1) List

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) Kill

func (b HorizontalPodAutoscalerV2Beta2) Kill(ns, n string) error

func (*HorizontalPodAutoscalerV2Beta2) List

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 NewIngress

func NewIngress(c Connection) *Ingress

NewIngress returns a new Ingress.

func (*Ingress) Delete

func (i *Ingress) Delete(ns, n string, cascade, force bool) error

Delete a Ingress.

func (*Ingress) Get

func (i *Ingress) Get(ns, n string) (interface{}, error)

Get a 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) Kill

func (b Ingress) Kill(ns, n string) error

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 NewJob

func NewJob(c Connection) *Job

NewJob returns a new Job.

func (*Job) Containers

func (j *Job) Containers(ns, n string, includeInit bool) ([]string, error)

Containers returns all container names on job.

func (*Job) Delete

func (j *Job) Delete(ns, n string, cascade, force bool) error

Delete a Job.

func (*Job) Events

func (j *Job) Events(ns, n string) (*v1.EventList, error)

Events retrieved jobs events.

func (*Job) Get

func (j *Job) Get(ns, n string) (interface{}, error)

Get a 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) Kill

func (b Job) Kill(ns, n string) error

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) Kill

func (b MetricsServer) Kill(ns, n string) error

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) Delete

func (n *Namespace) Delete(_, name string, cascade, force bool) error

Delete a namespace.

func (*Namespace) Get

func (n *Namespace) Get(_, name string) (interface{}, error)

Get a active 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) Kill

func (b Namespace) Kill(ns, n string) error

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) Kill

func (b NetworkPolicy) Kill(ns, n string) error

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 NewNode

func NewNode(c Connection) *Node

NewNode returns a new Node.

func (*Node) Delete

func (n *Node) Delete(_, name string, cascade, force bool) error

Delete a node.

func (*Node) Get

func (n *Node) Get(_, name string) (interface{}, error)

Get a 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) Kill

func (b Node) Kill(ns, n string) error

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) Kill

func (b PeristentVolume) Kill(ns, n string) error

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) Kill

func (b PersistentVolumeClaim) Kill(ns, n string) error

func (*PersistentVolumeClaim) List

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 NewPod

func NewPod(c Connection) *Pod

NewPod returns a new Pod.

func (*Pod) Containers

func (p *Pod) Containers(ns, n string, includeInit bool) ([]string, error)

Containers returns all container names on pod

func (*Pod) Delete

func (p *Pod) Delete(ns, n string, cascade, force bool) error

Delete a pod.

func (*Pod) Get

func (p *Pod) Get(ns, name string) (interface{}, error)

Get a 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) Kill

func (b Pod) Kill(ns, n string) error

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) Kill

func (b PodDisruptionBudget) Kill(ns, n string) error

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) Active

func (p *PortForward) Active() bool

Active returns the forward status.

func (*PortForward) Age

func (p *PortForward) Age() string

Age returns the port forward age.

func (*PortForward) Container

func (p *PortForward) Container() string

Container returns the targetes container.

func (*PortForward) FQN

func (p *PortForward) FQN() string

FQN returns the portforward unique id.

func (*PortForward) Path

func (p *PortForward) Path() string

Path returns the pod resource path.

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.

func (*PortForward) Stop

func (p *PortForward) Stop()

Stop terminates a port forard

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) Kill

func (b ReplicaSet) Kill(ns, n string) error

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) Kill

func (b ReplicationController) Kill(ns, n string) error

func (*ReplicationController) List

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) Delete

func (r *Resource) Delete(ns, n string, cascade, force bool) error

Delete a Resource.

func (*Resource) Get

func (r *Resource) Get(ns, n string) (interface{}, error)

Get a Resource.

func (Resource) GetFieldSelector

func (b Resource) GetFieldSelector() string

GetFieldSelector returns field selector.

func (*Resource) GetInfo

func (r *Resource) GetInfo() (string, string, string)

GetInfo returns info about apigroup.

func (Resource) GetLabelSelector

func (b Resource) GetLabelSelector() string

GetLabelSelector returns label selector.

func (Resource) HasSelectors

func (b Resource) HasSelectors() bool

func (Resource) Kill

func (b Resource) Kill(ns, n string) error

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 NewRole

func NewRole(c Connection) *Role

NewRole returns a new Role.

func (*Role) Delete

func (r *Role) Delete(ns, n string, cascade, force bool) error

Delete a Role.

func (*Role) Get

func (r *Role) Get(ns, n string) (interface{}, error)

Get a 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) Kill

func (b Role) Kill(ns, n string) error

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) Kill

func (b RoleBinding) Kill(ns, n string) error

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 NewSecret

func NewSecret(c Connection) *Secret

NewSecret returns a new Secret.

func (*Secret) Delete

func (s *Secret) Delete(ns, n string, cascade, force bool) error

Delete a Secret.

func (*Secret) Get

func (s *Secret) Get(ns, n string) (interface{}, error)

Get a 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) Kill

func (b Secret) Kill(ns, n string) error

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 NewService

func NewService(c Connection) *Service

NewService returns a new Service.

func (*Service) Delete

func (s *Service) Delete(ns, n string, cascade, force bool) error

Delete a Service.

func (*Service) Get

func (s *Service) Get(ns, n string) (interface{}, error)

Get a 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) Kill

func (b Service) Kill(ns, n string) error

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) Kill

func (b ServiceAccount) Kill(ns, n string) error

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) Kill

func (b StatefulSet) Kill(ns, n string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL