inventory

package module
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 4 Imported by: 1

README

k8s-inventory

Shared inventory-module used by k8s-inventory-client and friends

It provides structs and functions for collecting and storing inventory information.

This module is used by:

  • k8s-inventory-client
  • k8s-inventory-server

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CalicoClusterInformation

type CalicoClusterInformation struct {
	PartialObject

	Spec   CalicoClusterInformationSpec   `json:"spec"`
	Status CalicoClusterInformationStatus `json:"status"`
}

func NewCalicoClusterInformation

func NewCalicoClusterInformation() *CalicoClusterInformation

type CalicoClusterInformationSpec

type CalicoClusterInformationSpec struct {
	Version string `json:"version"`
}

type CalicoClusterInformationStatus

type CalicoClusterInformationStatus struct{}

type Capabilities

type Capabilities struct {
	Add  []string `json:"add,omitempty"`
	Drop []string `json:"drop,omitempty"`
}

type Cluster

type Cluster struct {
	// FQDN
	FQDN string `json:"fqdn" validate:"omitempty,fqdn"`

	// Like `kubectl version -o json`
	Version     string `json:"semverVersion"`
	FullVersion string `json:"version"`
	GitCommit   string `json:"gitCommit"`
	BuildDate   string `json:"buildDate"`

	// Where/on what is the cluster running
	KubernetesProvider     string `json:"kubernetesProvider"`
	InfrastructureProvider string `json:"infrastructureProvider"`

	// Secure Cloud Stack Information
	ProviderName string `json:"providerName" validate:"required"`
	Name         string `json:"name"          validate:"required"`
}

func NewCluster

func NewCluster() *Cluster

type Container

type Container struct {
	Name            string               `json:"name"`
	Image           string               `json:"image,omitempty"`
	Command         []string             `json:"command,omitempty"`
	Args            []string             `json:"args,omitempty"`
	WorkingDir      string               `json:"workingDir,omitempty"`
	Ports           []ContainerPort      `json:"ports,omitempty"`
	Resources       ResourceRequirements `json:"resources,omitempty"`
	RestartPolicy   *string              `json:"restartPolicy,omitempty"`
	VolumeMounts    []VolumeMount        `json:"volumeMounts,omitempty"`
	ImagePullPolicy string               `json:"imagePullPolicy,omitempty"`
	SecurityContext *SecurityContext     `json:"securityContext,omitempty"`
}

type ContainerPort

type ContainerPort struct {
	Name          string `json:"name,omitempty"`
	HostPort      int32  `json:"hostPort,omitempty"`
	ContainerPort int32  `json:"containerPort"`
	Protocol      string `json:"protocol,omitempty"`
	HostIP        string `json:"hostIP,omitempty"`
}

type ContainerState

type ContainerState struct {
	Waiting    *ContainerStateWaiting    `json:"waiting,omitempty"`
	Running    *ContainerStateRunning    `json:"running,omitempty"`
	Terminated *ContainerStateTerminated `json:"terminated,omitempty"`
}

type ContainerStateRunning

type ContainerStateRunning struct {
	StartedAt metav1.Time `json:"startedAt,omitempty"`
}

type ContainerStateTerminated

type ContainerStateTerminated struct {
	ExitCode    int32       `json:"exitCode"`
	Signal      int32       `json:"signal,omitempty"`
	Reason      string      `json:"reason,omitempty"`
	Message     string      `json:"message,omitempty"`
	StartedAt   metav1.Time `json:"startedAt,omitempty"`
	FinishedAt  metav1.Time `json:"finishedAt,omitempty"`
	ContainerID string      `json:"containerID,omitempty"`
}

type ContainerStateWaiting

type ContainerStateWaiting struct {
	Reason  string `json:"reason,omitempty"`
	Message string `json:"message,omitempty"`
}

type ContainerStatus

type ContainerStatus struct {
	Name    string         `json:"name"`
	State   ContainerState `json:"state,omitempty"`
	Ready   bool           `json:"ready"`
	Image   string         `json:"image"`
	ImageID string         `json:"imageID"`
}

type CronJobSpec

type CronJobSpec struct {
	Schedule          string       `json:"schedule"`
	ConcurrencyPolicy string       `json:"concurrencyPolicy"`
	JobTemplate       *PodTemplate `json:"jobTemplate"`
}

