Documentation ¶
Index ¶
- Variables
- func DecodeResource(b []byte) (k8s.Resource, error)
- func EncodeResource(resource k8s.Resource) ([]byte, error)
- func GetAllResources(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
- func GetCronJobs(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
- func GetDaemonSets(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
- func GetDeployments(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
- func GetKubernetesVersion(clientset kubernetes.Interface) (*version.Info, error)
- func GetNamespaces(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
- func GetNetworkPolicies(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
- func GetPodTemplates(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
- func GetPods(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
- func GetReplicationControllers(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
- func GetServiceAccounts(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
- func GetServices(clientset kubernetes.Interface, option ClientOptions) []k8s.Resource
- func GetStatefulSets(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
- func IsRunningInCluster(client Client) bool
- func NewKubeClientCluster(client Client) (*kubernetes.Clientset, error)
- func NewKubeClientLocal(configPath string) (*kubernetes.Clientset, error)
- type Client
- type ClientOptions
Constants ¶
This section is empty.
Variables ¶
var DefaultClient = k8sClient{}
var ErrNoReadableKubeConfig = errors.New("unable to open kubeconfig file")
ErrNoReadableKubeConfig represents any error that prevents the client from opening a kubeconfig file.
Functions ¶
func GetAllResources ¶
func GetAllResources(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
GetAllResources gets all supported resources from the cluster
func GetCronJobs ¶
func GetCronJobs(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
GetCronJobs gets all CronJob resources from the cluster
func GetDaemonSets ¶
func GetDaemonSets(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
GetDaemonSets gets all DaemonSet resources from the cluster
func GetDeployments ¶
func GetDeployments(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
GetDeployments gets all Deployment resources from the cluster
func GetKubernetesVersion ¶
func GetKubernetesVersion(clientset kubernetes.Interface) (*version.Info, error)
GetKubernetesVersion returns the kubernetes client version
func GetNamespaces ¶
func GetNamespaces(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
GetNamespaces gets all Namespace resources from the cluster
func GetNetworkPolicies ¶
func GetNetworkPolicies(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
GetNetworkPolicies gets all NetworkPolicy resources from the cluster
func GetPodTemplates ¶
func GetPodTemplates(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
GetPodTemplates gets all PodTemplate resources from the cluster
func GetPods ¶
func GetPods(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
GetPods gets all Pod resources from the cluster
func GetReplicationControllers ¶
func GetReplicationControllers(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
GetReplicationControllers gets all ReplicationController resources from the cluster
func GetServiceAccounts ¶
func GetServiceAccounts(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
GetServiceAccounts gets all ServiceAccount resources from the cluster
func GetServices ¶
func GetServices(clientset kubernetes.Interface, option ClientOptions) []k8s.Resource
GetServices gets all Service resources from a namespace in a cluster
func GetStatefulSets ¶
func GetStatefulSets(clientset kubernetes.Interface, options ClientOptions) []k8s.Resource
GetStatefulSets gets all StatefulSet resources from the cluster
func IsRunningInCluster ¶
IsRunningInCluster returns true if kubeaudit is running inside a cluster
func NewKubeClientCluster ¶
func NewKubeClientCluster(client Client) (*kubernetes.Clientset, error)
NewKubeClientCluster creates a new kube client for cluster mode
func NewKubeClientLocal ¶
func NewKubeClientLocal(configPath string) (*kubernetes.Clientset, error)
NewKubeClientLocal creates a new kube client for local mode
Types ¶
type ClientOptions ¶
type ClientOptions struct { // Namespace filters resources by namespace. Defaults to all namespaces. Namespace string }