Documentation
¶
Index ¶
- func GetKubeconfig() string
- func NamespaceListToNames(list *v1.NamespaceList) []string
- func PodListToNames(list *v1.PodList) []string
- func SprintlnContainers(items []*Container) string
- func SprintlnDeployments(items []*Deployment) string
- func SprintlnIngresses(items []*Ingress) string
- func SprintlnPods(items []*Pod) string
- func SprintlnServices(items []*Service) string
- func ToIngressAddress(s *networkingv1.IngressStatus) string
- func ToIngressPorts(ingresses []v1.LoadBalancerIngress) (ingressPorts []string)
- func ToPorts(p []v1.ServicePort) []string
- type Client
- func (c *Client) DescribeDeployments(namespace string) ([]*Deployment, error)
- func (c *Client) DescribeIngresses(namespace string) ([]*Ingress, error)
- func (c *Client) DescribeNamespace(namespace string, tail int, podNames ...string) (n *Namespace, err error)
- func (c *Client) DescribePod(namespace, podName string, tail int) (*Pod, error)
- func (c *Client) DescribePods(namespace string, tail int) ([]*Pod, error)
- func (c *Client) DescribeServices(namespace string) ([]*Service, error)
- func (c *Client) GetContainersFromPod(p *v1.Pod, tail int) ([]*Container, error)
- func (c *Client) GetDeploymentList(namespace string) (*appsv1.DeploymentList, error)
- func (c *Client) GetIngressList(namespace string) (*networkingv1.IngressList, error)
- func (c *Client) GetLog(namespace, pod, container string, tail int) (string, error)
- func (c *Client) GetNamespace(namespace string) (*v1.Namespace, error)
- func (c *Client) GetNamespaceList() (*v1.NamespaceList, error)
- func (c *Client) GetPod(namespace, pod string) (*v1.Pod, error)
- func (c *Client) GetPodList(namespace string) (*v1.PodList, error)
- func (c *Client) GetService(namespace, service string) (*v1.Service, error)
- func (c *Client) GetServiceList(namespace string) (*v1.ServiceList, error)
- type Container
- type Deployment
- type HostPath
- type Ingress
- type IngressRule
- type Namespace
- type Pod
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NamespaceListToNames ¶
func NamespaceListToNames(list *v1.NamespaceList) []string
NamespaceListToNames extracts and returns namespace list
func PodListToNames ¶
PodListToNames extracts and returns podname list
func SprintlnContainers ¶
SprintlnContainers returns tabular output of ContainerList
func SprintlnDeployments ¶
func SprintlnDeployments(items []*Deployment) string
SprintlnDeployments returns tabular output of DeploymentList
func SprintlnIngresses ¶
SprintlnIngresses returns tabular output of IngressList
func SprintlnPods ¶
SprintlnPods returns tabular output of PodList
func SprintlnServices ¶
SprintlnDeployments returns tabular output of DeploymentList
func ToIngressAddress ¶
func ToIngressAddress(s *networkingv1.IngressStatus) string
ToIngressAddress behaves mostly like a string interface and converts the given status to a string
func ToIngressPorts ¶
func ToIngressPorts(ingresses []v1.LoadBalancerIngress) (ingressPorts []string)
ToIngressPorts returns a list of ports from the given []LoadBalancerIngress
func ToPorts ¶
func ToPorts(p []v1.ServicePort) []string
ToPorts tansforms v1.ServicePort to ports string
Types ¶
type Client ¶
type Client struct {
*kubernetes.Clientset
}
func NewK8sClient ¶
NewK8sClient returns a k8s restClient
func (*Client) DescribeDeployments ¶
func (c *Client) DescribeDeployments(namespace string) ([]*Deployment, error)
DescribeDeployments returns DeploymentList
func (*Client) DescribeIngresses ¶
DescribeIngresses returns IngressList
func (*Client) DescribeNamespace ¶
func (c *Client) DescribeNamespace( namespace string, tail int, podNames ...string) (n *Namespace, err error)
DescribeNamespace gets and returns all msg in specific namespace
func (*Client) DescribePod ¶
DescribePod returns specific Pod
func (*Client) DescribePods ¶
DescribePods returns PodList
func (*Client) DescribeServices ¶
DescribeServices returns ServiceList
func (*Client) GetContainersFromPod ¶
GetContainersFromPod fills a pod with it's containers
func (*Client) GetDeploymentList ¶
func (c *Client) GetDeploymentList(namespace string) (*appsv1.DeploymentList, error)
GetDeploymentList returns DeploymentList from k8s api
func (*Client) GetIngressList ¶
func (c *Client) GetIngressList(namespace string) (*networkingv1.IngressList, error)
GetIngressList returns IngressList from k8s api
func (*Client) GetNamespace ¶
GetNamespaceList returns specific namespace from k8s api
func (*Client) GetNamespaceList ¶
func (c *Client) GetNamespaceList() (*v1.NamespaceList, error)
GetNamespaceList returns namespaceList from k8s api
func (*Client) GetPodList ¶
GetPodList returns PodList from k8s api
func (*Client) GetService ¶
GetService returns specific v1.Service from k8s api
func (*Client) GetServiceList ¶
func (c *Client) GetServiceList(namespace string) (*v1.ServiceList, error)
GetServiceList returns v1.ServiceList from k8s api
type Deployment ¶
type Deployment struct { Name string Replicas int UpdatedReplicas int ReadyReplicas int AvailableReplicas int }
func ToDeployment ¶
func ToDeployment(d *appsv1.Deployment) *Deployment
ToDeployment tansforms appsv1.Deployment to Deployment
type Ingress ¶
type Ingress struct { Name string Class string Rules []IngressRule Address string Ports []string CreationTimestamp time.Time }
func ToIngress ¶
func ToIngress(i *networkingv1.Ingress) *Ingress
ToIngress tansforms networkingv1.Ingress to Ingress
type IngressRule ¶
func ToIngressRules ¶
func ToIngressRules(rules []networkingv1.IngressRule) []IngressRule
ToIngressRules returns a list of IngressRule
type Namespace ¶
type Namespace struct { Name string Ingresses []*Ingress Services []*Service Deployments []*Deployment Pods []*Pod }
func ToNamespace ¶
ToNamespace tansforms v1.Namespace to Namespace