type CronJobStatus

type CronJobStatus struct {
	LastScheduleTime   *metav1.Time `json:"lastScheduleTime,omitempty"`
	LastSuccessfulTime *metav1.Time `json:"lastSuccessfulTime,omitempty"`
}

type CustomResources

type CustomResources struct {
	Velero             *Velero                   `json:"velero"`
	KCIRocks           *KCIRocks                 `json:"kciRocks"`
	RabbitMQ           *RabbitMQ                 `json:"rabbitMQ"`
	CalicoCluster      *CalicoClusterInformation `json:"calicoCluster"`
	HasContour         bool                      `json:"hasContour"`
	HasVelero          bool                      `json:"hasVelero"`
	HasKCIRocks        bool                      `json:"hasKCIRocks"`
	HasRabbitMQ        bool                      `json:"hasRabbitMQ"`
	HasCalico          bool                      `json:"hasCalico"`
	HasExternalSecrets bool                      `json:"hasExternalSecrets"`
	HasCertManager     bool                      `json:"hasCertManager"`
	HasGitOpsToolkit   bool                      `json:"hasGitOpsToolkit"`
	HasPrometheus      bool                      `json:"hasPrometheus"`
}

func NewCustomResources

func NewCustomResources() *CustomResources

type DaemonSetSpec

type DaemonSetSpec struct {
	Template       *PodTemplate `json:"template"`
	UpdateStrategy string       `json:"updateStrategy"`
}

type DaemonSetStatus

type DaemonSetStatus struct {
	CurrentNumberScheduled int32 `json:"currentNumberScheduled"`
	NumberMisscheduled     int32 `json:"numberMisscheduled"`
	DesiredNumberScheduled int32 `json:"desiredNumberScheduled"`
}

type DeploymentSpec

type DeploymentSpec struct {
	Replicas *int32       `json:"replicas"`
	Strategy string       `json:"strategy"`
	Template *PodTemplate `json:"template"`
}

type DeploymentStatus

type DeploymentStatus struct {
	Replicas            int32 `json:"replicas"`
	ReadyReplicas       int32 `json:"readyReplicas"`
	UpdatedReplicas     int32 `json:"updatedReplicas"`
	AvailableReplicas   int32 `json:"availableReplicas"`
	UnavailableReplicas int32 `json:"unavailableReplicas"`
}

type IPBlock

type IPBlock struct {
	CIDR   string   `json:"cidr,omitempty"`
	Except []string `json:"except,omitempty"`
}

type IntOrString

type IntOrString struct {
	Type   int    `json:"type"`
	IntVal int32  `json:"intVal"`
	StrVal string `json:"strVal"`
}

type Inventory

type Inventory struct {
	Cluster             *Cluster         `json:"cluster"`
	Nodes               Nodes            `json:"nodes"`
	Namespaces          Namespaces       `json:"namespaces"`
	Workloads           Workloads        `json:"workloads"`
	Storage             *Storage         `json:"storage"`
	NetworkPolicies     NetworkPolicies  `json:"networkPolicies"`
	CustomResources     *CustomResources `json:"customResources"`
	CollectedAt         metav1.Time      `json:"collectedAt"`
	CollectionSucceeded bool             `json:"collectionSucceeded"`
	CollectionErrors    []string         `json:"collectionErrors"`
	ClientVersion       string           `json:"clientVersion"`
	ClientCommit        string           `json:"clientCommit"`
}

func NewInventory

func NewInventory() *Inventory

func (*Inventory) AddNamespace

func (i *Inventory) AddNamespace(n *Namespace)

func (*Inventory) AddNetworkPolicy

func (i *Inventory) AddNetworkPolicy(n *NetworkPolicy)

func (*Inventory) AddNode

func (i *Inventory) AddNode(n *Node)

func (*Inventory) AddWorkload

func (i *Inventory) AddWorkload(w *Workload)

func (*Inventory) DeleteNamespace

func (i *Inventory) DeleteNamespace(n *Namespace)

func (*Inventory) DeleteNetworkPolicy

func (i *Inventory) DeleteNetworkPolicy(n *NetworkPolicy)

func (*Inventory) DeleteNode

func (i *Inventory) DeleteNode(n *Node)

func (*Inventory) DeleteWorkload

func (i *Inventory) DeleteWorkload(w *Workload)

