commands

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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",
}
View Source
var RotateKubeconfigMap = RotateKubeconfigOptions{
	"Admin":             "admin-kubeconfig",
	"ControllerManager": "controller-manager-kubeconfig",
	"Konnectivity":      "konnectivity-kubeconfig",
	"Scheduler":         "scheduler-kubeconfig",
}

Functions

This section is empty.

Types

type Helper

type Helper struct {
	Client client.Client
}

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

type RotateCertOptions map[string]string

func (RotateCertOptions) Keys

func (opts RotateCertOptions) Keys() []string

type RotateKubeconfigOptions

type RotateKubeconfigOptions map[string]string

func (RotateKubeconfigOptions) Keys

func (opts RotateKubeconfigOptions) Keys() []string

Jump to

Keyboard shortcuts

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