Documentation ¶
Overview ¶
Package commands contains the actions implemented by the Kamaji kubectl plugin: these functions are abstracted and decoupled from the CLI interface, allowing third-party tools or APIs to reuse the same code-base to achieve a DRY implementation.
Index ¶
- Variables
- type Helper
- func (h *Helper) GetKubeconfig(ctx context.Context, namespace, name, secretKey string) (*clientcmdapi.Config, []byte, error)
- func (h *Helper) JoinToken(ctx context.Context, namespace, name string, skipExpired bool, flavour string) (string, error)
- func (h *Helper) RotateCertificate(ctx context.Context, namespace, name string, certificates RotateCertOptions) error
- func (h *Helper) RotateKubeconfig(ctx context.Context, namespace, name string, ...) error
- type RotateCertOptions
- type RotateKubeconfigOptions
Constants ¶
This section is empty.
Variables ¶
var RotateCertificatesMap = RotateCertOptions{
"APIServer": "api-server-certificate",
"APIServerKubeletClient": "api-server-kubelet-client-certificate",
"FrontProxyCA": "front-proxy-ca-certificate",
"FrontProxyClient": "front-proxy-client-certificate",
"Konnectivity": "konnectivity-certificate",
}
var RotateKubeconfigMap = RotateKubeconfigOptions{
"Admin": "admin-kubeconfig",
"ControllerManager": "controller-manager-kubeconfig",
"Konnectivity": "konnectivity-kubeconfig",
"Scheduler": "scheduler-kubeconfig",
}
Functions ¶
This section is empty.
Types ¶
type Helper ¶
func (*Helper) GetKubeconfig ¶
func (h *Helper) GetKubeconfig(ctx context.Context, namespace, name, secretKey string) (*clientcmdapi.Config, []byte, error)
GetKubeconfig is the proper function that performs the retrieval of the decoded kubeconfig: it's used by the kubectl-kamaji plugin, but it can be used at convenience of any other implementation. It returns the decoded content of the administrator kubeconfig, or any other error.
func (*Helper) JoinToken ¶
func (h *Helper) JoinToken(ctx context.Context, namespace, name string, skipExpired bool, flavour string) (string, error)
JoinToken returns the command to let a worker node join a given Tenant Control Plane. The variable flavour allows specifying which bootstrap tool to format to: currently supported yaki, and kubeadm.
func (*Helper) RotateCertificate ¶
func (h *Helper) RotateCertificate(ctx context.Context, namespace, name string, certificates RotateCertOptions) error
RotateCertificate performs the rotation of Tenant Control Plane certificates. Despite rotation is currently managed by the CertificateLifeCycle controller, this action could be used to generate a new pair of ones. When rotating the API Server one, a reload of the Control Plane pods will be triggered.
func (*Helper) RotateKubeconfig ¶
func (h *Helper) RotateKubeconfig(ctx context.Context, namespace, name string, kubeconfig RotateKubeconfigOptions) error
RotateKubeconfig allows rotating the components' kubeconfig resources, despite this is already done by Kamaji via its CertificateLifeCycle controller. Except for the Admin one, all other components will trigger a Tenant Control Plane reload.
type RotateCertOptions ¶
func (RotateCertOptions) Keys ¶
func (opts RotateCertOptions) Keys() []string
type RotateKubeconfigOptions ¶
func (RotateKubeconfigOptions) Keys ¶
func (opts RotateKubeconfigOptions) Keys() []string