type JobSpec

type JobSpec struct {
	Parallelism  *int32       `json:"parallelism"`
	Completions  *int32       `json:"completions"`
	BackoffLimit *int32       `json:"backoffLimit"`
	Template     *PodTemplate `json:"template"`
}

type JobStatus

type JobStatus struct {
	StartTime      *metav1.Time `json:"startTime"`
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`
	Active         int32        `json:"active"`
	Ready          *int32       `json:"ready"`
	Succeeded      int32        `json:"succeeded"`
	Failed         int32        `json:"failed"`
}

type KCIRocks

type KCIRocks struct {
	DBInstances KCIRocksDBInstances `json:"dbInstances"`
}

func NewKCIRocks

func NewKCIRocks() *KCIRocks

func (*KCIRocks) AddDBInstance

func (k *KCIRocks) AddDBInstance(i *KCIRocksDBInstance)

func (*KCIRocks) DeleteDBInstance

func (k *KCIRocks) DeleteDBInstance(i *KCIRocksDBInstance)

type KCIRocksDBInstance

type KCIRocksDBInstance struct {
	PartialObject

	Spec   KCIRocksDBInstanceSpec   `json:"spec"`
	Status KCIRocksDBInstanceStatus `json:"status"`
}

func NewKCIRocksDBInstance

func NewKCIRocksDBInstance() *KCIRocksDBInstance

type KCIRocksDBInstanceSpec

type KCIRocksDBInstanceSpec struct {
	Engine string `json:"engine"`
	Host   string `json:"host"`
	Port   uint16 `json:"port"`
}

type KCIRocksDBInstanceStatus

type KCIRocksDBInstanceStatus struct {
	Phase string `json:"status"`
}

type KCIRocksDBInstances

type KCIRocksDBInstances = Set[*KCIRocksDBInstance]

type KubernetesAnnotations

type KubernetesAnnotations map[string]string

type KubernetesLabels

type KubernetesLabels map[string]string

type LabelSelector

type LabelSelector struct {
	MatchLabels      map[string]string          `json:"matchLabels,omitempty"`
	MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty"`
}

type LabelSelectorRequirement

type LabelSelectorRequirement struct {
	Key      string   `json:"key"`
	Operator string   `json:"operator"`
	Values   []string `json:"values,omitempty"`
}

type Namespace

type Namespace struct {
	PartialObject

	Spec   NamespaceSpec   `json:"spec"`
	Status NamespaceStatus `json:"status"`
}

func NewNamespace

func NewNamespace() *Namespace

type NamespaceSpec

type NamespaceSpec struct{}

type NamespaceStatus

type NamespaceStatus struct{}

type Namespaces

type Namespaces = Set[*Namespace]

type NetworkPolicies

type NetworkPolicies = Set[*NetworkPolicy]

type NetworkPolicy

type NetworkPolicy struct {
	PartialObject

	Spec NetworkPolicySpec `json:"spec"`
}

func NewNetworkPolicy

func NewNetworkPolicy() *NetworkPolicy

type NetworkPolicyEgressRule

type NetworkPolicyEgressRule struct {
	Ports []NetworkPolicyPort `json:"ports,omitempty"`
	To    []NetworkPolicyPeer `json:"from,omitempty"`
}

type NetworkPolicyIngressRule

type NetworkPolicyIngressRule struct {
	Ports []NetworkPolicyPort `json:"ports,omitempty"`
	From  []NetworkPolicyPeer `json:"from,omitempty"`
}

type NetworkPolicyPeer

type NetworkPolicyPeer struct {
	PodSelector       *LabelSelector `json:"podSelector,omitempty"`
	NamespaceSelector *LabelSelector `json:"namespaceSelector,omitempty"`
	IPBlock           *IPBlock       `json:"ipBlock,omitempty"`
}

type NetworkPolicyPort

type NetworkPolicyPort struct {
	Protocol *string      `json:"protocol,omitempty"`
	Port     *IntOrString `json:"port,omitempty"`
	EndPort  *int32       `json:"endPort,omitempty"`
}

func (NetworkPolicyPort) MarshalJSON

func (npp NetworkPolicyPort) MarshalJSON() ([]byte, error)

func (*NetworkPolicyPort) UnmarshalJSON

func (npp *NetworkPolicyPort) UnmarshalJSON(data []byte) error

