Documentation ¶
Index ¶
- Constants
- type K8SClient
- func (c *K8SClient) GetAllNamespaces() ([]string, error)
- func (c *K8SClient) GetGVR(selector K8SSelector) (*schema.GroupVersionResource, error)
- func (c *K8SClient) GetInformerFactory(resync time.Duration) dynamicinformer.DynamicSharedInformerFactory
- func (c *K8SClient) GetMapping(selector K8SSelector) (*meta.RESTMapping, error)
- func (c *K8SClient) GetNamespaces(selector K8SSelector) ([]string, error)
- func (c *K8SClient) Query(selector K8SSelector) (output []unstructured.Unstructured, err error)
- type K8SController
- type K8SControllerEventType
- type K8SControllerHandler
- type K8SEvent
- type K8SFilter
- type K8SResource
- type K8SSelector
Constants ¶
View Source
const ReleaseVersion = "v2024.9.3"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type K8SClient ¶
type K8SClient struct { Client kubernetes.Interface Dynamic dynamic.Interface Mapper *restmapper.DeferredDiscoveryRESTMapper }
func NewK8SClient ¶
NewK8SClient This creates a wrapper which gives you an initialized and connected kubernetes client It then has a number of helper functions
func (*K8SClient) GetAllNamespaces ¶
func (*K8SClient) GetGVR ¶
func (c *K8SClient) GetGVR(selector K8SSelector) (*schema.GroupVersionResource, error)
func (*K8SClient) GetInformerFactory ¶
func (c *K8SClient) GetInformerFactory(resync time.Duration) dynamicinformer.DynamicSharedInformerFactory
func (*K8SClient) GetMapping ¶
func (c *K8SClient) GetMapping(selector K8SSelector) (*meta.RESTMapping, error)
func (*K8SClient) GetNamespaces ¶
func (c *K8SClient) GetNamespaces(selector K8SSelector) ([]string, error)
func (*K8SClient) Query ¶
func (c *K8SClient) Query(selector K8SSelector) (output []unstructured.Unstructured, err error)
type K8SController ¶
type K8SController struct { OnAdd K8SControllerHandler OnUpdate K8SControllerHandler OnDelete K8SControllerHandler // contains filtered or unexported fields }
func NewK8SController ¶
func NewK8SController(selector K8SSelector, resyncInterval time.Duration) (*K8SController, error)
func (*K8SController) Start ¶
func (c *K8SController) Start(ctx context.Context, wg *sync.WaitGroup)
Start starts the informer factory and sends events in the queue to the main loop. If a wait group is passed, Start will decrement it once it processes all events in the queue after one loop. If a wait group is not passed, Start will run continuously until the passed context is interrupted.
type K8SControllerEventType ¶
type K8SControllerEventType string
const ( ControllerEventTypeCreate K8SControllerEventType = "create" ControllerEventTypeUpdate K8SControllerEventType = "update" ControllerEventTypeDelete K8SControllerEventType = "delete" )
type K8SControllerHandler ¶
type K8SControllerHandler func(interface{})
type K8SEvent ¶
type K8SEvent struct { Key string Type K8SControllerEventType }
type K8SFilter ¶
type K8SFilter struct {
// contains filtered or unexported fields
}
func NewK8SFilter ¶
func NewK8SFilter(selector K8SSelector) *K8SFilter
func (*K8SFilter) MatchesFilter ¶ added in v2024.4.26
func (*K8SFilter) MatchesNamespace ¶ added in v2024.4.26
type K8SResource ¶ added in v2024.4.26
type K8SResource struct {
Metadata v1.ObjectMeta `json:"metadata"`
}
type K8SSelector ¶
type K8SSelector struct { ApiVersion string `json:"apiVersion" yaml:"apiVersion"` Kind string `json:"kind" yaml:"kind"` Namespaces []string `json:"namespaces,omitempty" yaml:"namespaces,omitempty"` Labels []string `json:"labels,omitempty" yaml:"labels,omitempty"` Excludes []string `json:"excludes,omitempty" yaml:"excludes,omitempty"` }
func (*K8SSelector) GetListOptions ¶
func (selector *K8SSelector) GetListOptions() metav1.ListOptions
func (*K8SSelector) LabelSelector ¶
func (selector *K8SSelector) LabelSelector() string
Click to show internal directories.
Click to hide internal directories.