clusterinfo

package
v3.1.0-rc.0-20240730-1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(option DumpOption) error

Types

type ChanData

type ChanData struct {
	FilePath string
	Data     interface{}
}

type ClientSet

type ClientSet struct {
	Client *kubernetes.Clientset
}

func NewDumpOption

func NewDumpOption(client *kubernetes.Clientset) *ClientSet

func (*ClientSet) GetCRD

func (c *ClientSet) GetCRD() []interface{}

func (*ClientSet) GetClusterResources

func (c *ClientSet) GetClusterResources(namespace string) map[string]map[string]map[string][]interface{}

func (*ClientSet) GetConfigMap

func (c *ClientSet) GetConfigMap(namespace string) []corev1.ConfigMap

func (*ClientSet) GetCronJobs

func (c *ClientSet) GetCronJobs(namespace string) []batchv1.CronJob

func (*ClientSet) GetDeployment

func (c *ClientSet) GetDeployment(namespace string) []appsv1.Deployment

func (*ClientSet) GetJobs

func (c *ClientSet) GetJobs(namespace string) []batchv1.Job

func (*ClientSet) GetMultiCluster

func (c *ClientSet) GetMultiCluster() ([]v1alpha2.MultiCluster, error)

func (*ClientSet) GetNamespaces

func (c *ClientSet) GetNamespaces() []corev1.Namespace

func (*ClientSet) GetNodes

func (c *ClientSet) GetNodes() []corev1.Node

func (*ClientSet) GetPersistentVolumeClaims

func (c *ClientSet) GetPersistentVolumeClaims(namespace string) []corev1.PersistentVolumeClaim

func (*ClientSet) GetPersistentVolumes

func (c *ClientSet) GetPersistentVolumes() []corev1.PersistentVolume

func (*ClientSet) GetPods

func (c *ClientSet) GetPods(namespace string) []corev1.Pod

func (*ClientSet) GetSecrets

func (c *ClientSet) GetSecrets(namespace string) []corev1.Secret

func (*ClientSet) GetServices

func (c *ClientSet) GetServices(namespace string) []corev1.Service

func (*ClientSet) GetStatefulSets

func (c *ClientSet) GetStatefulSets(namespace string) []appsv1.StatefulSet

func (*ClientSet) GetStorageClasses

func (c *ClientSet) GetStorageClasses() []interface{}

type DumpFile

type DumpFile interface {
	CreateFile(string) (*os.File, error)
	GetWireData(ChanData) []byte
	WriteFile() error
	SendData(ChanData, bool)
	ReadData(*ClientSet, string)
}

type DumpFileChan

type DumpFileChan struct {
	DumpOption
	OutFileChan chan ChanData
	Excel       *excelize.File
	WaitGroup   sync.WaitGroup
}

func NewFileChan

func NewFileChan(option DumpOption, excel *excelize.File) *DumpFileChan

func (*DumpFileChan) CreateFile

func (c *DumpFileChan) CreateFile(path string) (*os.File, error)

func (*DumpFileChan) GetWireData

func (c *DumpFileChan) GetWireData(o ChanData) []byte

func (*DumpFileChan) ReadData

func (c *DumpFileChan) ReadData(client *ClientSet, clusterName string)

func (*DumpFileChan) SendData

func (c *DumpFileChan) SendData(data ChanData, isContinue bool)

func (*DumpFileChan) WriteFile

func (c *DumpFileChan) WriteFile() error

type DumpOption

type DumpOption struct {
	Namespace     []string
	KubeConfig    string
	AllNamespaces bool
	OutputDir     string
	Type          string
	Tar           bool
	Queue         int
	Logger        bool
}

func (*DumpOption) GetOutputDir

func (c *DumpOption) GetOutputDir() string

type DumpResources

type DumpResources interface {
	GetNodes() []corev1.Node
	GetNamespaces() []corev1.Namespace
	GetConfigMap(namespace string) []corev1.ConfigMap
	GetServices(namespace string) []corev1.Service
	GetSecrets(namespace string) []corev1.Secret
	GetDeployment(namespace string) []appsv1.Deployment
	GetStatefulSets(namespace string) []appsv1.StatefulSet
	GetPods(namespace string) []corev1.Pod
	GetPersistentVolumeClaims(namespace string) []corev1.PersistentVolumeClaim
	GetPersistentVolumes() []corev1.PersistentVolume
	GetStorageClasses() []interface{}
	GetJobs(namespace string) []batchv1.Job
	GetCronJobs(namespace string) []batchv1.CronJob
	GetCRD() []interface{}
	GetClusterResources(namespace string) map[string]map[string]map[string][]interface{}
	GetMultiCluster() ([]v1alpha2.MultiCluster, error)
}

type TarOptions

type TarOptions struct {
	DumpOption
}

func NewTar

func NewTar(option DumpOption) *TarOptions

func (TarOptions) Run

func (t TarOptions) Run() error

Jump to

Keyboard shortcuts

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