type NetworkPolicySpec

type NetworkPolicySpec struct {
	PodSelector LabelSelector              `json:"podSelector"`
	Ingress     []NetworkPolicyIngressRule `json:"ingress,omitempty"`
	Egress      []NetworkPolicyEgressRule  `json:"egress,omitempty"`
	PolicyTypes []string                   `json:"policyTypes,omitempty"`
}

type Node

type Node struct {
	PartialObject

	Spec   NodeSpec   `json:"spec"`
	Status NodeStatus `json:"status"`

	Role           string `json:"role"`
	IsControlPlane bool   `json:"isControlPlane"`
	TopologyRegion string `json:"topologyRegion"`
	TopologyZone   string `json:"topologyZone"`
	Provider       string `json:"provider"`

	KubeProxyVersion        string `json:"kubeProxyVersion"`
	KubeletVersion          string `json:"kubeletVersion"`
	KernelVersion           string `json:"kernelVersion"`
	CRIName                 string `json:"criName"`
	CRIVersion              string `json:"criVersion"`
	ContainerRuntimeVersion string `json:"containerRuntimeVersion"`

	MemoryCapacityBytes    int64 `json:"memoryCapacityBytes"`
	MemoryAllocatableBytes int64 `json:"memoryAllocatableBytes"`
	CPUCapacityMillis      int64 `json:"cpuCapacityMillis"`
	CPUAllocatableMillis   int64 `json:"cpuAllocatableMillis"`
}

func NewNode

func NewNode() *Node

type NodeSpec

type NodeSpec struct {
	PodCIDRs      []string       `json:"podCIDRs,omitempty"`
	ProviderID    string         `json:"providerID,omitempty"`
	Unschedulable bool           `json:"unschedulable,omitempty"`
	Taints        []corev1.Taint `json:"taints,omitempty"`
}

type NodeStatus

type NodeStatus struct {
	NodeInfo corev1.NodeSystemInfo `json:"nodeInfo"`
}

type Nodes

type Nodes = Set[*Node]

type Object

type Object interface {
	GetKind() string
	GetAPIGroup() string
	GetResourceType() string
	GetAPIVersion() string
	GetName() string
	GetNamespace() string
	SetFromObjectMeta(om metav1.ObjectMeta)
	SetFromTypeMeta(tm metav1.TypeMeta)
	EqualTo(o Object) bool
}

Object represents an object with Kubernetes metadata associated

type ObjectMeta

type ObjectMeta struct {
	Name              string                `json:"name"`
	Namespace         string                `json:"namespace,omitempty"`
	CreationTimestamp metav1.Time           `json:"creationTimestamp"`
	Labels            KubernetesLabels      `json:"labels"`
	Annotations       KubernetesAnnotations `json:"annotations"`
	OwnerReferences   OwnerReferences       `json:"ownerReferences"`
}

func NewObjectMeta

func NewObjectMeta(o metav1.ObjectMeta) ObjectMeta

func (*ObjectMeta) GetName

func (o *ObjectMeta) GetName() string

func (*ObjectMeta) GetNamespace

func (o *ObjectMeta) GetNamespace() string

func (*ObjectMeta) SetFromObjectMeta

func (o *ObjectMeta) SetFromObjectMeta(om metav1.ObjectMeta)

type OwnerReference

type OwnerReference struct {
	Kind       string `json:"kind"`
	APIVersion string `json:"apiVersion"`
	Name       string `json:"name"`
	Controller *bool  `json:"controller,omitempty"`
}

type OwnerReferences

type OwnerReferences []OwnerReference

type PartialObject

type PartialObject struct {
	TypeMeta
	ObjectMeta
}

func (*PartialObject) EqualTo

func (p *PartialObject) EqualTo(o Object) bool

type PersistentVolume

type PersistentVolume struct {
	PartialObject

	Spec   PersistentVolumeSpec   `json:"spec"`
	Status PersistentVolumeStatus `json:"status"`

	Source   string `json:"source"`
	Driver   string `json:"driver"`
	Path     string `json:"path"`
	FSType   string `json:"fsType"`
	VolumeID string `json:"volumeID"`
}

func NewPersistentVolume

func NewPersistentVolume() *PersistentVolume

func (*PersistentVolume) SetPersistentVolumeSource

