Documentation
¶
Overview ¶
Package k8s provides an interface to interact with Kubernetes resources.
Index ¶
- type Controller
- func (c *Controller) CreateResource(ctx context.Context, namespace string, resource *unstructured.Unstructured, ...) (*unstructured.Unstructured, error)
- func (c *Controller) CreateSecret(ctx context.Context, namespace string, secret *coreV1.Secret, ...) (*unstructured.Unstructured, error)
- func (c *Controller) GetResource(ctx context.Context, namespace, name string, resource schema.GroupVersionKind, ...) (*unstructured.Unstructured, error)
- func (c *Controller) UpdateResource(ctx context.Context, namespace string, resource *unstructured.Unstructured, ...) (*unstructured.Unstructured, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
Controller is a Kubernetes controller.
func NewController ¶
func NewController(opts ...Option) (*Controller, error)
NewController creates a new Kubernetes controller.
func (*Controller) CreateResource ¶
func (c *Controller) CreateResource(ctx context.Context, namespace string, resource *unstructured.Unstructured, opts metav1.CreateOptions) (*unstructured.Unstructured, error)
CreateResource creates a resource in the Kubernetes cluster.
func (*Controller) CreateSecret ¶
func (c *Controller) CreateSecret(ctx context.Context, namespace string, secret *coreV1.Secret, opts metav1.CreateOptions) (*unstructured.Unstructured, error)
CreateSecret creates a secret in the Kubernetes cluster.
func (*Controller) GetResource ¶
func (c *Controller) GetResource(ctx context.Context, namespace, name string, resource schema.GroupVersionKind, opts metav1.GetOptions) (*unstructured.Unstructured, error)
GetResource gets a resource from the Kubernetes cluster.
func (*Controller) UpdateResource ¶
func (c *Controller) UpdateResource(ctx context.Context, namespace string, resource *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error)
UpdateResource updates a resource in the Kubernetes cluster.
type Option ¶
type Option = func(*Controller)
Option is a functional option for the Controller.
func WithTimeout ¶
WithTimeout sets the timeout for the controller.
Click to show internal directories.
Click to hide internal directories.