v1

package
v0.0.0-...-0536e8a Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 8 Imported by: 16

Documentation

Overview

Package v1 contains API Schema definitions for the kubekey v1 API group +k8s:deepcopy-gen=package,register +groupName=kubekey.kubesphere.io

Index

Constants

View Source
const (
	// InventoryCAPKKFinalizer is used to waiting ref playbook compelete when inventory is deleted.
	InventoryCAPKKFinalizer = "inventory.kubekey.kubesphere.io/capkk"

	// HostCheckPlaybookAnnotation store which playbook is used to check hosts.
	HostCheckPlaybookAnnotation = "playbook.kubekey.kubesphere.io/host-check"
)
View Source
const (
	// BuiltinsProjectAnnotation use builtins project of KubeKey
	BuiltinsProjectAnnotation = "kubekey.kubesphere.io/builtins-project"

	// PlaybookCompletedFinalizer will be removed after the Playbook is completed.
	PlaybookCompletedFinalizer = "kubekey.kubesphere.io/playbook-completed"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "kubekey.kubesphere.io", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func GetHostsFromGroup

func GetHostsFromGroup(inv *Inventory, groupName string, unavailableHosts, unavailableGroups map[string]struct{}) []string

GetHostsFromGroup flatten a specific `Inventory` group with de-duplication.

Types

type Config

type Config struct {
	metav1.TypeMeta `json:",inline"`

	Spec runtime.RawExtension `json:"spec,omitempty"`
}

Config store global vars for playbook.

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Config) MarshalJSON

func (c *Config) MarshalJSON() ([]byte, error)

MarshalJSON ensures spec.Object is converted back to spec.Raw

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes spec.Raw into spec.Object

func (*Config) Value

func (c *Config) Value() map[string]any

Value returns the underlying map[string]any from the Config's unstructured Object. This provides direct access to the config values stored in Spec.Object.

type Inventory

type Inventory struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   InventorySpec   `json:"spec,omitempty"`
	Status InventoryStatus `json:"status,omitempty"`
}

Inventory store hosts vars for playbook.

func (*Inventory) DeepCopy

func (in *Inventory) DeepCopy() *Inventory

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Inventory.

func (*Inventory) DeepCopyInto

func (in *Inventory) DeepCopyInto(out *Inventory)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Inventory) DeepCopyObject

func (in *Inventory) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InventoryGroup

type InventoryGroup struct {
	Groups []string             `json:"groups,omitempty"`
	Hosts  []string             `json:"hosts"`
	Vars   runtime.RawExtension `json:"vars,omitempty"`
}

InventoryGroup of Inventory

func (*InventoryGroup) DeepCopy

func (in *InventoryGroup) DeepCopy() *InventoryGroup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryGroup.

func (*InventoryGroup) DeepCopyInto

func (in *InventoryGroup) DeepCopyInto(out *InventoryGroup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InventoryHost

type InventoryHost map[string]runtime.RawExtension

InventoryHost of Inventory

func (InventoryHost) DeepCopy

func (in InventoryHost) DeepCopy() InventoryHost

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryHost.

func (InventoryHost) DeepCopyInto

func (in InventoryHost) DeepCopyInto(out *InventoryHost)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InventoryList

type InventoryList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Inventory `json:"items"`
}

InventoryList of Inventory

func (*InventoryList) DeepCopy

func (in *InventoryList) DeepCopy() *InventoryList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryList.

func (*InventoryList) DeepCopyInto

func (in *InventoryList) DeepCopyInto(out *InventoryList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*InventoryList) DeepCopyObject