func (p *PersistentVolume) SetPersistentVolumeSource(o corev1.PersistentVolume)

type PersistentVolumeSpec

type PersistentVolumeSpec struct {
	Capacity         int64  `json:"capacity"`
	AccessModes      string `json:"accessModes"`
	Claim            string `json:"claim"`
	StorageClassName string `json:"storageClassName"`
	VolumeMode       string `json:"volumeMode"`
}

type PersistentVolumeStatus

type PersistentVolumeStatus struct {
	Phase   string `json:"phase"`
	Message string `json:"message"`
}

type PersistentVolumes

type PersistentVolumes = Set[*PersistentVolume]

type PodCondition

type PodCondition struct {
	Type    string `json:"type"`
	Status  string `json:"status"`
	Message string `json:"message,omitempty"`
}

type PodSecurityContext

type PodSecurityContext struct {
	RunAsUser          *int64  `json:"runAsUser,omitempty"`
	RunAsGroup         *int64  `json:"runAsGroup,omitempty"`
	RunAsNonRoot       *bool   `json:"runAsNonRoot,omitempty"`
	SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
}

type PodSpec

type PodSpec struct {
	Volumes            []Volume            `json:"volumes,omitempty"`
	InitContainers     []Container         `json:"initContainers,omitempty"`
	Containers         []Container         `json:"containers"`
	RestartPolicy      string              `json:"restartPolicy,omitempty"`
	ServiceAccountName string              `json:"serviceAccountName,omitempty"`
	NodeName           string              `json:"nodeName,omitempty"`
	HostNetwork        bool                `json:"hostNetwork,omitempty"`
	SecurityContext    *PodSecurityContext `json:"securityContext,omitempty"`
	PriorityClassName  string              `json:"priorityClassName,omitempty"`
	Priority           *int32              `json:"priority,omitempty"`
	PreemptionPolicy   *string             `json:"preemptionPolicy,omitempty"`
}

type PodStatus

type PodStatus struct {
	Phase                 string            `json:"phase,omitempty"`
	Conditions            []PodCondition    `json:"conditions,omitempty"`
	PodIP                 string            `json:"podIP,omitempty"`
	StartTime             *metav1.Time      `json:"startTime,omitempty"`
	InitContainerStatuses []ContainerStatus `json:"initContainerStatuses,omitempty"`
	ContainerStatuses     []ContainerStatus `json:"containerStatuses,omitempty"`
	QOSClass              string            `json:"qosClass,omitempty"`
}

type PodTemplate

type PodTemplate struct {
	Containers     []*PodTemplateContainer `json:"containers"`
	InitContainers []*PodTemplateContainer `json:"initContainers"`
}

func NewPodTemplate

func NewPodTemplate() *PodTemplate

type PodTemplateContainer

type PodTemplateContainer struct {
	Image          string `json:"image"`
	LimitsCPU      int64  `json:"limitsCPU"`
	LimitsMemory   int64  `json:"limitsMemory"`
	RequestsCPU    int64  `json:"requestsCPU"`
	RequestsMemory int64  `json:"requestsMemory"`
}

func NewPodTemplateContainer

func NewPodTemplateContainer() *PodTemplateContainer

type RabbitMQ

type RabbitMQ struct {
	Clusters RabbitMQClusters `json:"clusters"`
}

func NewRabbitMQ

func NewRabbitMQ() *RabbitMQ

func (*RabbitMQ) AddCluster

func (r *RabbitMQ) AddCluster(c *RabbitMQCluster)

func (*RabbitMQ) DeleteCluster

func (r *RabbitMQ) DeleteCluster(c *RabbitMQCluster)

type RabbitMQCluster

type RabbitMQCluster struct {
	PartialObject

	Spec   RabbitMQClusterSpec   `json:"spec"`
	Status RabbitMQClusterStatus `json:"status"`
}

func NewRabbitMQCluster

func NewRabbitMQCluster() *RabbitMQCluster

type RabbitMQClusterSpec

type RabbitMQClusterSpec struct {
	Replicas *int32 `json:"replicas"`
	Image    string `json:"image"`
}

type RabbitMQClusterStatus

type RabbitMQClusterStatus struct{}

type RabbitMQClusters

type RabbitMQClusters = Set[*RabbitMQCluster]

type Reference

