Documentation
¶
Index ¶
- func Main() int
- func ReportJSON(rep Report) (string, error)
- type Client
- func (c *Client) ClusterID(ctx context.Context) (string, error)
- func (c *Client) ClusterNodes(ctx context.Context) (*corev1.NodeList, error)
- func (c *Client) ClusterVersion() (string, error)
- func (c *Client) ConfigMaps(ctx context.Context, namespace string) (*corev1.ConfigMapList, error)
- func (c *Client) CustomResourceDefinitions(ctx context.Context) (*apiextv1.CustomResourceDefinitionList, error)
- func (c *Client) Deployments(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
- func (c *Client) Events(ctx context.Context, namespace string) (*corev1.EventList, error)
- func (c *Client) IngressClasses(ctx context.Context) (*netv1.IngressClassList, error)
- func (c *Client) Ingresses(ctx context.Context, namespace string) (*netv1.IngressList, error)
- func (c *Client) Leases(ctx context.Context, namespace string) (*coordv1.LeaseList, error)
- func (c *Client) NodeMetrics(ctx context.Context) (*v1beta1.NodeMetricsList, error)
- func (c *Client) Nodes(ctx context.Context) (int, error)
- func (c *Client) Platform(ctx context.Context) (string, error)
- func (c *Client) PodMetrics(ctx context.Context, namespace string) (*v1beta1.PodMetricsList, error)
- func (c *Client) Podlogs(ctx context.Context, namespace string) (map[string]string, error)
- func (c *Client) Pods(ctx context.Context, namespace string) (*corev1.PodList, error)
- func (c *Client) ReplicaSets(ctx context.Context, namespace string) (*appsv1.ReplicaSetList, error)
- func (c *Client) Report(ctx context.Context, namespace string) (Report, error)
- func (c *Client) Services(ctx context.Context, namespace string) (*corev1.ServiceList, error)
- func (c *Client) StatefulSets(ctx context.Context, namespace string) (*appsv1.StatefulSetList, error)
- type Report
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReportJSON ¶ added in v0.0.2
ReportJSON returns collected metrics in a JSON format.
Types ¶
type Client ¶
type Client struct { Verbose bool K8sClient kubernetes.Interface CRDClient *crd.Clientset MetricsClient *metrics.Clientset }
Client is an inspector client.
func BuildClientFromKubeConfig ¶
BuildClientFromKubeConfig builds an inspector client ready to interact with the K8s cluster.
func (*Client) ClusterNodes ¶ added in v0.0.2
func (*Client) ClusterVersion ¶
ClusterVersion returns K8s version.
func (*Client) ConfigMaps ¶ added in v0.0.2
ConfigMaps returns a list of config maps for a given namespace.
func (*Client) CustomResourceDefinitions ¶ added in v0.0.2
func (c *Client) CustomResourceDefinitions(ctx context.Context) (*apiextv1.CustomResourceDefinitionList, error)
CustomResourceDefinitions returns a list of CRDs in a cluster.
func (*Client) Deployments ¶ added in v0.0.2
Deployments returns a list of deployments in a given namespace.
func (*Client) IngressClasses ¶ added in v0.0.2
IngressClasses returns a list of ingress classes in a cluster.
func (*Client) Ingresses ¶ added in v0.0.2
Ingresses returns a list of ingresses in a given namespace.
func (*Client) NodeMetrics ¶ added in v0.0.2
NodeMetrics returns a list of node metrics in a cluster.
func (*Client) PodMetrics ¶ added in v0.0.2
PodMetrics returns a list of pods metrics in a given namespace.
func (*Client) ReplicaSets ¶ added in v0.0.2
ReplicaSets returns a list of replica sets in a given namespace.
func (*Client) Services ¶ added in v0.0.2
Services returns a list of services for a given namespace.
func (*Client) StatefulSets ¶ added in v0.0.2
func (c *Client) StatefulSets(ctx context.Context, namespace string) (*appsv1.StatefulSetList, error)
StatefulSets returns a list of [stateful sets] in a given namespace.
type Report ¶
type Report struct { K8sVersion string `json:"k8s_version"` ClusterID string `json:"cluster_id"` Nodes int `json:"nodes"` Platform string `json:"platform"` Pods *corev1.PodList `json:"pods"` Podlogs map[string]string `json:"pod_logs"` Events *corev1.EventList `json:"events"` ConfigMaps *corev1.ConfigMapList `json:"config_maps"` Services *corev1.ServiceList `json:"services"` Deployments *appsv1.DeploymentList `json:"deployments"` StatefulSets *appsv1.StatefulSetList `json:"stateful_sets"` ReplicaSets *appsv1.ReplicaSetList `json:"replica_sets"` Leases *coordv1.LeaseList `json:"leases"` IngressClasses *netv1.IngressClassList `json:"ingress_classes"` Ingresses *netv1.IngressList `json:"ingresses"` CRDs *apiextv1.CustomResourceDefinitionList `json:"crds"` ClusterNodes *corev1.NodeList `json:"cluster_nodes"` }
Report holds collected data points.