v1alpha1

package
v0.0.0-...-309b3d5 Latest Latest
Warning

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

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

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the serverless v1alpha1 API group +kubebuilder:object:generate=true +groupName=serverless.vke.volcengine.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "serverless.vke.volcengine.com", Version: "v1alpha1"}

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

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

Functions

This section is empty.

Types

type InjectConfig

type InjectConfig struct {
	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
	// Important: Run "make" to regenerate code after modifying this file
	// selector is a label query over pods that should be injected
	Selector *metav1.LabelSelector `json:"selector,omitempty"`

	// InjectKidecar indicates whether to inject the kidecar instead of user define
	InjectKidecar bool `json:"injectKidecar,omitempty"`

	// UseKubeNativeSidecar indicates whether to use the kube native sidecar, kube version must higher than 1.28
	UseKubeNativeSidecar bool `json:"useKubeNativeSidecar,omitempty"`

	// Namespace sidecarSet will only match the pods in the namespace
	// otherwise, match pods in all namespaces(in cluster)
	Namespace string `json:"namespace,omitempty"`

	// NamespaceSelector select which namespaces to inject sidecar containers.
	// Default to the empty LabelSelector, which matches everything.
	NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`

	// InitContainers is the list of init containers to be injected into the selected pod
	// We will inject those containers by their name in ascending order
	// We only inject init containers when a new pod is created, it does not apply to any existing pod
	// +patchMergeKey=name
	// +patchStrategy=merge
	InitContainers []corev1.Container `json:"initContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

	// Containers is the list of sidecar containers to be injected into the selected pod
	// +patchMergeKey=name
	// +patchStrategy=merge
	Containers []corev1.Container `json:"containers,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

	// List of volumes that can be mounted by sidecar containers
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	// +patchMergeKey=name
	// +patchStrategy=merge
	Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
	// VolumeMounts is the list of VolumeMounts that can be mounted by sidecar containers
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	// +patchMergeKey=name
	// +patchStrategy=merge
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
	// ForceInjectServiceAccount indicates whether to inject the service account to the pod forcely
	ForceInjectServiceAccount *bool `json:"forceInjectServiceAccount,omitempty"`
	// ServiceAccountName is the name of the service account to inject to the pod
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
	// ShareProcessNamespace indicates whether to share the process namespace with the pod
	ShareProcessNamespace *bool `json:"shareProcessNamespace,omitempty"`
}

InjectConfig defines the configuration for the sidecar injection

func (*InjectConfig) DeepCopy

func (in *InjectConfig) DeepCopy() *InjectConfig

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

func (*InjectConfig) DeepCopyInto

func (in *InjectConfig) DeepCopyInto(out *InjectConfig)

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

type KidecarConfig

type KidecarConfig struct {
	Plugins           []PluginConfig    `json:"plugins"`           // 启动的插件及其配置
	RestartPolicy     string            `json:"restartPolicy"`     // 重启策略
	Resources         map[string]string `json:"resources"`         // Sidecar 所需的资源
	SidecarStartOrder string            `json:"sidecarStartOrder"` // Sidecar 的启动顺序,是在主容器之后还是之前
}

func (*KidecarConfig) DeepCopy

func (in *KidecarConfig) DeepCopy() *KidecarConfig

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

func (*KidecarConfig) DeepCopyInto

func (in *KidecarConfig) DeepCopyInto(out *KidecarConfig)

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

type PluginConfig

type PluginConfig struct {
	Name string `json:"name"`
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	Config    runtime.RawExtension `json:"config"`
	BootOrder int                  `json:"bootOrder"`
}

PluginConfig 表示插件的配置

func (*PluginConfig) DeepCopy

func (in *PluginConfig) DeepCopy() *PluginConfig

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

func (*PluginConfig) DeepCopyInto

func (in *PluginConfig) DeepCopyInto(out *PluginConfig)

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

type SidecarConfig

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

	Spec   SidecarConfigSpec   `json:"spec,omitempty"`
	Status SidecarConfigStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:shortName=scc,scope="Cluster" +kubebuilder:printcolumn:name="MatchedPods",type="integer",JSONPath=".status.matchedPods" +kubebuilder:printcolumn:name="UpdatedPods",type="integer",JSONPath=".status.updatedPods" +kubebuilder:printcolumn:name="ReadyPods",type="integer",JSONPath=".status.readyPods" SidecarConfig is the Schema for the sidecarconfigs API

func (*SidecarConfig) DeepCopy

func (in *SidecarConfig) DeepCopy() *SidecarConfig

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

func (*SidecarConfig) DeepCopyInto

func (in *SidecarConfig) DeepCopyInto(out *SidecarConfig)

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

func (*SidecarConfig) DeepCopyObject

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

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

func (*SidecarConfig) Default

func (r *SidecarConfig) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*SidecarConfig) SetupWebhookWithManager

func (r *SidecarConfig) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager will setup the manager to manage the webhooks

func (*SidecarConfig) ValidateCreate

func (r *SidecarConfig) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*SidecarConfig) ValidateDelete

func (r *SidecarConfig) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*SidecarConfig) ValidateUpdate

func (r *SidecarConfig) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type SidecarConfigList

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

+kubebuilder:object:root=true SidecarConfigList contains a list of SidecarConfig

func (*SidecarConfigList) DeepCopy

func (in *SidecarConfigList) DeepCopy() *SidecarConfigList

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

func (*SidecarConfigList) DeepCopyInto

func (in *SidecarConfigList) DeepCopyInto(out *SidecarConfigList)

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

func (*SidecarConfigList) DeepCopyObject

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

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

type SidecarConfigSpec

type SidecarConfigSpec struct {
	// Injection contains the configuration settings for the injection process.
	Injection InjectConfig `json:"injection"`
	// Kidecar contains the specific configuration settings for the Kidecar system.
	Kidecar KidecarConfig `json:"kidecar"`
}

SidecarConfigSpec defines the desired state of SidecarConfig

func (*SidecarConfigSpec) DeepCopy

func (in *SidecarConfigSpec) DeepCopy() *SidecarConfigSpec

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

func (*SidecarConfigSpec) DeepCopyInto

func (in *SidecarConfigSpec) DeepCopyInto(out *SidecarConfigSpec)

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

type SidecarConfigStatus

type SidecarConfigStatus struct {
	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
	// Important: Run "make" to regenerate code after modifying this file
	// matchedPods is the number of Pods whose labels are matched with this SidecarSet's selector and are created after sidecarset creates
	MatchedPods int32 `json:"matchedPods"`

	// updatedPods is the number of matched Pods that are injected with the latest SidecarSet's containers
	UpdatedPods int32 `json:"updatedPods"`

	// readyPods is the number of matched Pods that have a ready condition
	ReadyPods int32 `json:"readyPods"`

	// updatedReadyPods is the number of matched pods that updated and ready
	UpdatedReadyPods int32 `json:"updatedReadyPods,omitempty"`
}

SidecarConfigStatus defines the observed state of SidecarConfig

func (*SidecarConfigStatus) DeepCopy

func (in *SidecarConfigStatus) DeepCopy() *SidecarConfigStatus

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

func (*SidecarConfigStatus) DeepCopyInto

func (in *SidecarConfigStatus) DeepCopyInto(out *SidecarConfigStatus)

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