Documentation ¶
Index ¶
- func GetK8SResourcesProvider(ctx context.Context, kubernetesClient *KubernetesClient) error
- func GetKubeConfig(kubeconfigPath string) (*rest.Config, error)
- func GetKubeConfigInCluster() (*rest.Config, error)
- func GetObjectCounts(ctx context.Context, kubernetesClient *KubernetesClient, resource string, ...) (*unstructured.UnstructuredList, int, error)
- type Certificate
- type K8SResource
- type KubernetesClient
- type RegoRulesList
- type ResourceProvider
- type ReturnMsg
- type ValidateResult
- type Workload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetK8SResourcesProvider ¶
func GetK8SResourcesProvider(ctx context.Context, kubernetesClient *KubernetesClient) error
GetK8SResourcesProvider get kubeconfig by KubernetesAPI, get kubernetes resources by GetK8SResources.
func GetKubeConfig ¶
GetKubeConfig get the kubeconfig from path or by GetConfig
func GetKubeConfigInCluster ¶ added in v0.5.0
func GetObjectCounts ¶ added in v0.4.1
func GetObjectCounts(ctx context.Context, kubernetesClient *KubernetesClient, resource string, group string) (*unstructured.UnstructuredList, int, error)
GetObjectCounts get kubernetes resources by GroupVersion
Types ¶
type Certificate ¶
type K8SResource ¶
type K8SResource struct { ServerVersion string CreationTime time.Time APIServerAddress string Nodes *unstructured.UnstructuredList NodesCount int Namespaces *unstructured.UnstructuredList NameSpacesCount int NameSpacesList []string Deployments *unstructured.UnstructuredList Pods *unstructured.UnstructuredList DaemonSets *unstructured.UnstructuredList StatefulSets *unstructured.UnstructuredList Jobs *unstructured.UnstructuredList CronJobs *unstructured.UnstructuredList WorkloadsCount int Roles *unstructured.UnstructuredList ClusterRoles *unstructured.UnstructuredList Events *unstructured.UnstructuredList }
func GetK8SResources ¶
func GetK8SResources(ctx context.Context, kubernetesClient *KubernetesClient) K8SResource
GetK8SResources get kubernetes resources by GroupVersionResource, return K8SResource.
type KubernetesClient ¶
type KubernetesClient struct { KubeConfig *rest.Config ClientSet kubernetes.Interface VersionClientSet versioned.Interface DynamicClient dynamic.Interface }
func GetK8SClients ¶ added in v0.5.0
func GetK8SClients(kubeconfig string) (*KubernetesClient, error)
func (*KubernetesClient) K8SClients ¶ added in v0.4.0
func (k *KubernetesClient) K8SClients(kubeConfig *rest.Config) (*KubernetesClient, error)
K8SClients return kubeconfig clientset and dynamicClient.
type RegoRulesList ¶
type RegoRulesList struct {
RegoRules []string
}
type ResourceProvider ¶
type ValidateResult ¶
Click to show internal directories.
Click to hide internal directories.