type Reference struct {
	Kind       string `json:"kind"`
	APIGroup   string `json:"apiGroup"`
	APIVersion string `json:"apiVersion"`
	Name       string `json:"name"`
	Namespace  string `json:"namespace,omitempty"`
}

type ReplicaSetSpec

type ReplicaSetSpec struct {
	Replicas *int32       `json:"replicas"`
	Template *PodTemplate `json:"template"`
}

type ReplicaSetStatus

type ReplicaSetStatus struct {
	Replicas             int32 `json:"replicas"`
	FullyLabeledReplicas int32 `json:"fullyLabeledReplicas"`
	ReadyReplicas        int32 `json:"readyReplicas"`
	AvailableReplicas    int32 `json:"availableReplicas"`
}

type ResourceRequirements

type ResourceRequirements struct {
	LimitsCPU                int64 `json:"limitsCPU"`
	LimitsMemory             int64 `json:"limitsMemory"`
	RequestsCPU              int64 `json:"requestsCPU"`
	RequestsMemory           int64 `json:"requestsMemory"`
	RequestsStorage          int64 `json:"requestsStorage"`
	LimitsStorage            int64 `json:"limitsStorage"`
	RequestsStorageEphemeral int64 `json:"requestsStorageEphemeral"`
	LimitsStorageEphemeral   int64 `json:"limitsStorageEphemeral"`
}

type RootOwner

type RootOwner Reference

type SecurityContext

type SecurityContext struct {
	Capabilities             *Capabilities `json:"capabilities,omitempty"`
	Privileged               *bool         `json:"privileged,omitempty"`
	RunAsUser                *int64        `json:"runAsUser,omitempty"`
	RunAsGroup               *int64        `json:"runAsGroup,omitempty"`
	RunAsNonRoot             *bool         `json:"runAsNonRoot,omitempty"`
	ReadOnlyRootFilesystem   *bool         `json:"readOnlyRootFilesystem,omitempty"`
	AllowPrivilegeEscalation *bool         `json:"allowPrivilegeEscalation,omitempty"`
}

type Set

type Set[I Object] []I

Set is a set like structure based on the EqualTo methods of the given objects

func (Set[I]) Add

func (s Set[I]) Add(obj Object) Set[I]

func (Set[I]) Delete

func (s Set[I]) Delete(obj Object) Set[I]

type Spec

type Spec interface{}

type StatefulSetSpec

type StatefulSetSpec struct {
	Replicas       *int32       `json:"replicas"`
	Template       *PodTemplate `json:"template"`
	ServiceName    string       `json:"serviceName"`
	UpdateStrategy string       `json:"updateStrategy"`
}

type StatefulSetStatus

type StatefulSetStatus struct {
	Replicas          int32 `json:"replicas"`
	ReadyReplicas     int32 `json:"readyReplicas"`
	CurrentReplicas   int32 `json:"currentReplicas"`
	UpdatedReplicas   int32 `json:"updatedReplicas"`
	AvailableReplicas int32 `json:"availableReplicas"`
}

type Status

type Status interface{}

type Storage

type Storage struct {
	StorageClasses    StorageClasses    `json:"storageClasses"`
	PersistentVolumes PersistentVolumes `json:"persistentVolumes"`
}

func NewStorage

func NewStorage() *Storage

func (*Storage) AddPersistentVolume

func (s *Storage) AddPersistentVolume(pv *PersistentVolume)

func (*Storage) AddStorageClass

func (s *Storage) AddStorageClass(sc *StorageClass)

func (*Storage) DeletePersistentVolume

func (s *Storage) DeletePersistentVolume(pv *PersistentVolume)

func (*Storage) DeleteStorageClass

func (s *Storage) DeleteStorageClass(sc *StorageClass)

type StorageClass

type StorageClass struct {
	PartialObject

	Provisioner string `json:"provisioner"`
}

func NewStorageClass

func NewStorageClass() *StorageClass

type StorageClasses

type StorageClasses = Set[*StorageClass]

type TypeMeta

type TypeMeta struct {
	Kind         string `json:"kind"`
	APIGroup     string `json:"apiGroup"`
	ResourceType string `json:"resourceType"`
	APIVersion   string `json:"apiVersion"`
}

func (*TypeMeta) GetAPIGroup

func (t *TypeMeta) GetAPIGroup() string

func (*TypeMeta) GetAPIVersion

