Documentation ¶
Index ¶
- Constants
- func MakeClient(apiConf APIConfig) (*k8s.Clientset, string, error)
- type APIConfig
- type AuthType
- type IWatcher
- type NodeWatcher
- type PodWatcher
- type ResourceHandlersMap
- type ServiceWatcher
- type Watchers
- func (w *Watchers) Handlers() map[string]http.HandlerFunc
- func (w *Watchers) Run() error
- func (w *Watchers) Stop() error
- func (w *Watchers) WithExporter(exportResource resource.Exporter) *Watchers
- func (w *Watchers) WithExporters(exporters ...resource.Exporter) *Watchers
- func (w *Watchers) WithHandler(resType resource.ResType, handler resource.ResHandler) *Watchers
- func (w *Watchers) WithHttpServer(s *server.HTTPServer) *Watchers
Constants ¶
View Source
const ( // AuthTypeNone means no auth is required AuthTypeNone AuthType = "none" // AuthTypeServiceAccount means to use the built-in service account that // K8s automatically provisions for each pod. AuthTypeServiceAccount AuthType = "serviceAccount" // AuthTypeKubeConfig uses local credentials like those used by kubectl. AuthTypeKubeConfig AuthType = "kubeConfig" // DefaultKubeConfigPath Default kubeconfig path DefaultKubeConfigPath string = "~/.kube/config" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIConfig ¶
type APIConfig struct { // How to authenticate to the K8s API server. This can be one of `none` // (for no auth), `serviceAccount` (to use the standard service account // token provided to the agent pod), or `kubeConfig` to use credentials // from user-defined file AuthType AuthType `mapstructure:"auth_type"` AuthFilePath string }
APIConfig contains options relevant to connecting to the K8s API
type AuthType ¶
type AuthType string
AuthType describes the type of authentication to use for the K8s API
type IWatcher ¶
type IWatcher interface { Init( ctx context.Context, client *kubernetes.Clientset, factory informers.SharedInformerFactory, namespace string, handlersMap ResourceHandlersMap, ) Run() }
type NodeWatcher ¶
type NodeWatcher struct {
// contains filtered or unexported fields
}
func (*NodeWatcher) Init ¶
func (w *NodeWatcher) Init(ctx context.Context, client *kubernetes.Clientset, factory informers.SharedInformerFactory, namespace string, handlersMap ResourceHandlersMap)
func (*NodeWatcher) Run ¶
func (w *NodeWatcher) Run()
type PodWatcher ¶
type PodWatcher struct {
// contains filtered or unexported fields
}
func (*PodWatcher) Init ¶
func (w *PodWatcher) Init( ctx context.Context, client *kubernetes.Clientset, factory informers.SharedInformerFactory, namespace string, handlersMap ResourceHandlersMap, )
func (*PodWatcher) Run ¶
func (w *PodWatcher) Run()
type ResourceHandlersMap ¶
type ResourceHandlersMap map[resource.ResType][]resource.ResHandler
type ServiceWatcher ¶
type ServiceWatcher struct {
// contains filtered or unexported fields
}
func (*ServiceWatcher) Init ¶
func (w *ServiceWatcher) Init( ctx context.Context, client *kubernetes.Clientset, factory informers.SharedInformerFactory, namespace string, handlersMap ResourceHandlersMap, )
func (*ServiceWatcher) Run ¶
func (w *ServiceWatcher) Run()
type Watchers ¶
type Watchers struct { Watchers map[resource.ResType]IWatcher HandlerMap ResourceHandlersMap K8sConfig APIConfig ClusterID string HttpServer *server.HTTPServer ExportResource resource.Exporter // contains filtered or unexported fields }
func (*Watchers) WithExporter ¶
func (*Watchers) WithExporters ¶
func (*Watchers) WithHandler ¶
func (*Watchers) WithHttpServer ¶
func (w *Watchers) WithHttpServer(s *server.HTTPServer) *Watchers
Click to show internal directories.
Click to hide internal directories.