Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ResourceTypes represents the set of resource types. // Resouces are grouped by the same level of abstraction. ResourceTypes = []string{"hpa cronjob", "deploy job", "sts ds rs", "pod", "pvc", "svc", "ing"} )
Functions ¶
func NormalizeResource ¶
NormalizeResource resturns normalized name of the resource. It returns error if it fails to normalize the resource name. key of normalizedNames map is used as the normalized name.
Types ¶
type Resources ¶
type Resources struct { Namespace string Svcs *corev1.ServiceList Pvcs *corev1.PersistentVolumeClaimList Pods *corev1.PodList Stss *appsv1.StatefulSetList Dss *appsv1.DaemonSetList Rss *appsv1.ReplicaSetList Deploys *appsv1.DeploymentList Jobs *batchv1.JobList CronJobs *batchv1.CronJobList Ingresses *netv1.IngressList Hpas *autov1.HorizontalPodAutoscalerList // contains filtered or unexported fields }
Resources represents the k8s resources
func NewResources ¶
func NewResources(clientset kubernetes.Interface, namespace string) (*Resources, error)
NewResources resturns Resources for the namespace
func (*Resources) GetResourceNames ¶
GetResourceNames returns the resource names of the kind
func (*Resources) HasResource ¶
HasResource check if Resources has k8s resource with the kind and the name
Click to show internal directories.
Click to hide internal directories.