Documentation ¶
Index ¶
- Constants
- Variables
- func BenchConfigFor(benchFile, path string) config.BenchConfig
- func Describe(c client.Connection, gvr client.GVR, path string) (string, error)
- func EnsureHelmConfig(conn client.Connection, ns string) (*action.Configuration, error)
- func FQN(ns, n string) string
- func FetchNode(ctx context.Context, f Factory, path string) (*v1.Node, error)
- func FetchNodes(ctx context.Context, f Factory, labelsSel string) (*v1.NodeList, error)
- func GetDefaultLogContainer(m metav1.ObjectMeta, spec v1.PodSpec) (string, bool)
- func GetJsonPatch(imageSpecs ImageSpecs) ([]byte, error)
- func GetTemplateJsonPatch(imageSpecs ImageSpecs) ([]byte, error)
- func IsCRD(r v1.APIResource) bool
- func IsFuzzySelector(s string) bool
- func IsInverseSelector(s string) bool
- func IsK8sMeta(m metav1.APIResource) bool
- func IsK9sMeta(m metav1.APIResource) bool
- func ListImages(client internalapi.ImageManagerService, image string) (*pb.ListImagesResponse, error)
- func MetaFQN(m metav1.ObjectMeta) string
- func PodToKey(path string) string
- func PortForwardID(path, co, portMap string) string
- func SanitizeFilename(name string) string
- func ToYAML(o runtime.Object, showManaged bool) (string, error)
- func Truncate(str string, width int) string
- type Accessor
- type Accessors
- type Alias
- type Benchmark
- type Container
- type ContainsPodSpec
- type Context
- type Controller
- type CronJob
- type CustomResourceDefinition
- type DaemonSet
- func (d *DaemonSet) GetInstance(fqn string) (*appsv1.DaemonSet, error)
- func (d *DaemonSet) GetPodSpec(path string) (*v1.PodSpec, error)
- func (d *DaemonSet) IsHappy(ds appsv1.DaemonSet) bool
- func (d *DaemonSet) Pod(fqn string) (string, error)
- func (d *DaemonSet) Restart(ctx context.Context, path string) error
- func (d *DaemonSet) Scan(ctx context.Context, gvr, fqn string, wait bool) (Refs, error)
- func (d *DaemonSet) ScanSA(ctx context.Context, fqn string, wait bool) (Refs, error)
- func (d *DaemonSet) SetImages(ctx context.Context, path string, imageSpecs ImageSpecs) error
- func (d *DaemonSet) TailLogs(ctx context.Context, opts *LogOptions) ([]LogChan, error)
- type Deployment
- func (d *Deployment) GetPodSpec(path string) (*v1.PodSpec, error)
- func (d *Deployment) IsHappy(dp appsv1.Deployment) bool
- func (*Deployment) Load(f Factory, fqn string) (*appsv1.Deployment, error)
- func (d *Deployment) Pod(fqn string) (string, error)
- func (d *Deployment) Restart(ctx context.Context, path string) error
- func (d *Deployment) Scale(ctx context.Context, path string, replicas int32) error
- func (d *Deployment) Scan(ctx context.Context, gvr, fqn string, wait bool) (Refs, error)
- func (d *Deployment) ScanSA(ctx context.Context, fqn string, wait bool) (Refs, error)
- func (d *Deployment) SetImages(ctx context.Context, path string, imageSpecs ImageSpecs) error
- func (d *Deployment) TailLogs(ctx context.Context, opts *LogOptions) ([]LogChan, error)
- type Describer
- type Dir
- type DrainOptions
- type Element
- type Factory
- type Generic
- func (g *Generic) Delete(ctx context.Context, path string, propagation *metav1.DeletionPropagation, ...) error
- func (g *Generic) Describe(path string) (string, error)
- func (g *Generic) Get(ctx context.Context, path string) (runtime.Object, error)
- func (g *Generic) List(ctx context.Context, ns string) ([]runtime.Object, error)
- func (g *Generic) ToYAML(path string, showManaged bool) (string, error)
- type Getter
- type Helm
- func (h *Helm) Delete(_ context.Context, path string, _ *metav1.DeletionPropagation, force bool) error
- func (h *Helm) Describe(path string) (string, error)
- func (h *Helm) Get(_ context.Context, path string) (runtime.Object, error)
- func (h *Helm) GetValues(path string, allValues bool) ([]byte, error)
- func (h *Helm) List(ctx context.Context, ns string) ([]runtime.Object, error)
- func (h *Helm) ToYAML(path string, showManaged bool) (string, error)
- type HelmHistory
- type HelmRepository
- type HelmResource
- type Image
- type ImageSpec
- type ImageSpecs
- type ImagesSpec
- type Job
- func (j *Job) List(ctx context.Context, ns string) ([]runtime.Object, error)
- func (j *Job) Scan(ctx context.Context, gvr, fqn string, wait bool) (Refs, error)
- func (j *Job) ScanSA(ctx context.Context, fqn string, wait bool) (Refs, error)
- func (j *Job) TailLogs(ctx context.Context, opts *LogOptions) ([]LogChan, error)
- type JsonPatch
- type Lister
- type LogChan
- type LogItem
- type LogItems
- func (l *LogItems) Add(ii ...*LogItem)
- func (l *LogItems) Clear()
- func (l *LogItems) DumpDebug(m string)
- func (l *LogItems) Filter(index int, q string, showTime bool) ([]int, [][]int, error)
- func (l *LogItems) Items() []*LogItem
- func (l *LogItems) Len() int
- func (l *LogItems) Lines(index int, showTime bool, ll [][]byte)
- func (l *LogItems) Merge(n *LogItems)
- func (l *LogItems) Render(index int, showTime bool, ll [][]byte)
- func (l *LogItems) Shift(i *LogItem)
- func (l *LogItems) StrLines(index int, showTime bool) []string
- func (l *LogItems) Subset(index int) *LogItems
- type LogOptions
- func (o *LogOptions) Clone() *LogOptions
- func (o *LogOptions) HasContainer() bool
- func (o *LogOptions) Info() string
- func (o *LogOptions) ToErrLogItem(err error) *LogItem
- func (o *LogOptions) ToLogItem(bytes []byte) *LogItem
- func (o *LogOptions) ToPodLogOptions() *v1.PodLogOptions
- func (o *LogOptions) ToggleAllContainers()
- type Loggable
- type Logger
- type Meta
- type Namespace
- type Node
- func (n *Node) CountPods(nodeName string) (int, error)
- func (n *Node) Drain(path string, opts DrainOptions, w io.Writer) error
- func (n *Node) Get(ctx context.Context, path string) (runtime.Object, error)
- func (n *Node) GetPods(nodeName string) ([]*v1.Pod, error)
- func (n *Node) List(ctx context.Context, ns string) ([]runtime.Object, error)
- func (n *Node) ToggleCordon(path string, cordon bool) error
- type NodeMaintainer
- type NodeMetricsFunc
- type NonResource
- type Nuker
- type Pod
- func (p *Pod) Containers(path string, includeInit bool) ([]string, error)
- func (p *Pod) Get(ctx context.Context, path string) (runtime.Object, error)
- func (p *Pod) GetInstance(fqn string) (*v1.Pod, error)
- func (p *Pod) GetPodSpec(path string) (*v1.PodSpec, error)
- func (p *Pod) IsHappy(po v1.Pod) bool
- func (p *Pod) List(ctx context.Context, ns string) ([]runtime.Object, error)
- func (p *Pod) Logs(path string, opts *v1.PodLogOptions) (*restclient.Request, error)
- func (p *Pod) Pod(fqn string) (string, error)
- func (p *Pod) Scan(ctx context.Context, gvr, fqn string, wait bool) (Refs, error)
- func (p *Pod) ScanSA(ctx context.Context, fqn string, wait bool) (Refs, error)
- func (p *Pod) SetImages(ctx context.Context, path string, imageSpecs ImageSpecs) error
- func (p *Pod) TailLogs(ctx context.Context, opts *LogOptions) ([]LogChan, error)
- type PodSpec
- type Policy
- type Popeye
- type PortForward
- type PortForwarder
- func (p *PortForwarder) Active() bool
- func (p *PortForwarder) Age() string
- func (p *PortForwarder) Container() string
- func (p *PortForwarder) ContainerPort() string
- func (p *PortForwarder) FQN() string
- func (p *PortForwarder) HasPortMapping(portMap string) bool
- func (p *PortForwarder) ID() string
- func (p *PortForwarder) LocalPort() string
- func (p *PortForwarder) Port() string
- func (p *PortForwarder) SetActive(b bool)
- func (p *PortForwarder) Start(path string, tt port.PortTunnel) (*portforward.PortForwarder, error)
- func (p *PortForwarder) Stop()
- type Pulse
- type Rbac
- type Ref
- type RefScanner
- type Reference
- func (r *Reference) Get(ctx context.Context, path string) (runtime.Object, error)
- func (r *Reference) List(ctx context.Context, ns string) ([]runtime.Object, error)
- func (r *Reference) Scan(ctx context.Context) ([]runtime.Object, error)
- func (r *Reference) ScanSA(ctx context.Context) ([]runtime.Object, error)
- type Refs
- type ReplicaSet
- type Resource
- type ResourceMetas
- type RestMapper
- type Restartable
- type Runnable
- type Scalable
- type ScreenDump
- type Service
- type Spec
- type StatefulSet
- func (s *StatefulSet) GetPodSpec(path string) (*v1.PodSpec, error)
- func (s *StatefulSet) IsHappy(sts appsv1.StatefulSet) bool
- func (*StatefulSet) Load(f Factory, fqn string) (*appsv1.StatefulSet, error)
- func (s *StatefulSet) Pod(fqn string) (string, error)
- func (s *StatefulSet) Restart(ctx context.Context, path string) error
- func (s *StatefulSet) Scale(ctx context.Context, path string, replicas int32) error
- func (s *StatefulSet) Scan(ctx context.Context, gvr, fqn string, wait bool) (Refs, error)
- func (s *StatefulSet) ScanSA(ctx context.Context, fqn string, wait bool) (Refs, error)
- func (s *StatefulSet) SetImages(ctx context.Context, path string, imageSpecs ImageSpecs) error
- func (s *StatefulSet) TailLogs(ctx context.Context, opts *LogOptions) ([]LogChan, error)
- type Subject
- type Switchable
- type Table
- type VirtualMachine
Constants ¶
const CRD = "crd"
CRD identifies a CRD.
const (
DefaultContainerdSocket = "unix:///run/k3s/containerd/containerd.sock"
)
Variables ¶
var (
BenchRx = regexp.MustCompile(`[:|]+`)
)
var ItemEOF = new(LogItem)
var MetaAccess = NewMeta()
MetaAccess tracks resources metadata.
var RestMapping = &RestMapper{}
RestMapping holds k8s resource mapping.
Functions ¶
func BenchConfigFor ¶
func BenchConfigFor(benchFile, path string) config.BenchConfig
BenchConfigFor returns a custom bench spec if defined otherwise returns the default one.
func EnsureHelmConfig ¶
func EnsureHelmConfig(conn client.Connection, ns string) (*action.Configuration, error)
EnsureHelmConfig return a new configuration.
func FetchNodes ¶
FetchNodes retrieves all nodes.
func GetDefaultLogContainer ¶
GetDefaultLogContainer returns a container name if specified in an annotation.
func GetJsonPatch ¶
func GetJsonPatch(imageSpecs ImageSpecs) ([]byte, error)
GetJsonPatch returns container image patch.
func GetTemplateJsonPatch ¶
func GetTemplateJsonPatch(imageSpecs ImageSpecs) ([]byte, error)
GetTemplateJsonPatch builds a json patch string to update PodSpec images.
func IsFuzzySelector ¶
IsFuzzySelector checks if filter is fuzzy or not.
func IsInverseSelector ¶
IsInverseSelector checks if inverse char has been provided.
func ListImages ¶
func ListImages(client internalapi.ImageManagerService, image string) (*pb.ListImagesResponse, error)
ListImages sends a ListImagesRequest to the server, and parses the returned ListImagesResponse.
func MetaFQN ¶
func MetaFQN(m metav1.ObjectMeta) string
MetaFQN returns a fully qualified resource name.
func PortForwardID ¶
PortForwardID computes port-forward identifier.
func SanitizeFilename ¶
SanitizeFilename sanitizes the dump filename.
Types ¶
type Accessor ¶
type Accessor interface { Lister Getter // Init the resource with a factory object. Init(Factory, client.GVR) // GVR returns a gvr a string. GVR() string }
Accessor represents an accessible k8s resource.
type Alias ¶
type Alias struct { NonResource *config.Aliases }
Alias tracks standard and custom command aliases.
type Benchmark ¶
type Benchmark struct {
NonResource
}
Benchmark represents a benchmark resource.
func (*Benchmark) Delete ¶
func (b *Benchmark) Delete(_ context.Context, path string, _ *metav1.DeletionPropagation, force bool) error
Delete nukes a resource.
type Container ¶
type Container struct {
NonResource
}
Container represents a pod's container dao.
type ContainsPodSpec ¶
type ContainsPodSpec interface { // Get PodSpec of a resource GetPodSpec(path string) (*v1.PodSpec, error) // Set Images for a resource SetImages(ctx context.Context, path string, imageSpecs ImageSpecs) error }
ContainsPodSpec represents a resource with a pod template.
type Context ¶
type Context struct {
NonResource
}
Context represents a kubernetes context.
func (*Context) MustCurrentContextName ¶
MustCurrentContextName return the active context name.
type Controller ¶
type Controller interface { // Pod returns a pod instance matching the selector. Pod(path string) (string, error) }
Controller represents a pod controller.
type CronJob ¶
type CronJob struct {
Generic
}
CronJob represents a cronjob K8s resource.
type CustomResourceDefinition ¶
type CustomResourceDefinition struct {
Resource
}
CustomResourceDefinition represents a CRD resource model.
type DaemonSet ¶
type DaemonSet struct {
Resource
}
DaemonSet represents a K8s daemonset.
func (*DaemonSet) GetInstance ¶
GetInstance returns a daemonset instance.
func (*DaemonSet) GetPodSpec ¶
GetPodSpec returns a pod spec given a resource.
type Deployment ¶
type Deployment struct {
Resource
}
Deployment represents a deployment K8s resource.
func (*Deployment) GetPodSpec ¶
func (d *Deployment) GetPodSpec(path string) (*v1.PodSpec, error)
GetPodSpec returns a pod spec given a resource.
func (*Deployment) IsHappy ¶
func (d *Deployment) IsHappy(dp appsv1.Deployment) bool
IsHappy check for happy deployments.
func (*Deployment) Load ¶
func (*Deployment) Load(f Factory, fqn string) (*appsv1.Deployment, error)
Load returns a deployment instance.
func (*Deployment) Pod ¶
func (d *Deployment) Pod(fqn string) (string, error)
Pod returns a pod victim by name.
func (*Deployment) Restart ¶
func (d *Deployment) Restart(ctx context.Context, path string) error
Restart a Deployment rollout.
func (*Deployment) SetImages ¶
func (d *Deployment) SetImages(ctx context.Context, path string, imageSpecs ImageSpecs) error
SetImages sets container images.
func (*Deployment) TailLogs ¶
func (d *Deployment) TailLogs(ctx context.Context, opts *LogOptions) ([]LogChan, error)
TailLogs tail logs for all pods represented by this Deployment.
type Describer ¶
type Describer interface { // Describe describes a resource. Describe(path string) (string, error) // ToYAML dumps a resource to YAML. ToYAML(path string, showManaged bool) (string, error) }
Describer describes a resource.
type Dir ¶
type Dir struct {
NonResource
}
Dir tracks standard and custom command aliases.
type DrainOptions ¶
type DrainOptions struct { GracePeriodSeconds int Timeout time.Duration IgnoreAllDaemonSets bool DeleteEmptyDirData bool Force bool }
DrainOptions tracks drain attributes.
type Factory ¶
type Factory interface { // Client retrieves an api client. Client() client.Connection // Get fetch a given resource. Get(gvr, path string, wait bool, sel labels.Selector) (runtime.Object, error) // List fetch a collection of resources. List(gvr, ns string, wait bool, sel labels.Selector) ([]runtime.Object, error) // ForResource fetch an informer for a given resource. ForResource(ns, gvr string) (informers.GenericInformer, error) // CanForResource fetch an informer for a given resource if authorized CanForResource(ns, gvr string, verbs []string) (informers.GenericInformer, error) // WaitForCacheSync synchronize the cache. WaitForCacheSync() // DeleteForwarder deletes a pod forwarder. DeleteForwarder(path string) // Forwards returns all portforwards. Forwarders() watch.Forwarders }
Factory represents a resource factory.
type Generic ¶
type Generic struct {
NonResource
}
Generic represents a generic resource.
func (*Generic) Delete ¶
func (g *Generic) Delete(ctx context.Context, path string, propagation *metav1.DeletionPropagation, force bool) error
Delete deletes a resource.
type Getter ¶
type Getter interface { // Get return a given resource. Get(ctx context.Context, path string) (runtime.Object, error) }
Getter represents a resource getter.
type Helm ¶
type Helm struct {
NonResource
}
Helm represents a helm chart.
func (*Helm) Delete ¶
func (h *Helm) Delete(_ context.Context, path string, _ *metav1.DeletionPropagation, force bool) error
Delete uninstall a Helm.
type HelmHistory ¶
type HelmHistory struct {
NonResource
}
HelmHistory represents a helm chart.
type HelmRepository ¶
type HelmRepository struct { NonResource Repository *repo.Entry `json:"repository"` }
HelmRepository represents a helm chart.
type HelmResource ¶
type HelmResource struct {
NonResource
}
HelmResource represents helm resources.
type Image ¶
type Image struct {
NonResource
}
Image represents a helm chart.
type ImageSpecs ¶
type ImageSpecs []ImageSpec
ImageSpecs represents a collection of container images.
type ImagesSpec ¶
type ImagesSpec struct { SetElementOrderContainers []Element `json:"$setElementOrder/containers,omitempty"` SetElementOrderInitContainers []Element `json:"$setElementOrder/initContainers,omitempty"` Containers []Element `json:"containers,omitempty"` InitContainers []Element `json:"initContainers,omitempty"` }
ImagesSpec tracks container image updates.
type Job ¶
type Job struct {
Resource
}
Job represents a K8s job resource.
type JsonPatch ¶
type JsonPatch struct {
Spec Spec `json:"spec"`
}
JsonPatch track pod spec updates.
type Lister ¶
type Lister interface { // List returns a resource collection. List(ctx context.Context, ns string) ([]runtime.Object, error) }
Lister represents a resource lister.
type LogItem ¶
LogItem represents a container log line.
func NewLogItemFromString ¶
NewLogItemFromString returns a new item.
func (*LogItem) GetTimestamp ¶
GetTimestamp fetch log lime timestamp
type LogItems ¶
type LogItems struct {
// contains filtered or unexported fields
}
LogItems represents a collection of log items.
type LogOptions ¶
type LogOptions struct { CreateDuration time.Duration Path string Container string DefaultContainer string SinceTime string Lines int64 SinceSeconds int64 Head bool Previous bool SingleContainer bool MultiPods bool ShowTimestamp bool AllContainers bool }
LogOptions represents logger options.
func (*LogOptions) HasContainer ¶
func (o *LogOptions) HasContainer() bool
HasContainer checks if a container is present.
func (*LogOptions) Info ¶
func (o *LogOptions) Info() string
Info returns the option pod and container info.
func (*LogOptions) ToErrLogItem ¶
func (o *LogOptions) ToErrLogItem(err error) *LogItem
func (*LogOptions) ToLogItem ¶
func (o *LogOptions) ToLogItem(bytes []byte) *LogItem
ToLogItem add a log header to display po/co information along with the log message.
func (*LogOptions) ToPodLogOptions ¶
func (o *LogOptions) ToPodLogOptions() *v1.PodLogOptions
ToPodLogOptions returns pod log options.
func (*LogOptions) ToggleAllContainers ¶
func (o *LogOptions) ToggleAllContainers()
ToggleAllContainers toggles single or all-containers if possible.
type Loggable ¶
type Loggable interface { // TaiLogs streams resource logs. TailLogs(ctx context.Context, opts *LogOptions) ([]LogChan, error) }
Loggable represents resources with logs.
type Logger ¶
type Logger interface { // Logs tails a resource logs. Logs(path string, opts *v1.PodLogOptions) (*restclient.Request, error) }
Logger represents a resource that exposes logs.
type Meta ¶
type Meta struct {
// contains filtered or unexported fields
}
Meta represents available resource metas.
func (*Meta) LoadResources ¶
LoadResources hydrates server preferred+CRDs resource metadata.
func (*Meta) RegisterMeta ¶
func (m *Meta) RegisterMeta(gvr string, res metav1.APIResource)
RegisterMeta registers a new resource meta object.
type Node ¶
type Node struct {
Resource
}
Node represents a node model.
type NodeMaintainer ¶
type NodeMaintainer interface { // ToggleCordon toggles cordon/uncordon a node. ToggleCordon(path string, cordon bool) error // Drain drains the given node. Drain(path string, opts DrainOptions, w io.Writer) error }
NodeMaintainer performs node maintenance operations.
type NodeMetricsFunc ¶
type NodeMetricsFunc func() (*mv1beta1.NodeMetricsList, error)
NodeMetricsFunc retrieves node metrics.
type NonResource ¶
type NonResource struct { Factory // contains filtered or unexported fields }
NonResource represents a non k8s resource.
func (*NonResource) GetFactory ¶
func (n *NonResource) GetFactory() Factory
type Nuker ¶
type Nuker interface { // Delete removes a resource from the api server. Delete(ctx context.Context, path string, propagation *metav1.DeletionPropagation, force bool) error }
Nuker represents a resource deleter.
type Pod ¶
type Pod struct {
Resource
}
Pod represents a pod resource.
func (*Pod) Containers ¶
Containers returns all container names on pod.
func (*Pod) GetInstance ¶
GetInstance returns a pod instance.
func (*Pod) GetPodSpec ¶
GetPodSpec returns a pod spec given a resource.
func (*Pod) Logs ¶
func (p *Pod) Logs(path string, opts *v1.PodLogOptions) (*restclient.Request, error)
Logs fetch container logs for a given pod and container.
type PodSpec ¶
type PodSpec struct {
Spec ImagesSpec `json:"spec"`
}
PodSpec represents a collection of container images.
type Popeye ¶
type Popeye struct {
NonResource
}
Popeye tracks cluster sanitization.
type PortForward ¶
type PortForward struct {
NonResource
}
PortForward represents a port forward dao.
func (*PortForward) Delete ¶
func (p *PortForward) Delete(_ context.Context, path string, _ *metav1.DeletionPropagation, force bool) error
Delete deletes a portforward.
type PortForwarder ¶
type PortForwarder struct { Factory genericclioptions.IOStreams // contains filtered or unexported fields }
PortForwarder tracks a port forward stream.
func NewPortForwarder ¶
func NewPortForwarder(f Factory) *PortForwarder
NewPortForwarder returns a new port forward streamer.
func (*PortForwarder) Active ¶
func (p *PortForwarder) Active() bool
Active returns the forward status.
func (*PortForwarder) Container ¶
func (p *PortForwarder) Container() string
Container returns the target's container.
func (*PortForwarder) ContainerPort ¶
func (p *PortForwarder) ContainerPort() string
ContainerPort returns the container port.
func (*PortForwarder) FQN ¶
func (p *PortForwarder) FQN() string
FQN returns the portforward unique id.
func (*PortForwarder) HasPortMapping ¶
func (p *PortForwarder) HasPortMapping(portMap string) bool
HasPortMapping checks if port mapping is defined for this fwd.
func (*PortForwarder) LocalPort ¶
func (p *PortForwarder) LocalPort() string
LocalPort returns the local port.
func (*PortForwarder) SetActive ¶
func (p *PortForwarder) SetActive(b bool)
SetActive mark a portforward as active.
func (*PortForwarder) Start ¶
func (p *PortForwarder) Start(path string, tt port.PortTunnel) (*portforward.PortForwarder, error)
Start initiates a port forward session for a given pod and ports.
type RefScanner ¶
type RefScanner interface { // Init initializes the scanner Init(Factory, client.GVR) // Scan scan the resource for references. Scan(ctx context.Context, gvr, fqn string, wait bool) (Refs, error) ScanSA(ctx context.Context, fqn string, wait bool) (Refs, error) }
RefScanner represents a resource reference scanner.
type Reference ¶
type Reference struct {
NonResource
}
Reference represents cluster resource references.
type Refs ¶
type Refs []Ref
Refs represents a collection of resource references.
func ScanForRefs ¶
ScanForRefs scans cluster resources for resource references.
type ReplicaSet ¶
type ReplicaSet struct {
Resource
}
ReplicaSet represents a replicaset K8s resource.
func (*ReplicaSet) Load ¶
func (r *ReplicaSet) Load(f Factory, path string) (*v1.ReplicaSet, error)
Load returns a given instance.
func (*ReplicaSet) Rollback ¶
func (r *ReplicaSet) Rollback(fqn string) error
Rollback reverses the last deployment.
type Resource ¶
type Resource struct {
Generic
}
Resource represents an informer based resource.
type ResourceMetas ¶
type ResourceMetas map[client.GVR]metav1.APIResource
ResourceMetas represents a collection of resource metadata.
type RestMapper ¶
type RestMapper struct {
client.Connection
}
RestMapper map resource to REST mapping ie kind, group, version.
func (*RestMapper) Name ¶
func (*RestMapper) Name() meta.RESTScopeName
Name protocol returns rest scope name.
func (*RestMapper) ResourceFor ¶
func (r *RestMapper) ResourceFor(resourceArg, kind 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 Restartable ¶
type Restartable interface { // Restart performs a rollout restart. Restart(ctx context.Context, path string) error }
Restartable represents a restartable resource.
type Scalable ¶
type Scalable interface { // Scale scales a resource up or down. Scale(ctx context.Context, path string, replicas int32) error }
Scalable represents resources that can scale.
type ScreenDump ¶
type ScreenDump struct {
NonResource
}
ScreenDump represents a scraped resources.
func (*ScreenDump) Delete ¶
func (d *ScreenDump) Delete(_ context.Context, path string, _ *metav1.DeletionPropagation, force bool) error
Delete a ScreenDump.
type Service ¶
type Service struct {
Resource
}
Service represents a k8s service.
func (*Service) GetInstance ¶
GetInstance returns a service instance.
type StatefulSet ¶
type StatefulSet struct {
Resource
}
StatefulSet represents a K8s sts.
func (*StatefulSet) GetPodSpec ¶
func (s *StatefulSet) GetPodSpec(path string) (*v1.PodSpec, error)
GetPodSpec returns a pod spec given a resource.
func (*StatefulSet) IsHappy ¶
func (s *StatefulSet) IsHappy(sts appsv1.StatefulSet) bool
IsHappy check for happy sts.
func (*StatefulSet) Load ¶
func (*StatefulSet) Load(f Factory, fqn string) (*appsv1.StatefulSet, error)
Load returns a statefulset instance.
func (*StatefulSet) Pod ¶
func (s *StatefulSet) Pod(fqn string) (string, error)
Pod returns a pod victim by name.
func (*StatefulSet) Restart ¶
func (s *StatefulSet) Restart(ctx context.Context, path string) error
Restart a StatefulSet rollout.
func (*StatefulSet) SetImages ¶
func (s *StatefulSet) SetImages(ctx context.Context, path string, imageSpecs ImageSpecs) error
SetImages sets container images.
func (*StatefulSet) TailLogs ¶
func (s *StatefulSet) TailLogs(ctx context.Context, opts *LogOptions) ([]LogChan, error)
TailLogs tail logs for all pods represented by this StatefulSet.
type Switchable ¶
Switchable represents a switchable resource.
type Table ¶
type Table struct {
Generic
}
Table retrieves K8s resources as tabular data.
type VirtualMachine ¶
type VirtualMachine struct {
Resource
}
VirtualMachine represents a helm chart.
Source Files ¶
- VM.go
- alias.go
- benchmark.go
- cluster.go
- container.go
- context.go
- crd.go
- cronjob.go
- cruiser.go
- describe.go
- dir.go
- dp.go
- ds.go
- generic.go
- helm.go
- helm_history.go
- helm_repo.go
- helm_resource.go
- helpers.go
- image.go
- job.go
- log_item.go
- log_items.go
- log_options.go
- node.go
- non_resource.go
- ns.go
- ofaas.go
- patch.go
- pod.go
- popeye.go
- port_forward.go
- port_forwarder.go
- pulse.go
- rbac.go
- rbac_policy.go
- rbac_subject.go
- reference.go
- registry.go
- resource.go
- rest_mapper.go
- rs.go
- screen_dump.go
- sts.go
- svc.go
- table.go
- types.go