func (in *InventoryList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InventoryPhase

type InventoryPhase string

InventoryPhase of inventory. it's always use in capkk to judge if host has checked.

const (
	// InventoryPhasePending inventory has created but has never been checked once
	InventoryPhasePending InventoryPhase = "Pending"
	// InventoryPhaseRunning inventory host_check playbook is running.
	InventoryPhaseRunning InventoryPhase = "Running"
	// InventoryPhaseReady inventory host_check playbook run successfully.
	InventoryPhaseSucceeded InventoryPhase = "Succeeded"
	// InventoryPhaseReady inventory host_check playbook run check failed.
	InventoryPhaseFailed InventoryPhase = "Failed"
)

type InventorySpec

type InventorySpec struct {
	// Hosts is all nodes
	Hosts InventoryHost `json:"hosts"`
	// Vars for all host. the priority for vars is: host vars > group vars > inventory vars
	// +optional
	// +kubebuilder:pruning:PreserveUnknownFields
	Vars runtime.RawExtension `json:"vars,omitempty"`
	// Groups nodes. a group contains repeated nodes
	// +optional
	Groups map[string]InventoryGroup `json:"groups,omitempty"`
}

InventorySpec of Inventory

func (*InventorySpec) DeepCopy

func (in *InventorySpec) DeepCopy() *InventorySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventorySpec.

func (*InventorySpec) DeepCopyInto

func (in *InventorySpec) DeepCopyInto(out *InventorySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InventoryStatus

type InventoryStatus struct {
	// Ready is the inventory ready to be used.
	Ready bool `json:"ready,omitempty"`
	// Phase is the inventory phase.
	Phase InventoryPhase `json:"phase,omitempty"`
}

InventoryStatus of Inventory

func (*InventoryStatus) DeepCopy

func (in *InventoryStatus) DeepCopy() *InventoryStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryStatus.

func (*InventoryStatus) DeepCopyInto

func (in *InventoryStatus) DeepCopyInto(out *InventoryStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Playbook

type Playbook struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PlaybookSpec   `json:"spec,omitempty"`
	Status PlaybookStatus `json:"status,omitempty"`
}

Playbook is the Schema for the playbooks API. Playbook resource executor a playbook.

func (*Playbook) DeepCopy

func (in *Playbook) DeepCopy() *Playbook

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Playbook.

func (*Playbook) DeepCopyInto

func (in *Playbook) DeepCopyInto(out *Playbook)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Playbook) DeepCopyObject

func (in *Playbook) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PlaybookFailedReason

type PlaybookFailedReason string

PlaybookFailedReason is the reason why a Playbook failed.

const (
	// PlaybookFailedReasonUnknown is the default failed reason.
	PlaybookFailedReasonUnknown PlaybookFailedReason = "unknown"
	// PlaybookFailedReasonPodFailed pod exec failed.
	PlaybookFailedReasonPodFailed PlaybookFailedReason = "pod executor failed"
	// PlaybookFailedReasonTaskFailed task exec failed.
	PlaybookFailedReasonTaskFailed PlaybookFailedReason = "task executor failed"
)

type PlaybookList

type PlaybookList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Playbook `json:"items"`
}

PlaybookList contains a list of Playbook.

func (*PlaybookList) DeepCopy

func (in *PlaybookList) DeepCopy() *PlaybookList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlaybookList.

func (*PlaybookList) DeepCopyInto

func (in *PlaybookList) DeepCopyInto(out *PlaybookList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PlaybookList) DeepCopyObject

