Documentation ¶
Index ¶
- Constants
- type Component
- func (c *Component) Config() Config
- func (c *Component) ListEndpoints(option ListOptions) (endPoints []*v1.EndpointsList, err error)
- func (c *Component) ListEndpointsByName(name string) (endPoints []*v1.Endpoints, err error)
- func (c *Component) ListPods(option ListOptions) (pods []*v1.PodList, err error)
- func (c *Component) ListPodsByName(name string) (pods []*v1.Pod, err error)
- func (c *Component) NewWatcherApp(ctx context.Context, appName string, kind string) (app *WatcherApp, err error)
- type Config
- type Container
- type KubernetesEvent
- type ListOptions
- type Option
- type WatcherApp
Constants ¶
View Source
const ( KindPods = "pods" KindEndpoints = "endpoints" )
View Source
const PackageName = "component.ek8s"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct { *kubernetes.Clientset // contains filtered or unexported fields }
Component ...
func (*Component) ListEndpoints ¶
func (c *Component) ListEndpoints(option ListOptions) (endPoints []*v1.EndpointsList, err error)
func (*Component) ListEndpointsByName ¶
func (*Component) ListPods ¶
func (c *Component) ListPods(option ListOptions) (pods []*v1.PodList, err error)
func (*Component) ListPodsByName ¶
func (*Component) NewWatcherApp ¶
type Config ¶
type Config struct { // Addr k8s API Server 地址 Addr string // 是否开启,默认开启 Enable bool // Token k8s API Server 请求token Token string // Token k8s API Server 请求token file // 本地运行时:一定需要显式设置 tokenFile = "" // 集群模式下运行时:需要 tokenFile = "/var/run/secrets/kubernetes.io/serviceaccount/token" 或释掉 tokenFile 这个 key TokenFile string // Namespaces 需要进行查询和监听的 Namespace 列表 Namespaces []string // DeploymentPrefix 命名前缀 DeploymentPrefix string // TLSClientConfigInsecure 是否启用 TLS TLSClientConfigInsecure bool }
Config 定义了ek8s组件配置结构
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func DefaultContainer ¶
func DefaultContainer() *Container
type KubernetesEvent ¶
type ListOptions ¶
type ListOptions = metav1.ListOptions
type Option ¶
type Option func(c *Container)
Option 可选项
func WithDeploymentPrefix ¶
func WithNamespaces ¶
func WithTokenFile ¶ added in v1.1.2
type WatcherApp ¶
type WatcherApp struct { *kubernetes.Clientset // contains filtered or unexported fields }
func (*WatcherApp) ProcessWorkItem ¶
func (c *WatcherApp) ProcessWorkItem(f func(info *KubernetesEvent) error) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.