Documentation ¶
Overview ¶
Package snapshot is the snapshot of cluster
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotHandled = fmt.Errorf("resource not handled")
ErrNotHandled is returned when a resource is not handled
var Resources = []string{
"namespace",
"node",
"serviceaccount",
"configmap",
"secret",
"limitrange",
"runtimeclass.node.k8s.io",
"priorityclass.scheduling.k8s.io",
"clusterrolebindings.rbac.authorization.k8s.io",
"clusterroles.rbac.authorization.k8s.io",
"rolebindings.rbac.authorization.k8s.io",
"roles.rbac.authorization.k8s.io",
"daemonset.apps",
"deployment.apps",
"replicaset.apps",
"statefulset.apps",
"cronjob.batch",
"job.batch",
"persistentvolumeclaim",
"persistentvolume",
"pod",
"service",
"endpoints",
}
Resources is the resources of cluster want to save or restore The resource string format adheres to a GVR template. - a single string like "node" will be parsed as {resource: node} - a two-section string like "daemonset.apps" will be parsed as {resource: dasemonset, group: apps} - a three-section (or 3+) string like "foo.v1alpha1.example.com" will be parsed as {resource: foo, version: v1alpha1, group: example.com} list all resources can use: kubectl api-resources -o name
Functions ¶
This section is empty.
Types ¶
type LoadConfig ¶ added in v0.5.0
type LoadConfig struct { Clientset client.Clientset Filters []*meta.RESTMapping NoFilers bool }
LoadConfig is the a combination of the impersonation config
type Loader ¶ added in v0.5.0
type Loader struct {
// contains filtered or unexported fields
}
Loader loads the resources to cluster This way does not delete existing resources in the cluster, which will handle the ownerReference so that the resources remain relative to each other
func NewLoader ¶ added in v0.5.0
func NewLoader(loadConfig LoadConfig) (*Loader, error)
NewLoader creates a new snapshot Loader.
type PagerConfig ¶ added in v0.3.0
PagerConfig is the configuration of the list pager. It defines the page size and the page buffer size of the list pager.
type SaveConfig ¶ added in v0.3.0
type SaveConfig struct { Clientset client.Clientset PagerConfig *PagerConfig Filters []*meta.RESTMapping }
SaveConfig is the a combination of the impersonation config and the PagerConfig.
type Saver ¶ added in v0.5.0
type Saver struct {
// contains filtered or unexported fields
}
Saver is a snapshot saver.
func NewSaver ¶ added in v0.5.0
func NewSaver(saveConfig SaveConfig) (*Saver, error)
NewSaver creates a new snapshot saver.