Documentation ¶
Index ¶
- Constants
- Variables
- func CreateResource(ctx context.Context, obj runtime.Object, clientset *kubernetes.Clientset) error
- func DeleteResource(ctx context.Context, obj runtime.Object, clientset *kubernetes.Clientset) error
- func ExecPod(ctx context.Context, kubeConfigFilePath, namespace, podName, command string) error
- func TypeString(resourceType ResourceType) string
- func WaitForPodReady(ctx context.Context, clientset *kubernetes.Clientset, ...) error
- type CreateAgnhostStatefulSet
- type CreateDenyAllNetworkPolicy
- type CreateKapingerDeployment
- func (c *CreateKapingerDeployment) GetKapingerClusterRole() *rbacv1.ClusterRole
- func (c *CreateKapingerDeployment) GetKapingerClusterRoleBinding() *rbacv1.ClusterRoleBinding
- func (c *CreateKapingerDeployment) GetKapingerDeployment() *appsv1.Deployment
- func (c *CreateKapingerDeployment) GetKapingerService() *v1.Service
- func (c *CreateKapingerDeployment) GetKapingerServiceAccount() *v1.ServiceAccount
- func (c *CreateKapingerDeployment) Prevalidate() error
- func (c *CreateKapingerDeployment) Run() error
- func (c *CreateKapingerDeployment) Stop() error
- type DeleteDenyAllNetworkPolicy
- type DeleteKubernetesResource
- type ExecInPod
- type PortForward
- type ResourceType
Constants ¶
View Source
const ( AgnhostHTTPPort = 80 AgnhostReplicas = 1 )
View Source
const ( KapingerHTTPPort = 8080 KapingerTCPPort = 8085 KapingerUDPPort = 8086 MaxAffinityWeight = 100 )
View Source
const ( Egress = "egress" Ingress = "ingress" )
View Source
const ( RetryTimeoutPodsReady = 5 * time.Minute RetryIntervalPodsReady = 5 * time.Second )
View Source
const ExecSubResources = "exec"
Variables ¶
View Source
var ( ErrUnknownResourceType = fmt.Errorf("unknown resource type") ErrCreateNilResource = fmt.Errorf("cannot create nil resource") )
View Source
var ErrDeleteNilResource = fmt.Errorf("cannot create nil resource")
View Source
var ErrLabelMissingFromPod = fmt.Errorf("label missing from pod")
View Source
var (
ErrNoPodWithLabelFound = fmt.Errorf("no pod with label found with matching pod affinity")
)
Functions ¶
func CreateResource ¶
func DeleteResource ¶
func TypeString ¶ added in v1.5.23
func TypeString(resourceType ResourceType) string
Parameters can only be strings, heres to help add guardrails
func WaitForPodReady ¶
Types ¶
type CreateAgnhostStatefulSet ¶
type CreateAgnhostStatefulSet struct { AgnhostName string AgnhostNamespace string KubeConfigFilePath string }
func (*CreateAgnhostStatefulSet) Prevalidate ¶
func (c *CreateAgnhostStatefulSet) Prevalidate() error
func (*CreateAgnhostStatefulSet) Run ¶
func (c *CreateAgnhostStatefulSet) Run() error
func (*CreateAgnhostStatefulSet) Stop ¶ added in v1.5.21
func (c *CreateAgnhostStatefulSet) Stop() error
type CreateDenyAllNetworkPolicy ¶
type CreateDenyAllNetworkPolicy struct { NetworkPolicyNamespace string KubeConfigFilePath string DenyAllLabelSelector string }
func (*CreateDenyAllNetworkPolicy) Prevalidate ¶
func (c *CreateDenyAllNetworkPolicy) Prevalidate() error
func (*CreateDenyAllNetworkPolicy) Run ¶
func (c *CreateDenyAllNetworkPolicy) Run() error
func (*CreateDenyAllNetworkPolicy) Stop ¶ added in v1.5.21
func (c *CreateDenyAllNetworkPolicy) Stop() error
type CreateKapingerDeployment ¶
type CreateKapingerDeployment struct { KapingerNamespace string KapingerReplicas string KubeConfigFilePath string }
func (*CreateKapingerDeployment) GetKapingerClusterRole ¶
func (c *CreateKapingerDeployment) GetKapingerClusterRole() *rbacv1.ClusterRole
func (*CreateKapingerDeployment) GetKapingerClusterRoleBinding ¶
func (c *CreateKapingerDeployment) GetKapingerClusterRoleBinding() *rbacv1.ClusterRoleBinding
func (*CreateKapingerDeployment) GetKapingerDeployment ¶
func (c *CreateKapingerDeployment) GetKapingerDeployment() *appsv1.Deployment
func (*CreateKapingerDeployment) GetKapingerService ¶
func (c *CreateKapingerDeployment) GetKapingerService() *v1.Service
func (*CreateKapingerDeployment) GetKapingerServiceAccount ¶
func (c *CreateKapingerDeployment) GetKapingerServiceAccount() *v1.ServiceAccount
func (*CreateKapingerDeployment) Prevalidate ¶
func (c *CreateKapingerDeployment) Prevalidate() error
func (*CreateKapingerDeployment) Run ¶
func (c *CreateKapingerDeployment) Run() error
func (*CreateKapingerDeployment) Stop ¶ added in v1.5.21
func (c *CreateKapingerDeployment) Stop() error
type DeleteDenyAllNetworkPolicy ¶
type DeleteDenyAllNetworkPolicy struct { NetworkPolicyNamespace string KubeConfigFilePath string DenyAllLabelSelector string }
func (*DeleteDenyAllNetworkPolicy) Prevalidate ¶
func (d *DeleteDenyAllNetworkPolicy) Prevalidate() error
func (*DeleteDenyAllNetworkPolicy) Run ¶
func (d *DeleteDenyAllNetworkPolicy) Run() error
type DeleteKubernetesResource ¶ added in v1.5.23
type DeleteKubernetesResource struct { ResourceType string // can't use enum, breaks parameter parsing, all must be strings ResourceName string ResourceNamespace string KubeConfigFilePath string }
func (*DeleteKubernetesResource) Prevalidate ¶ added in v1.5.23
func (d *DeleteKubernetesResource) Prevalidate() error
func (*DeleteKubernetesResource) Run ¶ added in v1.5.23
func (d *DeleteKubernetesResource) Run() error
func (*DeleteKubernetesResource) Stop ¶ added in v1.5.23
func (d *DeleteKubernetesResource) Stop() error
type ExecInPod ¶
type ExecInPod struct { PodNamespace string KubeConfigFilePath string PodName string Command string }
func (*ExecInPod) Prevalidate ¶
type PortForward ¶ added in v1.5.21
type PortForward struct { Namespace string LabelSelector string LocalPort string RemotePort string KubeConfigFilePath string OptionalLabelAffinity string // contains filtered or unexported fields }
func (*PortForward) Prevalidate ¶ added in v1.5.21
func (p *PortForward) Prevalidate() error
func (*PortForward) Run ¶ added in v1.5.21
func (p *PortForward) Run() error
func (*PortForward) Stop ¶ added in v1.5.21
func (p *PortForward) Stop() error
type ResourceType ¶ added in v1.5.23
type ResourceType string
const ( DaemonSet ResourceType = "DaemonSet" Deployment ResourceType = "Deployment" StatefulSet ResourceType = "StatefulSet" Service ResourceType = "Service" ServiceAccount ResourceType = "ServiceAccount" Role ResourceType = "Role" RoleBinding ResourceType = "RoleBinding" ClusterRole ResourceType = "ClusterRole" ClusterRoleBinding ResourceType = "ClusterRoleBinding" ConfigMap ResourceType = "ConfigMap" NetworkPolicy ResourceType = "NetworkPolicy" Secret ResourceType = "Secret" Unknown ResourceType = "Unknown" )
Click to show internal directories.
Click to hide internal directories.