kube

package
v0.0.0-...-817612b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultResyncApply       = time.Second * 30
	ControllerAgentNameApply = "apply-controller"
	ApplyKind                = "Apply"
	DefaultValuesKey         = "default"

	ApplySuccessSynced     = "ApplySynced"
	ErrApplyResourceExists = "ErrApplyResourceExists"
	MessageApplySynced     = "Apply synced successfully"
	MessageApplyExists     = "Resource %q already exists and is not managed by Apply"
)
View Source
const (
	DefaultResyncCluster       = time.Second * 30
	ControllerAgentNameCluster = "cluster-controller"
	ClusterKind                = "Cluster"

	ClusterSuccessSynced     = "ClusterSynced"
	ErrClusterResourceExists = "ErrClusterResourceExists"
	MessageClusterSynced     = "Cluster synced successfully"
	MessageClusterExists     = "Resource %q already exists and is not managed by Cluster"
)
View Source
const (
	DefaultResyncTemplate       = time.Second * 30
	ControllerAgentNameTemplate = "template-controller"
	TemplateKind                = "Template"

	TemplateSuccessSynced     = "TemplateSynced"
	ErrTemplateResourceExists = "ErrTemplateResourceExists"
	MessageTemplateSynced     = "Template synced successfully"
	MessageTemplateExists     = "Resource %q already exists and is not managed by Template"
)
View Source
const (
	DefaultThreadiness = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Apply

type Apply interface {
	CreateApply(clt *v1alpha1.Apply) (*v1alpha1.Apply, error)
	GetApply(ns, name string) (*v1alpha1.Apply, error)
	UpdateApply(clt *v1alpha1.Apply) (*v1alpha1.Apply, error)
	DeleteApply(ns, name string) error
	ListApplies(ns string, selector labels.Selector) ([]*v1alpha1.Apply, error)
}

type ApplyClient

type ApplyClient struct {
	// contains filtered or unexported fields
}

func NewApplyClient

func NewApplyClient(ctx context.Context, kubeClient kubernetes.Interface, customClient clientSet.Interface, threadiness int, stopCh <-chan struct{}) (*ApplyClient, error)

func (*ApplyClient) CreateApply

func (c *ApplyClient) CreateApply(tpl *v1alpha1.Apply) (*v1alpha1.Apply, error)

func (*ApplyClient) DeleteApply

func (c *ApplyClient) DeleteApply(ns, name string) error

func (*ApplyClient) GetApply

func (c *ApplyClient) GetApply(ns, name string) (*v1alpha1.Apply, error)

func (*ApplyClient) ListApplies

func (c *ApplyClient) ListApplies(ns string, selector labels.Selector) ([]*v1alpha1.Apply, error)

func (*ApplyClient) Run

func (c *ApplyClient) Run() error

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items. 启动controller

func (*ApplyClient) Start

func (c *ApplyClient) Start()

func (*ApplyClient) UpdateApply

func (c *ApplyClient) UpdateApply(tpl *v1alpha1.Apply) (*v1alpha1.Apply, error)

type Client

type Client interface {
	Run()
	Cluster
	Apply
	Template
	io.Closer
}

func NewController

func NewController(ctx context.Context, path string) (Client, error)

type Cluster

type Cluster interface {
	CreateCluster(clt *v1alpha1.Cluster) (*v1alpha1.Cluster, error)
	GetCluster(ns, name string) (*v1alpha1.Cluster, error)
	UpdateCluster(clt *v1alpha1.Cluster) (*v1alpha1.Cluster, error)
	DeleteCluster(ns, name string) error
	ListClusters(ns string, selector labels.Selector) ([]*v1alpha1.Cluster, error)
}

type ClusterClient

type ClusterClient struct {
	// contains filtered or unexported fields
}

func NewClusterClient

func NewClusterClient(ctx context.Context, kubeClient kubernetes.Interface, customClient clientSet.Interface, threadiness int, stopCh <-chan struct{}) (*ClusterClient, error)

func (*ClusterClient) CreateCluster

func (c *ClusterClient) CreateCluster(clt *v1alpha1.Cluster) (*v1alpha1.Cluster, error)

func (*ClusterClient) DeleteCluster

func (c *ClusterClient) DeleteCluster(ns, name string) error

func (*ClusterClient) GetCluster

func (c *ClusterClient) GetCluster(ns, name string) (*v1alpha1.Cluster, error)

func (*ClusterClient) ListClusters

func (c *ClusterClient) ListClusters(ns string, selector labels.Selector) ([]*v1alpha1.Cluster, error)

func (*ClusterClient) Run

func (c *ClusterClient) Run() error

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items. 启动controller

func (*ClusterClient) Start

func (c *ClusterClient) Start()

func (*ClusterClient) UpdateCluster

func (c *ClusterClient) UpdateCluster(clt *v1alpha1.Cluster) (*v1alpha1.Cluster, error)

type Config

type Config struct {
	Kube struct {
		OutCluster bool   `yaml:"outCluster" json:"outCluster"`
		ConfigPath string `yaml:"configPath" json:"configPath" default:"kubeconfig.yaml"`
	} `yaml:"kube" json:"kube"`
}

type Controller

type Controller interface {
	Start()
	Run() error
}

type Template

type Template interface {
	CreateTemplate(clt *v1alpha1.Template) (*v1alpha1.Template, error)
	GetTemplate(ns, name string) (*v1alpha1.Template, error)
	UpdateTemplate(clt *v1alpha1.Template) (*v1alpha1.Template, error)
	DeleteTemplate(ns, name string) error
	ListTemplates(ns string, selector labels.Selector) ([]*v1alpha1.Template, error)
}

type TemplateClient

type TemplateClient struct {
	// contains filtered or unexported fields
}

func NewTemplateClient

func NewTemplateClient(ctx context.Context, kubeClient kubernetes.Interface, customClient clientSet.Interface, threadiness int, stopCh <-chan struct{}) (*TemplateClient, error)

func (*TemplateClient) CreateTemplate

func (c *TemplateClient) CreateTemplate(tpl *v1alpha1.Template) (*v1alpha1.Template, error)

func (*TemplateClient) DeleteTemplate

func (c *TemplateClient) DeleteTemplate(ns, name string) error

func (*TemplateClient) GetTemplate

func (c *TemplateClient) GetTemplate(ns, name string) (*v1alpha1.Template, error)

func (*TemplateClient) ListTemplates

func (c *TemplateClient) ListTemplates(ns string, selector labels.Selector) ([]*v1alpha1.Template, error)

func (*TemplateClient) Run

func (c *TemplateClient) Run() error

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items. 启动controller

func (*TemplateClient) Start

func (c *TemplateClient) Start()

func (*TemplateClient) UpdateTemplate

func (c *TemplateClient) UpdateTemplate(tpl *v1alpha1.Template) (*v1alpha1.Template, error)

Directories

Path Synopsis
apis
client
clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
clientset/versioned/typed/baetyl/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/versioned/typed/baetyl/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL