Documentation ¶
Index ¶
- Variables
- func Clientsets(cfg *rest.Config) (kubernetes.Interface, clientset.Interface, error)
- func CreateCRD(cs clientset.Interface, c CustomResource) error
- func InClusterClientsets() (*rest.Config, kubernetes.Interface, clientset.Interface, error)
- func RESTClient(cfg *rest.Config, sgv *schema.GroupVersion, schemeBuilders ...SchemeBuilder) (*rest.RESTClient, error)
- func TypeName(o interface{}) string
- type CustomResource
- func (c CustomResource) Definition() *apiextv1beta1.CustomResourceDefinition
- func (c CustomResource) FullName() string
- func (c CustomResource) GetName() string
- func (c CustomResource) GetPlural() string
- func (c CustomResource) GroupVersion() schema.GroupVersion
- func (c CustomResource) GroupVersionKind() schema.GroupVersionKind
- func (c CustomResource) Kind() string
- type Logging
- type SchemeBuilder
- type Watcher
Constants ¶
This section is empty.
Variables ¶
var ResyncPeriod = 5 * time.Second
ResyncPeriod is the delay between resync actions from the controller. This can be overwritten at package level to define the ResyncPeriod for the controller.
Functions ¶
func Clientsets ¶
Clientsets returns a set of clientsets for the given configuration.
func CreateCRD ¶
func CreateCRD(cs clientset.Interface, c CustomResource) error
CreateCRD creates and registers a CRD with the k8s cluster.
func InClusterClientsets ¶
InClusterClientsets creates the in cluster configured clientsets with the rest.InClusterConfig.
func RESTClient ¶
func RESTClient(cfg *rest.Config, sgv *schema.GroupVersion, schemeBuilders ...SchemeBuilder) (*rest.RESTClient, error)
RESTClient configures a new REST Client to be able to understand all the schemes defined. This way users can query objects associated with this scheme.
Types ¶
type CustomResource ¶
type CustomResource struct { Name string Plural string Group string Version string Aliases []string Scope v1beta1.ResourceScope Object runtime.Object Validation *v1beta1.CustomResourceValidation }
CustomResource describes the configuration values for a CustomResourceDefinition.
func (CustomResource) Definition ¶
func (c CustomResource) Definition() *apiextv1beta1.CustomResourceDefinition
Definition returns the CustomResourceDefinition that is linked to this CustomResource.
func (CustomResource) FullName ¶
func (c CustomResource) FullName() string
FullName returns the combined name of the Plural and the Group.
func (CustomResource) GetName ¶
func (c CustomResource) GetName() string
GetName returns the CustomResource Name. If no name is specified, the lowercased kind is used.
func (CustomResource) GetPlural ¶
func (c CustomResource) GetPlural() string
GetPlural returns the pluralisation of the CustomResource. If no Plural value is specified, an 's' will be added to the Name.
func (CustomResource) GroupVersion ¶
func (c CustomResource) GroupVersion() schema.GroupVersion
GroupVersion returns the GroupVersion Schema representation of this CustomResource.
func (CustomResource) GroupVersionKind ¶
func (c CustomResource) GroupVersionKind() schema.GroupVersionKind
GroupVersionKind returns the GroupVersionKind Schema representation of this CustomResource.
func (CustomResource) Kind ¶
func (c CustomResource) Kind() string
Kind returns the Type Name of the CustomResource Object.
type Logging ¶
type Logging interface {
Infof(string, ...interface{})
}
Logging represents the interface kubekit uses for its logger instance.
var Logger Logging = &defaultLogger{}
Logger is the implementation of Logging which kubekit uses to log all it's information.
type SchemeBuilder ¶
SchemeBuilder allows us to add runtime.Scheme objects to our RESTClient.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher represents a CRD Watcher Object. It knows enough details about a CRD to be able to create a controller and watch for changes.
func NewWatcher ¶
func NewWatcher(cg cache.Getter, namespace string, resource *CustomResource, handler cache.ResourceEventHandler) *Watcher
NewWatcher returns a new watcher that can be used to watch in a given namespace. If namespace is an empty string, all namespaces will be watched.
Directories ¶
Path | Synopsis |
---|---|
Package patcher is heavily inspired by the work done in the Kubernetes kubectl package (https://github.com/kubernetes/kubernetes/tree/master/pkg/kubectl) It has been altered to make it easier to use from an extension point of view.
|
Package patcher is heavily inspired by the work done in the Kubernetes kubectl package (https://github.com/kubernetes/kubernetes/tree/master/pkg/kubectl) It has been altered to make it easier to use from an extension point of view. |