Documentation ¶
Index ¶
- Constants
- Variables
- func Capabilities(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
- func Commands(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
- func Environment(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
- func Image(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
- func InitSubCommands(rootCmd *cobra.Command)
- func Lifecycle(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
- func Ports(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string, ...) error
- func Probes(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
- func Resources(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string, ...) error
- func Restarts(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
- func Security(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
- func Status(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
- func Version(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
- func Volumes(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
- type BuilderInformation
- type Cell
- func NewCellColourFloat(colour [2]int, text string, value float64) Cell
- func NewCellColourInt(colour [2]int, text string, value int64) Cell
- func NewCellColourText(colour [2]int, text string) Cell
- func NewCellEmpty() Cell
- func NewCellFloat(text string, value float64) Cell
- func NewCellInt(text string, value int64) Cell
- func NewCellText(text string) Cell
- func NewCellTextIndent(text string, indentLevel int) Cell
- type Connector
- func (c *Connector) BuildOwnersList() []*LeafNode
- func (c *Connector) GetConfigMapValue(configMap string, key string) string
- func (c *Connector) GetConfigMaps(configMapName string) (v1.ConfigMap, error)
- func (c *Connector) GetCronJob(jobName string, namespace string) *batchv1.CronJob
- func (c *Connector) GetDaemonSet(daemonName string, namespace string) *a1.DaemonSet
- func (c *Connector) GetDeployment(deploymentName string, namespace string) *a1.Deployment
- func (c *Connector) GetJob(jobName string, namespace string) *batchv1.Job
- func (c *Connector) GetMetricPods(podNameList []string) ([]v1beta1.PodMetrics, error)
- func (c *Connector) GetNamespace(allNamespaces bool) string
- func (c *Connector) GetNodeLabels(podList []v1.Pod) (map[string]map[string]string, error)
- func (c *Connector) GetNodes(nodeNameList []string) ([]v1.Node, error)
- func (c *Connector) GetOwnersList() (map[string][]v1.Pod, map[string]string)
- func (c *Connector) GetPodAnnotations(podList []v1.Pod) (map[string]map[string]string, error)
- func (c *Connector) GetPodLabels(podList []v1.Pod) (map[string]map[string]string, error)
- func (c *Connector) GetPods(podNameList []string) ([]v1.Pod, error)
- func (c *Connector) GetReplicaSet(replicaName string, namespace string) *a1.ReplicaSet
- func (c *Connector) GetStatefulSet(statefulsetName string, namespace string) *a1.StatefulSet
- func (c *Connector) LoadConfig(configFlags *genericclioptions.ConfigFlags) error
- func (c *Connector) LoadCronJob(jobNameList []string, namespace string) error
- func (c *Connector) LoadDaemonSet(daemonNameList []string, namespace string) error
- func (c *Connector) LoadDeployment(deploymentNameList []string, namespace string) error
- func (c *Connector) LoadJob(jobNameList []string, namespace string) error
- func (c *Connector) LoadMetricConfig(configFlags *genericclioptions.ConfigFlags) error
- func (c *Connector) LoadPods(podNameList []string) error
- func (c *Connector) LoadReplicaSet(replicaNameList []string, namespace string) error
- func (c *Connector) LoadStatefulSet(statefulNameList []string, namespace string) error
- func (c *Connector) SelectMatchinghPodSpec(pods []v1.Pod) ([]v1.Pod, error)
- func (c *Connector) SetNamespace(namespace string)
- type LeafNode
- type Looper
- type ParentData
- type RowBuilder
- func (b *RowBuilder) Build(loop Looper) error
- func (b *RowBuilder) BuildContainerTable(loop Looper, info *BuilderInformation, podList []v1.Pod) error
- func (b RowBuilder) HasStdinChanged() (bool, error)
- func (b *RowBuilder) LoadHeaders(loop Looper, info *BuilderInformation) error
- func (b *RowBuilder) SetFlagsFrom(commonFlagList commonFlags)
- type Table
- func (t *Table) AddPlaceHolderRow() int
- func (t *Table) AddRow(row ...Cell)
- func (t *Table) GetRows() [][]Cell
- func (t *Table) HideColumn(columnNumber int)
- func (t *Table) HideOnlyNamedColumns(columnName []string) error
- func (t *Table) HidePlaceHolderRow(id int)
- func (t *Table) HideRows(rowID []int)
- func (t *Table) ListOutOfRange(columnID int) ([]int, error)
- func (t *Table) Order(items ...int)
- func (t *Table) Print()
- func (t *Table) PrintCsv()
- func (t *Table) PrintJson()
- func (t *Table) PrintList()
- func (t *Table) PrintYaml()
- func (t *Table) SetHeader(headItem ...string)
- func (t *Table) SortByNames(name ...string) error
- func (t *Table) UpdatePlaceHolderRow(id int, cellList []Cell)
Constants ¶
const ( COLOUR_NONE = 0 COLOUR_ERRORS = 1 COLOUR_COLUMNS = 2 COLOUR_MIX = 3 COLOUR_CUSTOM = 4 COLOUR_CUSTOMMIX = 5 )
const TypeIDContainer string = "C"
const TypeIDCronJob string = "O"
const TypeIDDaemonSet string = "A"
const TypeIDDeployment string = "D"
const TypeIDEphemeralContainer string = "E"
const TypeIDInitContainer string = "I"
const TypeIDJob string = "J"
const TypeIDNode string = "N"
const TypeIDPod string = "P"
const TypeIDReplicaSet string = "R"
const TypeIDStatefulSet string = "S"
const TypeNameContainer string = "Container"
const TypeNameCronJob string = "CronJob"
const TypeNameDaemonSet string = "DaemonSet"
const TypeNameDeployment string = "Deployment"
const TypeNameEphemeralContainer string = "EphemeralContainer"
const TypeNameInitContainer string = "InitContainer"
const TypeNameJob string = "Job"
const TypeNameNode string = "Node"
const TypeNamePod string = "Pod"
const TypeNameReplicaSet string = "ReplicaSet"
const TypeNameStatefulSet string = "StatefulSet"
Variables ¶
var LogDebug bool
Functions ¶
func Capabilities ¶ added in v0.0.19
func Capabilities(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
list details of configured liveness readiness and startup capabilities
func Commands ¶
func Commands(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
func Environment ¶ added in v0.2.0
func Environment(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
func Image ¶
func Image(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
func InitSubCommands ¶
func Lifecycle ¶ added in v0.1.0
func Lifecycle(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
func Ports ¶
func Ports(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string, runip bool) error
Ports show the port infor for each container
runip - true = show ip details only - false = show all port info except ip info
func Probes ¶
func Probes(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
list details of configured liveness readiness and startup probes
func Resources ¶
func Resources(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string, resourceType string) error
func Restarts ¶
func Restarts(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
func Security ¶ added in v0.0.19
func Security(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
list details of configured liveness readiness and startup security
func Status ¶
func Status(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
func Version ¶ added in v0.1.6
func Version(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
func Volumes ¶
func Volumes(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []string) error
Types ¶
type BuilderInformation ¶ added in v0.2.0
type Cell ¶ added in v0.0.7
type Cell struct {
// contains filtered or unexported fields
}
func NewCellColourFloat ¶ added in v0.2.11
NewCellFloat quick wrapper to return a cell object containing the given colour, string and float
func NewCellColourInt ¶ added in v0.2.11
NewCellColorInt quick wrapper to return a cell object containing the given colour, string and int
func NewCellColourText ¶ added in v0.2.11
NewCellColourText quick wrapper to return a cell object containing the given string and the colour to be used
func NewCellEmpty ¶ added in v0.2.7
func NewCellEmpty() Cell
func NewCellFloat ¶ added in v0.0.7
NewCellFloat quick wrapper to return a cell object containing the given string float
func NewCellInt ¶ added in v0.0.7
NewCellInt quick wrapper to return a cell object containing the given string and int
func NewCellText ¶ added in v0.0.7
NewCellText quick wrapper to return a cell object containing the given string
func NewCellTextIndent ¶ added in v0.2.2
NewCellTextIndent creates a text cell with an indentation indicator, this dosen't actually indent the cell it just
tells table.go Print to indent it for us
type Connector ¶ added in v0.0.13
type Connector struct { Flags commonFlags // contains filtered or unexported fields }
func (*Connector) BuildOwnersList ¶ added in v0.2.1
func (*Connector) GetConfigMapValue ¶ added in v0.0.13
func (*Connector) GetConfigMaps ¶ added in v0.0.13
func (*Connector) GetCronJob ¶ added in v0.2.4
func (*Connector) GetDaemonSet ¶ added in v0.2.1
func (*Connector) GetDeployment ¶ added in v0.2.1
func (c *Connector) GetDeployment(deploymentName string, namespace string) *a1.Deployment
func (*Connector) GetMetricPods ¶ added in v0.0.13
func (c *Connector) GetMetricPods(podNameList []string) ([]v1beta1.PodMetrics, error)
GetMetricPods get an array of pod metrics
func (*Connector) GetNamespace ¶ added in v0.0.13
GetNamespace retrieves the namespace that is currently set as default
func (*Connector) GetNodeLabels ¶ added in v0.1.5
func (*Connector) GetOwnersList ¶ added in v0.2.1
GetOwnersList calls GetOwnerReference for each pod and returns a unique list of owner types as the key with an array of pods as the value
func (*Connector) GetPodAnnotations ¶ added in v0.2.0
func (*Connector) GetPodLabels ¶ added in v0.1.5
func (*Connector) GetPods ¶ added in v0.0.13
returns a list of pods or a list with one pod when given a pod name
func (*Connector) GetReplicaSet ¶ added in v0.2.1
func (c *Connector) GetReplicaSet(replicaName string, namespace string) *a1.ReplicaSet
func (*Connector) GetStatefulSet ¶ added in v0.2.1
func (c *Connector) GetStatefulSet(statefulsetName string, namespace string) *a1.StatefulSet
func (*Connector) LoadConfig ¶ added in v0.0.13
func (c *Connector) LoadConfig(configFlags *genericclioptions.ConfigFlags) error
load config for the k8s endpoint
func (*Connector) LoadCronJob ¶ added in v0.2.4
func (*Connector) LoadDaemonSet ¶ added in v0.2.1
func (*Connector) LoadDeployment ¶ added in v0.2.1
func (*Connector) LoadMetricConfig ¶ added in v0.0.13
func (c *Connector) LoadMetricConfig(configFlags *genericclioptions.ConfigFlags) error
load config for the metrics endpoint
func (*Connector) LoadReplicaSet ¶ added in v0.2.1
func (*Connector) LoadStatefulSet ¶ added in v0.2.1
func (*Connector) SelectMatchinghPodSpec ¶ added in v0.0.18
SelectMatchingPodSpec select pods to inclue or exclude based on the field in v1.Pods.Spec an operator (!=, ==, =) and a string value to match with
func (*Connector) SetNamespace ¶ added in v0.0.13
SetNamespace sets the namespace to use when searching for pods
type Looper ¶ added in v0.2.0
type Looper interface { BuildBranch(info BuilderInformation, rows [][]Cell) ([]Cell, error) BuildContainerSpec(container v1.Container, info BuilderInformation) ([][]Cell, error) BuildEphemeralContainerSpec(container v1.EphemeralContainer, info BuilderInformation) ([][]Cell, error) BuildContainerStatus(container v1.ContainerStatus, info BuilderInformation) ([][]Cell, error) BuildPodRow(pod v1.Pod, info BuilderInformation) ([][]Cell, error) Headers() []string HideColumns(info BuilderInformation) []int }
type ParentData ¶ added in v0.2.2
type ParentData struct {
// contains filtered or unexported fields
}
type RowBuilder ¶ added in v0.2.0
type RowBuilder struct { Connection *Connector Table *Table CommonFlags commonFlags PodName []string // list of pod names to retrieve LoopStatus bool // do we need to loop over v1.Pod.Status.ContainerStatus LoopSpec bool // should we loop over v1.Pod.Spec.Containers LabelNodeName string LabelPodName string AnnotationPodName string ShowTreeView bool // show the standard tree view with the resource sets as the root ShowPodName bool ShowInitContainers bool ShowContainerType bool ShowNodeTree bool // show the tree view with the nodes at the root level rather than just the resource sets at root DontListContainers bool // dont loop through containers, only the main pod FilterList map[string]matchValue // used to filter out rows from the table during Print function CalcFiltered bool // the filterd out rows are included in the branch calculations DefaultHeaderLen int InputFilename string // filename to be used as the source instead of reading pod information from k8s api StdinChanged bool // have we been run as part of a shell redirect // contains filtered or unexported fields }
func (*RowBuilder) BuildContainerTable ¶ added in v0.2.1
func (b *RowBuilder) BuildContainerTable(loop Looper, info *BuilderInformation, podList []v1.Pod) error
Build normal table
func (RowBuilder) HasStdinChanged ¶ added in v0.2.7
func (b RowBuilder) HasStdinChanged() (bool, error)
func (*RowBuilder) LoadHeaders ¶ added in v0.2.0
func (b *RowBuilder) LoadHeaders(loop Looper, info *BuilderInformation) error
LoadHeaders sets the default column headers hiding as needed
func (*RowBuilder) SetFlagsFrom ¶ added in v0.2.0
func (b *RowBuilder) SetFlagsFrom(commonFlagList commonFlags)
SetFlagsFrom sets the common flags to match the values retrieved from the passed object
type Table ¶ added in v0.0.4
type Table struct { ColourOutput int CustomColours [][2]int // contains filtered or unexported fields }
func (*Table) AddPlaceHolderRow ¶ added in v0.2.1
AddPlaceHolderRow - Adds an updatable row to the table, returns an update id that can be used with UpdatePlaceHolderRow
func (*Table) AddRow ¶ added in v0.0.4
AddRow Adds a new row to the end of the table, accepts an array of strings
func (*Table) HideColumn ¶ added in v0.0.4
HideColumn select the column number to hide, columns numbers are the unsorted column number
func (*Table) HideOnlyNamedColumns ¶ added in v0.2.7
HideTheseColumns hides the column number to hide, columns numbers are the unsorted column number
func (*Table) HidePlaceHolderRow ¶ added in v0.2.1
HidePlaceHolderRow matches the placeholder id to an actual row number and calls HideRows to hide the row
func (*Table) HideRows ¶ added in v0.0.7
HideRows just sets the hide row flag, used by the print function to exclude the row from the output
func (*Table) ListOutOfRange ¶ added in v0.0.7
ListOutOfRange when given a columnID to work with it will calculate a range and returns a list of rows with values outside that range
func (*Table) Order ¶ added in v0.0.4
Order changes the order of columns displayed in the table, specifying a subset of the column numbers will place those at the front in the order specified all other columns remain untouched
func (*Table) Print ¶ added in v0.0.4
func (t *Table) Print()
Print outputs the table on the terminal, taking the column order and visibiliy into account
func (*Table) PrintCsv ¶ added in v0.1.0
func (t *Table) PrintCsv()
PrintCsv outputs the table as a csv including the header row. all fileds are shown and all are unsorted as other programs can be used to filter and sort
func (*Table) PrintJson ¶ added in v0.0.4
func (t *Table) PrintJson()
PrintJson outputs the table on the terminal as json, all fileds are shown and all are unsorted as programs like jq can be used to filter and sort
func (*Table) PrintList ¶ added in v0.1.0
func (t *Table) PrintList()
PrintList outputs the key and value on a single line by its self. all fileds are shown and all are unsorted as other programs can be used to filter and sort
func (*Table) PrintYaml ¶ added in v0.1.0
func (t *Table) PrintYaml()
PrintYaml outputs the table on the terminal as yaml, all fileds are shown and all are unsorted as other programs can be used to filter and sort
func (*Table) SetHeader ¶ added in v0.0.4
SetHeader sets the header row to the specified array of strings headerRow is always reinitilized to empty before headers are added
func (*Table) SortByNames ¶ added in v0.0.4
SortByNames given a , seperated list of names match them to actual headers and sort each one in order by default sorts in ascending to revers use ! in front of the header name returns error on fail and nil otherwise
func (*Table) UpdatePlaceHolderRow ¶ added in v0.2.1
UpdatePlaceHolderRow - updates the given placeholder at id with the contents of cellList