Documentation
¶
Index ¶
- func IsExcludedFromDiscovery(objectMeta metav1.ObjectMeta) bool
- func PrepareClient(stopCh <-chan struct{})
- type Client
- func (c *Client) DaemonSetByNamespaceAndName(namespace string, name string) *appsv1.DaemonSet
- func (c *Client) DaemonSets() []*appsv1.DaemonSet
- func (c *Client) DeploymentByNamespaceAndName(namespace string, name string) *appsv1.Deployment
- func (c *Client) Deployments() []*appsv1.Deployment
- func (c *Client) Events(since time.Time) *[]corev1.Event
- func (c *Client) ExecInPod(_ context.Context, namespace, podName, containerName string, command []string) (string, error)
- func (c *Client) FileExistsInPod(ctx context.Context, namespace, podName, containerName, filePath string) (bool, error)
- func (c *Client) GetConfig() *rest.Config
- func (c *Client) GetHAProxyIngressClasses() ([]string, bool)
- func (c *Client) GetIngressControllerByClassName(className string) string
- func (c *Client) GetNginxIngressClasses() ([]string, bool)
- func (c *Client) HorizontalPodAutoscalerByNamespaceAndDeployment(namespace string, reference string) *autoscalingv2.HorizontalPodAutoscaler
- func (c *Client) IngressByNamespaceAndName(namespace string, name string, forceUpdate ...bool) (*networkingv1.Ingress, error)
- func (c *Client) IngressClasses() []*networkingv1.IngressClass
- func (c *Client) Ingresses() []*networkingv1.Ingress
- func (c *Client) Namespaces() []*corev1.Namespace
- func (c *Client) Nodes() []*corev1.Node
- func (c *Client) NodesReadyCount() int
- func (c *Client) Notify(ch chan<- interface{})
- func (c *Client) Permissions() *PermissionCheckResult
- func (c *Client) PodByNamespaceAndName(namespace string, name string) *corev1.Pod
- func (c *Client) Pods() []*corev1.Pod
- func (c *Client) PodsByLabelSelector(labelSelector *metav1.LabelSelector, namespace string) []*corev1.Pod
- func (c *Client) PodsByOwnerUid(ownerUid types.UID, namespace string) []*corev1.Pod
- func (c *Client) PodsOwnedByDeployment(deploymentUid types.UID, namespace string) []*corev1.Pod
- func (c *Client) PrintMemoryUsage()
- func (c *Client) RemoveIngressAnnotationBlock(ctx context.Context, namespace string, ingressName string, ...) error
- func (c *Client) ReplicaSetByNamespaceAndName(namespace string, name string) *appsv1.ReplicaSet
- func (c *Client) ReplicaSets() []*appsv1.ReplicaSet
- func (c *Client) ServicesByPod(pod *corev1.Pod) []*corev1.Service
- func (c *Client) ServicesMatchingToPodLabels(namespace string, labelSelector map[string]string) []*corev1.Service
- func (c *Client) StatefulSetByNamespaceAndName(namespace string, name string) *appsv1.StatefulSet
- func (c *Client) StatefulSets() []*appsv1.StatefulSet
- func (c *Client) StopNotify(ch chan<- interface{})
- func (c *Client) UpdateIngressAnnotation(ctx context.Context, namespace string, ingressName string, ...) (string, error)
- type OwnerRefListWithResource
- type OwnerReference
- type PermissionCheckOutcome
- type PermissionCheckResult
- func (p *PermissionCheckResult) CanReadHorizontalPodAutoscalers() bool
- func (p *PermissionCheckResult) CanReadNamespaces() bool
- func (p *PermissionCheckResult) IsCrashLoopPodPermitted() bool
- func (p *PermissionCheckResult) IsDeletePodPermitted() bool
- func (p *PermissionCheckResult) IsDrainNodePermitted() bool
- func (p *PermissionCheckResult) IsListIngressClassesPermitted() bool
- func (p *PermissionCheckResult) IsListIngressPermitted() bool
- func (p *PermissionCheckResult) IsModifyIngressPermitted() bool
- func (p *PermissionCheckResult) IsRolloutRestartPermitted() bool
- func (p *PermissionCheckResult) IsScaleDeploymentPermitted() bool
- func (p *PermissionCheckResult) IsScaleReplicaSetPermitted() bool
- func (p *PermissionCheckResult) IsScaleStatefulSetPermitted() bool
- func (p *PermissionCheckResult) IsSetImageDeploymentPermitted() bool
- func (p *PermissionCheckResult) IsTaintNodePermitted() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsExcludedFromDiscovery ¶
func IsExcludedFromDiscovery(objectMeta metav1.ObjectMeta) bool
func PrepareClient ¶
func PrepareClient(stopCh <-chan struct{})
Types ¶
type Client ¶
type Client struct {
Distribution string
// contains filtered or unexported fields
}
var K8S *Client
func CreateClient ¶
func CreateClient(clientset kubernetes.Interface, stopCh <-chan struct{}, rootApiPath string, permissions *PermissionCheckResult) *Client
CreateClient is visible for testing
func (*Client) DaemonSetByNamespaceAndName ¶
func (*Client) DaemonSets ¶
func (*Client) DeploymentByNamespaceAndName ¶
func (c *Client) DeploymentByNamespaceAndName(namespace string, name string) *appsv1.Deployment
func (*Client) Deployments ¶
func (c *Client) Deployments() []*appsv1.Deployment
func (*Client) ExecInPod ¶ added in v2.6.9
func (c *Client) ExecInPod(_ context.Context, namespace, podName, containerName string, command []string) (string, error)
ExecInPod executes a command in a pod container and returns the output
func (*Client) FileExistsInPod ¶ added in v2.6.9
func (c *Client) FileExistsInPod(ctx context.Context, namespace, podName, containerName, filePath string) (bool, error)
FileExistsInPod checks if a file exists in a pod container
func (*Client) GetConfig ¶ added in v2.6.4
GetConfig returns the kubernetes config used by the client
func (*Client) GetHAProxyIngressClasses ¶ added in v2.6.4
func (*Client) GetIngressControllerByClassName ¶ added in v2.6.4
func (*Client) GetNginxIngressClasses ¶ added in v2.6.9
func (*Client) HorizontalPodAutoscalerByNamespaceAndDeployment ¶
func (c *Client) HorizontalPodAutoscalerByNamespaceAndDeployment(namespace string, reference string) *autoscalingv2.HorizontalPodAutoscaler
func (*Client) IngressByNamespaceAndName ¶ added in v2.6.4
func (*Client) IngressClasses ¶ added in v2.6.4
func (c *Client) IngressClasses() []*networkingv1.IngressClass
func (*Client) Ingresses ¶ added in v2.6.4
func (c *Client) Ingresses() []*networkingv1.Ingress
func (*Client) Namespaces ¶
func (*Client) NodesReadyCount ¶
func (*Client) Permissions ¶
func (c *Client) Permissions() *PermissionCheckResult
func (*Client) PodByNamespaceAndName ¶
func (*Client) PodsByLabelSelector ¶
func (*Client) PodsByOwnerUid ¶ added in v2.6.16
PodsByOwnerUid returns all running pods that have the given owner UID in their OwnerReferences. This is more accurate than PodsByLabelSelector when selectors are misconfigured.
func (*Client) PodsOwnedByDeployment ¶ added in v2.6.16
PodsOwnedByDeployment returns all running pods owned by the deployment via its ReplicaSets. Deployment ownership chain: Deployment -> ReplicaSet -> Pod
func (*Client) PrintMemoryUsage ¶ added in v2.6.11
func (c *Client) PrintMemoryUsage()
func (*Client) RemoveIngressAnnotationBlock ¶ added in v2.6.15
func (*Client) ReplicaSetByNamespaceAndName ¶
func (c *Client) ReplicaSetByNamespaceAndName(namespace string, name string) *appsv1.ReplicaSet
func (*Client) ReplicaSets ¶ added in v2.6.9
func (c *Client) ReplicaSets() []*appsv1.ReplicaSet
func (*Client) ServicesMatchingToPodLabels ¶
func (*Client) StatefulSetByNamespaceAndName ¶
func (c *Client) StatefulSetByNamespaceAndName(namespace string, name string) *appsv1.StatefulSet
func (*Client) StatefulSets ¶
func (c *Client) StatefulSets() []*appsv1.StatefulSet
func (*Client) StopNotify ¶
func (c *Client) StopNotify(ch chan<- interface{})
type OwnerRefListWithResource ¶
type OwnerRefListWithResource struct {
OwnerRefs []OwnerReference
Deployment *appsv1.Deployment
Daemonset *appsv1.DaemonSet
}
func OwnerReferences ¶
func OwnerReferences(k8s *Client, meta *metav1.ObjectMeta) OwnerRefListWithResource
func (OwnerRefListWithResource) ContainerSpec ¶
func (o OwnerRefListWithResource) ContainerSpec(containerName string) *corev1.Container
type OwnerReference ¶
type PermissionCheckOutcome ¶
type PermissionCheckOutcome string
const ( WARN PermissionCheckOutcome = "warn" ERROR PermissionCheckOutcome = "error" OK PermissionCheckOutcome = "ok" )
type PermissionCheckResult ¶
type PermissionCheckResult struct {
Permissions map[string]PermissionCheckOutcome
}
func MockAllPermitted ¶
func MockAllPermitted() *PermissionCheckResult
func (*PermissionCheckResult) CanReadHorizontalPodAutoscalers ¶
func (p *PermissionCheckResult) CanReadHorizontalPodAutoscalers() bool
func (*PermissionCheckResult) CanReadNamespaces ¶
func (p *PermissionCheckResult) CanReadNamespaces() bool
func (*PermissionCheckResult) IsCrashLoopPodPermitted ¶
func (p *PermissionCheckResult) IsCrashLoopPodPermitted() bool
func (*PermissionCheckResult) IsDeletePodPermitted ¶
func (p *PermissionCheckResult) IsDeletePodPermitted() bool
func (*PermissionCheckResult) IsDrainNodePermitted ¶
func (p *PermissionCheckResult) IsDrainNodePermitted() bool
func (*PermissionCheckResult) IsListIngressClassesPermitted ¶ added in v2.6.4
func (p *PermissionCheckResult) IsListIngressClassesPermitted() bool
func (*PermissionCheckResult) IsListIngressPermitted ¶ added in v2.6.4
func (p *PermissionCheckResult) IsListIngressPermitted() bool
func (*PermissionCheckResult) IsModifyIngressPermitted ¶ added in v2.6.4
func (p *PermissionCheckResult) IsModifyIngressPermitted() bool
func (*PermissionCheckResult) IsRolloutRestartPermitted ¶
func (p *PermissionCheckResult) IsRolloutRestartPermitted() bool
func (*PermissionCheckResult) IsScaleDeploymentPermitted ¶
func (p *PermissionCheckResult) IsScaleDeploymentPermitted() bool
func (*PermissionCheckResult) IsScaleReplicaSetPermitted ¶ added in v2.6.9
func (p *PermissionCheckResult) IsScaleReplicaSetPermitted() bool
func (*PermissionCheckResult) IsScaleStatefulSetPermitted ¶
func (p *PermissionCheckResult) IsScaleStatefulSetPermitted() bool
func (*PermissionCheckResult) IsSetImageDeploymentPermitted ¶ added in v2.6.9
func (p *PermissionCheckResult) IsSetImageDeploymentPermitted() bool
func (*PermissionCheckResult) IsTaintNodePermitted ¶
func (p *PermissionCheckResult) IsTaintNodePermitted() bool
Click to show internal directories.
Click to hide internal directories.