Documentation
¶
Index ¶
- func CurrentContext() (string, error)
- func GetConfigMapKeyValue(ref *KeyRef, namespace string) (string, error)
- func GetSecretKeyValue(ref *KeyRef, namespace string) (string, error)
- func IstioIngress() (string, error)
- func ListLabels(resources string, namespace string, allNamespaces bool) ([]string, error)
- func ListResources(resources, namespace string, allNamespaces bool) ([]string, error)
- func Logs(container *Container, since string, previous bool) ([]byte, error)
- func MeshesHosts() ([]string, error)
- func RemoveLabels(resources string, label string, namespace string, allNamespaces bool) error
- func SaveLogs(containers *Containers, since string, previous bool)
- func SaveResourcesManifests(resources []*resource, keepStatus, decodeSecrets bool) error
- func SelectLabel(resources string, namespace string, allNamespaces bool) (string, error)
- func SelectResources(resources, namespace string, allNamespaces bool) ([]*resource, error)
- type ConfigMap
- type ConfigMaps
- type Container
- type ContainerState
- type ContainerStateEvent
- type ContainerStateRunning
- type ContainerStateTerminated
- type ContainerStateWaiting
- type ContainerStatus
- type Containers
- func (c *Containers) Contains(containerName string) bool
- func (c *Containers) CountByPod(pod string) int
- func (c *Containers) FilterExposed() *Containers
- func (c *Containers) Names() []string
- func (c *Containers) Namespaces() []string
- func (c *Containers) Pods() []string
- func (c *Containers) SelectMany() (*Containers, error)
- type Deployment
- type Deployments
- func (d *Deployments) FilterInjectable() *Deployments
- func (d *Deployments) FilterInjected() *Deployments
- func (d *Deployments) FilterUninjected() *Deployments
- func (d *Deployments) FullNames() []string
- func (d *Deployments) Get(name string) *Deployment
- func (d *Deployments) ListContainers() (*Containers, error)
- func (d *Deployments) Names() []string
- func (d *Deployments) Namespaces() []string
- func (d *Deployments) Rollout() error
- func (d *Deployments) SelectContainers() (*Containers, error)
- func (d *Deployments) SelectMany() (*Deployments, error)
- func (d *Deployments) SelectOne() (*Deployment, error)
- type Env
- type GenericResource
- type GenericResources
- type Ingress
- type IngressIP
- type Ingresses
- type IstioGateway
- type IstioGateways
- type Item
- type KeyRef
- type LoadBalancer
- type Metadata
- type Namespace
- type Namespaces
- type OwnerReference
- type Pod
- func (p *Pod) ContainsLabels(labels map[string][]string) bool
- func (p *Pod) CurrentStatus() string
- func (p *Pod) EnvironmentVariables() []*Env
- func (p *Pod) GetContainerStatus(container string) *ContainerStatus
- func (p *Pod) HasIstioSidecar() bool
- func (p *Pod) IsJob() bool
- func (p *Pod) LastState() ContainerStateEvent
- func (p *Pod) LastUpdate() *time.Time
- func (p *Pod) Ready() string
- func (p *Pod) RestartCount() int
- func (p *Pod) SelectContainerPort() (int, error)
- func (p *Pod) StatusColor() string
- type Pods
- func (s *Pods) Containers() *Containers
- func (s *Pods) Labels() map[string][]string
- func (s *Pods) Namespaces(labels map[string][]string) []string
- func (s *Pods) Pods(namespace string, labels map[string][]string) []*Pod
- func (s *Pods) SelectContainerPort(namespace string, labels map[string][]string) (int, error)
- func (s *Pods) SelectLabels() (map[string][]string, error)
- func (s *Pods) SelectMany() (*Pods, error)
- func (s *Pods) SelectNamespace(labels map[string][]string) (string, error)
- func (s *Pods) SelectOne() (*Pod, error)
- type ResourceDefinition
- type ResourcesDefinitions
- func (r *ResourcesDefinitions) APIGroups() []string
- func (r *ResourcesDefinitions) FilterAPIGroup(group string) *ResourcesDefinitions
- func (r *ResourcesDefinitions) FilterNamespaced() *ResourcesDefinitions
- func (r *ResourcesDefinitions) FilterVerbs(verb string) *ResourcesDefinitions
- func (r *ResourcesDefinitions) SelectGroups() ([]string, error)
- func (r *ResourcesDefinitions) String() string
- type Rule
- type Secret
- type Secrets
- type Service
- type Services
- type Spec
- type Status
- type StatusCondition
- type ValueFrom
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentContext ¶
func GetConfigMapKeyValue ¶
func IstioIngress ¶
func ListLabels ¶
func ListResources ¶
func MeshesHosts ¶
func RemoveLabels ¶
func SaveLogs ¶
func SaveLogs(containers *Containers, since string, previous bool)
func SaveResourcesManifests ¶
func SelectLabel ¶
func SelectResources ¶
Types ¶
type ConfigMaps ¶
type ConfigMaps struct {
Items []*ConfigMap `json:"items"`
}
func ListConfigMaps ¶
func ListConfigMaps() (*ConfigMaps, error)
func SearchConfigMap ¶
func SearchConfigMap(label string) (*ConfigMaps, error)
func (*ConfigMaps) Get ¶
func (m *ConfigMaps) Get(name string) *ConfigMap
func (*ConfigMaps) Names ¶
func (m *ConfigMaps) Names() []string
func (*ConfigMaps) SelectOne ¶
func (m *ConfigMaps) SelectOne() (*ConfigMap, error)
func (*ConfigMaps) SingleResult ¶
func (m *ConfigMaps) SingleResult() (*ConfigMap, error)
type Container ¶
type Container struct {
Namespace string
Pod string
PodTemplateHash string
Single bool
Name string `json:"name"`
Ports []*struct {
ContainerPort int `json:"containerPort"`
Name string `json:"name"`
Protocol string `json:"protocol"`
} `json:"ports"`
Args []string `json:"args"`
Command []string `json:"command"`
Env []*Env `json:"env"`
Image string `json:"image"`
ImagePullPolicy string `json:"imagePullPolicy"`
Resources struct {
Limits struct {
CPU string `json:"cpu"`
Memory string `json:"memory"`
} `json:"limits"`
Requests struct {
CPU string `json:"cpu"`
Memory string `json:"memory"`
} `json:"requests"`
} `json:"resources"`
SecurityContext struct {
AllowPrivilegeEscalation bool `json:"allowPrivilegeEscalation"`
Capabilities struct {
Drop []string `json:"drop"`
} `json:"capabilities"`
ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem"`
RunAsGroup int `json:"runAsGroup"`
RunAsNonRoot bool `json:"runAsNonRoot"`
RunAsUser int `json:"runAsUser"`
} `json:"securityContext"`
TerminationMessagePath string `json:"terminationMessagePath"`
TerminationMessagePolicy string `json:"terminationMessagePolicy"`
VolumeMounts []*struct {
MountPath string `json:"mountPath"`
Name string `json:"name"`
ReadOnly bool `json:"readOnly,omitempty"`
} `json:"volumeMounts"`
LivenessProbe struct {
FailureThreshold *int `json:"failureThreshold"`
InitialDelaySeconds *int `json:"initialDelaySeconds"`
PeriodSeconds *int `json:"periodSeconds"`
SuccessThreshold *int `json:"successThreshold"`
TimeoutSeconds *int `json:"timeoutSeconds"`
} `json:"livenessProbe"`
ReadinessProbe struct {
FailureThreshold *int `json:"failureThreshold"`
InitialDelaySeconds *int `json:"initialDelaySeconds"`
PeriodSeconds *int `json:"periodSeconds"`
SuccessThreshold *int `json:"successThreshold"`
TimeoutSeconds *int `json:"timeoutSeconds"`
} `json:"readinessProbe"`
Status *ContainerStatus
}
func (*Container) GetState ¶
func (c *Container) GetState() ContainerStateEvent
func (*Container) LastUpdateTime ¶
type ContainerState ¶
type ContainerState struct {
Running *ContainerStateRunning `json:"running"`
Terminated *ContainerStateTerminated `json:"terminated"`
Waiting *ContainerStateWaiting `json:"waiting"`
}
func (*ContainerState) Event ¶
func (s *ContainerState) Event() ContainerStateEvent
type ContainerStateEvent ¶
type ContainerStateRunning ¶
func (*ContainerStateRunning) GetColor ¶
func (c *ContainerStateRunning) GetColor() string
func (*ContainerStateRunning) GetReason ¶
func (c *ContainerStateRunning) GetReason() string
func (*ContainerStateRunning) GetTime ¶
func (c *ContainerStateRunning) GetTime() *time.Time
type ContainerStateTerminated ¶
type ContainerStateTerminated struct {
ContainerID string `json:"containerID"`
ExitCode int `json:"exitCode"`
FinishedAt *time.Time `json:"finishedAt"`
Message string `json:"message"`
Reason string `json:"reason"`
Signal int `json:"signal"`
StartedAt *time.Time `json:"startedAt"`
}
func (*ContainerStateTerminated) GetColor ¶
func (c *ContainerStateTerminated) GetColor() string
func (*ContainerStateTerminated) GetReason ¶
func (c *ContainerStateTerminated) GetReason() string
func (*ContainerStateTerminated) GetTime ¶
func (c *ContainerStateTerminated) GetTime() *time.Time
type ContainerStateWaiting ¶
func (*ContainerStateWaiting) GetColor ¶
func (c *ContainerStateWaiting) GetColor() string
func (*ContainerStateWaiting) GetReason ¶
func (c *ContainerStateWaiting) GetReason() string
func (*ContainerStateWaiting) GetTime ¶
func (c *ContainerStateWaiting) GetTime() *time.Time
type ContainerStatus ¶
type ContainerStatus struct {
ContainerID string `json:"containerID"`
Image string `json:"image"`
ImageID string `json:"imageID"`
Name string `json:"name"`
Ready bool `json:"ready"`
RestartCount int `json:"restartCount"`
Started bool `json:"started"`
LastState *ContainerState `json:"lastState"`
State *ContainerState `json:"state"`
}
func (*ContainerStatus) CurrentState ¶
func (cs *ContainerStatus) CurrentState() ContainerStateEvent
type Containers ¶
type Containers struct {
Items []*Container
}
func ListContainers ¶
func ListContainers(namespace string, allNamespaces bool, selector string) (*Containers, error)
func ListContainersByDeployment ¶
func ListContainersByDeployment(deploy *Deployment) (*Containers, error)
func (*Containers) Contains ¶
func (c *Containers) Contains(containerName string) bool
func (*Containers) CountByPod ¶
func (c *Containers) CountByPod(pod string) int
func (*Containers) FilterExposed ¶
func (c *Containers) FilterExposed() *Containers
func (*Containers) Names ¶
func (c *Containers) Names() []string
func (*Containers) Namespaces ¶
func (c *Containers) Namespaces() []string
func (*Containers) Pods ¶
func (c *Containers) Pods() []string
func (*Containers) SelectMany ¶
func (c *Containers) SelectMany() (*Containers, error)
type Deployment ¶
type Deployment struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Metadata struct {
Annotations struct {
DeploymentKubernetesIoRevision string `json:"deployment.kubernetes.io/revision"`
KubectlKubernetesIoLastAppliedConfiguration string `json:"kubectl.kubernetes.io/last-applied-configuration"`
} `json:"annotations"`
CreationTimestamp time.Time `json:"creationTimestamp"`
Generation int `json:"generation"`
Labels struct {
App string `json:"app"`
Release string `json:"release"`
Version string `json:"version"`
} `json:"labels"`
Name string `json:"name"`
Namespace string `json:"namespace"`
ResourceVersion string `json:"resourceVersion"`
SelfLink string `json:"selfLink"`
UID string `json:"uid"`
} `json:"metadata"`
Spec struct {
Replicas int `json:"replicas"`
Selector struct {
MatchLabels map[string]string `json:"matchLabels"`
} `json:"selector"`
Template struct {
Metadata struct {
Annotations map[string]string `json:"annotations"`
Labels map[string]string `json:"labels"`
} `json:"metadata"`
Spec struct {
Containers []*Container `json:"containers"`
} `json:"spec"`
} `json:"template"`
} `json:"spec"`
Status struct {
AvailableReplicas int `json:"availableReplicas"`
Conditions []*StatusCondition `json:"conditions"`
ObservedGeneration int `json:"observedGeneration"`
ReadyReplicas int `json:"readyReplicas"`
Replicas int `json:"replicas"`
UpdatedReplicas int `json:"updatedReplicas"`
} `json:"status"`
}
func (*Deployment) GetContainer ¶
func (d *Deployment) GetContainer(name string) *Container
func (*Deployment) HasIstioSidecar ¶
func (d *Deployment) HasIstioSidecar() bool
func (*Deployment) IsInjectable ¶
func (d *Deployment) IsInjectable() bool
func (*Deployment) LastUpdateTime ¶
func (d *Deployment) LastUpdateTime() *time.Time
func (*Deployment) StatusColor ¶
func (d *Deployment) StatusColor() string
type Deployments ¶
type Deployments struct {
Items []*Deployment `json:"items"`
}
func ListAllDeployments ¶
func ListAllDeployments() (*Deployments, error)
func ListDeployments ¶
func ListDeployments(namespace string, allNamespaces bool) (*Deployments, error)
func (*Deployments) FilterInjectable ¶
func (d *Deployments) FilterInjectable() *Deployments
func (*Deployments) FilterInjected ¶
func (d *Deployments) FilterInjected() *Deployments
func (*Deployments) FilterUninjected ¶
func (d *Deployments) FilterUninjected() *Deployments
func (*Deployments) FullNames ¶
func (d *Deployments) FullNames() []string
func (*Deployments) Get ¶
func (d *Deployments) Get(name string) *Deployment
func (*Deployments) ListContainers ¶
func (d *Deployments) ListContainers() (*Containers, error)
func (*Deployments) Names ¶
func (d *Deployments) Names() []string
func (*Deployments) Namespaces ¶
func (d *Deployments) Namespaces() []string
func (*Deployments) Rollout ¶
func (d *Deployments) Rollout() error
func (*Deployments) SelectContainers ¶
func (d *Deployments) SelectContainers() (*Containers, error)
func (*Deployments) SelectMany ¶
func (d *Deployments) SelectMany() (*Deployments, error)
func (*Deployments) SelectOne ¶
func (d *Deployments) SelectOne() (*Deployment, error)
type GenericResource ¶
type GenericResources ¶
type GenericResources struct {
Items []*GenericResource `json:"items"`
}
type IstioGateway ¶
type IstioGateway struct {
Metadata struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
} `json:"metadata"`
Spec struct {
Selector map[string]string `json:"selector"`
Servers []struct {
Hosts []string `json:"hosts"`
} `json:"servers"`
} `json:"spec"`
}
func ListAllIstioGateways ¶
func ListAllIstioGateways() ([]*IstioGateway, error)
type IstioGateways ¶
type IstioGateways struct {
Items []*IstioGateway `json:"items"`
}
type Item ¶
type LoadBalancer ¶
type LoadBalancer struct {
Ingresses []*IngressIP `json:"ingress"`
}
type Namespace ¶
type Namespace struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Metadata struct {
CreationTimestamp time.Time `json:"creationTimestamp"`
Name string `json:"name"`
ResourceVersion string `json:"resourceVersion"`
SelfLink string `json:"selfLink"`
UID string `json:"uid"`
Labels map[string]string `json:"labels"`
} `json:"metadata"`
Spec struct {
Finalizers []string `json:"finalizers"`
} `json:"spec"`
Status struct {
Phase string `json:"phase"`
} `json:"status"`
}
type Namespaces ¶
type Namespaces struct {
Items []*Namespace `json:"items"`
}
func ListNamespaces ¶
func ListNamespaces() (*Namespaces, error)
func (*Namespaces) Get ¶
func (n *Namespaces) Get(name string) *Namespace
func (*Namespaces) Names ¶
func (n *Namespaces) Names() []string
func (*Namespaces) SelectMany ¶
func (n *Namespaces) SelectMany() (*Namespaces, error)
func (*Namespaces) SelectOne ¶
func (n *Namespaces) SelectOne() (*Namespace, error)
type OwnerReference ¶
type Pod ¶
type Pod struct {
Metadata struct {
Labels map[string]string `json:"labels"`
Name string `json:"name"`
Namespace string `json:"namespace"`
OwnerReferences []*OwnerReference `json:"ownerReferences"`
CreationTimestamp time.Time `json:"creationTimestamp"`
} `json:"metadata"`
Spec struct {
Containers []*Container `json:"containers"`
InitContainers []*Container `json:"initContainers"`
} `json:"spec"`
Status struct {
Conditions []struct {
LastTransitionTime time.Time `json:"lastTransitionTime"`
Status string `json:"status"`
Type string `json:"type"`
} `json:"conditions"`
ContainerStatuses []*ContainerStatus `json:"containerStatuses"`
HostIP string `json:"hostIP"`
InitContainerStatuses []*ContainerStatus `json:"initContainerStatuses"`
Phase string `json:"phase"`
PodIP string `json:"podIP"`
PodIPs []struct {
IP string `json:"ip"`
} `json:"podIPs"`
QosClass string `json:"qosClass"`
StartTime time.Time `json:"startTime"`
} `json:"status"`
}
func (*Pod) CurrentStatus ¶
func (*Pod) EnvironmentVariables ¶
func (*Pod) GetContainerStatus ¶
func (p *Pod) GetContainerStatus(container string) *ContainerStatus
func (*Pod) HasIstioSidecar ¶
func (*Pod) LastState ¶
func (p *Pod) LastState() ContainerStateEvent
func (*Pod) LastUpdate ¶
func (*Pod) RestartCount ¶
func (*Pod) SelectContainerPort ¶
func (*Pod) StatusColor ¶
type Pods ¶
type Pods struct {
Items []*Pod `json:"items"`
}
func ListAllPods ¶
func (*Pods) Containers ¶
func (s *Pods) Containers() *Containers
func (*Pods) SelectContainerPort ¶
func (*Pods) SelectMany ¶
func (*Pods) SelectNamespace ¶
type ResourceDefinition ¶
type ResourceDefinition struct {
Name string
ShortNames []string
APIGroup string
Namespaced bool
Kind string
Verbs []string
}
func NewResourceDefinition ¶
func NewResourceDefinition(line string, indexes []int) (*ResourceDefinition, error)
func (*ResourceDefinition) String ¶
func (r *ResourceDefinition) String() string
type ResourcesDefinitions ¶
type ResourcesDefinitions struct {
Items []*ResourceDefinition
}
func ListResourceDefinitions ¶
func ListResourceDefinitions() (*ResourcesDefinitions, error)
func (*ResourcesDefinitions) APIGroups ¶
func (r *ResourcesDefinitions) APIGroups() []string
func (*ResourcesDefinitions) FilterAPIGroup ¶
func (r *ResourcesDefinitions) FilterAPIGroup(group string) *ResourcesDefinitions
func (*ResourcesDefinitions) FilterNamespaced ¶
func (r *ResourcesDefinitions) FilterNamespaced() *ResourcesDefinitions
func (*ResourcesDefinitions) FilterVerbs ¶
func (r *ResourcesDefinitions) FilterVerbs(verb string) *ResourcesDefinitions
func (*ResourcesDefinitions) SelectGroups ¶
func (r *ResourcesDefinitions) SelectGroups() ([]string, error)
func (*ResourcesDefinitions) String ¶
func (r *ResourcesDefinitions) String() string
type Secrets ¶
type Secrets struct {
Items []*Secret `json:"items"`
}
func ListSecrets ¶
func ListTLSSecrets ¶
func SearchSecret ¶
func (*Secrets) SelectMany ¶
func (*Secrets) SingleResult ¶
type Service ¶
type Service struct {
Metadata struct {
Labels map[string]string `json:"labels"`
Name string `json:"name"`
Namespace string `json:"namespace"`
} `json:"metadata"`
Spec struct {
Ports []struct {
NodePort int `json:"nodePort"`
Port int `json:"port"`
Protocol string `json:"protocol"`
} `json:"ports"`
Selector map[string]string `json:"selector"`
Type string `json:"type"`
} `json:"spec"`
Status struct {
LoadBalancer struct {
Ingresses []struct {
Hostname string `json:"hostname"`
IP string `json:"ip"`
} `json:"ingress"`
} `json:"loadBalancer"`
} `json:"status"`
}
func (*Service) ExternalIP ¶
type Services ¶
type Services struct {
Items []*Service `json:"items"`
}
func ListServices ¶
func (*Services) FilterByType ¶
type Status ¶
type Status struct {
LoadBalancer LoadBalancer `json:"loadBalancer"`
}
type StatusCondition ¶
Click to show internal directories.
Click to hide internal directories.