func (in *PlaybookList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PlaybookPhase

type PlaybookPhase string

PlaybookPhase of Playbook

const (
	// PlaybookPhasePending of Playbook. Playbook has created but not deal
	PlaybookPhasePending PlaybookPhase = "Pending"
	// PlaybookPhaseRunning of Playbook. deal Playbook.
	PlaybookPhaseRunning PlaybookPhase = "Running"
	// PlaybookPhaseFailed of Playbook. once Task run failed.
	PlaybookPhaseFailed PlaybookPhase = "Failed"
	// PlaybookPhaseSucceed of Playbook. all Tasks run success.
	PlaybookPhaseSucceeded PlaybookPhase = "Succeeded"
)

type PlaybookProject

type PlaybookProject struct {
	// Addr is the storage for executable packages (in Ansible file format).
	// When starting with http or https, it will be obtained from a Git repository.
	// When starting with file path, it will be obtained from the local path.
	// +optional
	Addr string `json:"addr,omitempty"`
	// Name is the project name base project
	// +optional
	Name string `json:"name,omitempty"`
	// Branch is the git branch of the git Addr.
	// +optional
	Branch string `json:"branch,omitempty"`
	// Tag is the git branch of the git Addr.
	// +optional
	Tag string `json:"tag,omitempty"`
	// InsecureSkipTLS skip tls or not when git addr is https.
	// +optional
	InsecureSkipTLS bool `json:"insecureSkipTLS,omitempty"`
	// Token of Authorization for http request
	// +optional
	Token string `json:"token,omitempty"`
}

PlaybookProject respect which playbook store.

func (*PlaybookProject) DeepCopy

func (in *PlaybookProject) DeepCopy() *PlaybookProject

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlaybookProject.

func (*PlaybookProject) DeepCopyInto

func (in *PlaybookProject) DeepCopyInto(out *PlaybookProject)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PlaybookSpec

type PlaybookSpec struct {
	// Project is storage for executable packages
	// +optional
	Project PlaybookProject `json:"project,omitempty"`
	// Playbook which to execute.
	Playbook string `json:"playbook"`
	// InventoryRef is the node configuration for playbook
	// +optional
	InventoryRef *corev1.ObjectReference `json:"inventoryRef,omitempty"`
	// Config is the global variable configuration for playbook
	// +optional
	Config Config `json:"config,omitempty"`
	// Tags is the tags of playbook which to execute
	// +optional
	Tags []string `json:"tags,omitempty"`
	// SkipTags is the tags of playbook which skip execute
	// +optional
	SkipTags []string `json:"skipTags,omitempty"`
	// Volumes in job pod.
	// +optional
	Volumes []corev1.Volume `json:"workVolume,omitempty"`
	// VolumeMounts in job pod.
	// +optional
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
	// ServiceAccountName is the name of the ServiceAccount to use to run this pod.
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
}

PlaybookSpec defines the desired state of Playbook.

func (*PlaybookSpec) DeepCopy

func (in *PlaybookSpec) DeepCopy() *PlaybookSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlaybookSpec.

func (*PlaybookSpec) DeepCopyInto

func (in *PlaybookSpec) DeepCopyInto(out *PlaybookSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PlaybookStatistics

type PlaybookStatistics struct {
	// Total number of tasks
	Total int `json:"total,omitempty"`
	// Number of successful tasks
	Success int `json:"success,omitempty"`
	// Number of failed tasks
	Failed int `json:"failed,omitempty"`
	// Number of ignored tasks
	Ignored int `json:"ignored,omitempty"`
}

PlaybookStatistics contains statistics of task counts.

func (*PlaybookStatistics) DeepCopy

func (in *PlaybookStatistics) DeepCopy() *PlaybookStatistics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlaybookStatistics.

func (*PlaybookStatistics) DeepCopyInto

func (in *PlaybookStatistics) DeepCopyInto(out *PlaybookStatistics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PlaybookStatus

type PlaybookStatus struct {
	// Statistics statistics of task counts
	Statistics PlaybookStatistics `json:"statistics,omitempty"`
	// Result will record the results detail.
	Result runtime.RawExtension `json:"result,omitempty"`
	// Phase of playbook.
	Phase PlaybookPhase `json:"phase,omitempty"`
	// FailureReason will be set in the event that there is a terminal problem
	// +optional
	FailureReason PlaybookFailedReason `json:"failureReason,omitempty"`
	// FailureMessage will be set in the event that there is a terminal problem
	// +optional
	FailureMessage string `json:"failureMessage,omitempty"`
}

PlaybookStatus defines the observed state of Playbook.

func (*PlaybookStatus) DeepCopy

func (in *PlaybookStatus) DeepCopy() *PlaybookStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlaybookStatus.

func (*PlaybookStatus) DeepCopyInto

func (in *PlaybookStatus) DeepCopyInto(out *PlaybookStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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