func (t *TypeMeta) GetAPIVersion() string

func (*TypeMeta) GetKind

func (t *TypeMeta) GetKind() string

func (*TypeMeta) GetResourceType

func (t *TypeMeta) GetResourceType() string

func (*TypeMeta) SetFromTypeMeta added in v0.5.1

func (t *TypeMeta) SetFromTypeMeta(tm metav1.TypeMeta)

type Velero

type Velero struct {
	Schedules VeleroSchedules `json:"schedules"`
	Backups   VeleroBackups   `json:"backups"`
}

func NewVelero

func NewVelero() *Velero

func (*Velero) AddBackup

func (v *Velero) AddBackup(b *VeleroBackup)

func (*Velero) AddSchedule

func (v *Velero) AddSchedule(s *VeleroSchedule)

func (*Velero) DeleteBackup

func (v *Velero) DeleteBackup(b *VeleroBackup)

func (*Velero) DeleteSchedule

func (v *Velero) DeleteSchedule(s *VeleroSchedule)

type VeleroBackup

type VeleroBackup struct {
	PartialObject

	Spec   VeleroBackupSpec   `json:"spec"`
	Status VeleroBackupStatus `json:"status"`
}

func NewVeleroBackup

func NewVeleroBackup() *VeleroBackup

type VeleroBackupSpec

type VeleroBackupSpec struct {
	ScheduleName       string          `json:"scheduleName"`
	ExcludedNamespaces []string        `json:"excludedNamespaces"`
	StorageLocation    string          `json:"storageLocation"`
	SnapshotVolumes    *bool           `json:"snapshotVolumes"`
	TTL                metav1.Duration `json:"ttl"`
}

type VeleroBackupStatus

type VeleroBackupStatus struct {
	StartTimestamp      *metav1.Time `json:"startTimestamp"`
	CompletionTimestamp *metav1.Time `json:"completionTimestamp"`
	Expiration          *metav1.Time `json:"expiration"`
	Phase               string       `json:"phase"`
	ItemsBackedUp       int          `json:"itemsBackedUp"`
	TotalItems          int          `json:"totalItems"`
	Warnings            int          `json:"warnings"`
	Errors              int          `json:"errors"`
	Version             int          `json:"version"`
}

type VeleroBackups

type VeleroBackups = Set[*VeleroBackup]

type VeleroSchedule

type VeleroSchedule struct {
	PartialObject

	Spec   VeleroScheduleSpec   `json:"spec"`
	Status VeleroScheduleStatus `json:"status"`
}

func NewVeleroSchedule

func NewVeleroSchedule() *VeleroSchedule

type VeleroScheduleSpec

type VeleroScheduleSpec struct {
	Schedule           string          `json:"schedule"`
	ExcludedNamespaces []string        `json:"excludedNamespaces"`
	SnapshotVolumes    *bool           `json:"snapshotVolumes"`
	TTL                metav1.Duration `json:"ttl"`
}

type VeleroScheduleStatus

type VeleroScheduleStatus struct {
	LastBackup *metav1.Time `json:"lastBackup"`
	Phase      string       `json:"phase"`
}

type VeleroSchedules

type VeleroSchedules = Set[*VeleroSchedule]

type Volume

type Volume struct {
	Name   string `json:"name"`
	Source string `json:"source"`
}

type VolumeMount

type VolumeMount struct {
	Name        string `json:"name"`
	ReadOnly    bool   `json:"readOnly,omitempty"`
	MountPath   string `json:"mountPath"`
	SubPath     string `json:"subPath,omitempty"`
	SubPathExpr string `json:"subPathExpr,omitempty"`
}

type Workload

type Workload struct {
	PartialObject

	Spec   Spec   `json:"spec"`
	Status Status `json:"status"`

	RootOwner *RootOwner `json:"rootOwner,omitempty"`
}

func NewCronJob

func NewCronJob() *Workload

func NewDaemonSet

func NewDaemonSet() *Workload

func NewDeployment

func NewDeployment() *Workload

func NewJob

func NewJob() *Workload

func NewPod

func NewPod() *Workload

func NewReplicaSet

func NewReplicaSet() *Workload

func NewStatefulSet

func NewStatefulSet() *Workload

type Workloads

type Workloads = Set[*Workload]

Jump to

Keyboard shortcuts

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