v1alpha1

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the etcd.aenix.io v1alpha1 API group +kubebuilder:object:generate=true +groupName=etcd.aenix.io

Index

Constants

View Source
const (
	EtcdConditionInitialized = "Initialized"
	EtcdConditionReady       = "Ready"
)
View Source
const DefaultEtcdImage = "quay.io/coreos/etcd:v3.5.12"

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "etcd.aenix.io", 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 EmbeddedMetadataResource added in v0.2.0

type EmbeddedMetadataResource struct {
	// EmbeddedMetadata contains metadata relevant to an EmbeddedResource.
	// +optional
	EmbeddedObjectMetadata `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
}

func (*EmbeddedMetadataResource) DeepCopy added in v0.2.0

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

func (*EmbeddedMetadataResource) DeepCopyInto added in v0.2.0

func (in *EmbeddedMetadataResource) DeepCopyInto(out *EmbeddedMetadataResource)

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

type EmbeddedObjectMetadata added in v0.0.2

type EmbeddedObjectMetadata struct {
	// Name must be unique within a namespace. Is required when creating resources, although
	// some resources may allow a client to request the generation of an appropriate name
	// automatically. Name is primarily intended for creation idempotence and configuration
	// definition.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names
	// +optional
	Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`

	// Labels Map of string keys and values that can be used to organize and categorize
	// (scope and select) objects. May match selectors of replication controllers
	// and services.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
	// +optional
	Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"`

	// Annotations is an unstructured key value map stored with a resource that may be
	// set by external tools to store and retrieve arbitrary metadata. They are not
	// queryable and should be preserved when modifying objects.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations
	// +optional
	Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"`
}

EmbeddedObjectMetadata contains a subset of the fields included in k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta Only fields which are relevant to embedded resources are included.

func (*EmbeddedObjectMetadata) DeepCopy added in v0.0.2

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

func (*EmbeddedObjectMetadata) DeepCopyInto added in v0.0.2

func (in *EmbeddedObjectMetadata) DeepCopyInto(out *EmbeddedObjectMetadata)

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

func (*EmbeddedObjectMetadata) ToObjectMeta added in v0.2.0

func (r *EmbeddedObjectMetadata) ToObjectMeta() metav1.ObjectMeta

ToObjectMeta converts EmbeddedObjectMetadata to metav1.ObjectMeta

type EmbeddedPersistentVolumeClaim added in v0.0.2

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

	// EmbeddedMetadata contains metadata relevant to an EmbeddedResource.
	// +optional
	EmbeddedObjectMetadata `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Spec defines the desired characteristics of a volume requested by a pod author.
	// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
	// +optional
	Spec corev1.PersistentVolumeClaimSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`

	// Status represents the current information/status of a persistent volume claim.
	// Read-only.
	// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
	// +optional
	Status corev1.PersistentVolumeClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

EmbeddedPersistentVolumeClaim is an embedded version of k8s.io/api/core/v1.PersistentVolumeClaim. It contains TypeMeta and a reduced ObjectMeta.

func (*EmbeddedPersistentVolumeClaim) DeepCopy added in v0.0.2

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

func (*EmbeddedPersistentVolumeClaim) DeepCopyInto added in v0.0.2

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

type EmbeddedPodDisruptionBudget added in v0.1.0

type EmbeddedPodDisruptionBudget struct {
	// EmbeddedMetadata contains metadata relevant to an EmbeddedResource.
	// +optional
	EmbeddedObjectMetadata `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	// Spec defines the desired characteristics of a PDB.
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#pod-disruption-budgets
	// +optional
	Spec PodDisruptionBudgetSpec `json:"spec"`
}

EmbeddedPodDisruptionBudget describes PDB resource for etcd cluster members

func (*EmbeddedPodDisruptionBudget) DeepCopy added in v0.1.0

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

func (*EmbeddedPodDisruptionBudget) DeepCopyInto added in v0.1.0

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

type EmbeddedService added in v0.2.0

type EmbeddedService struct {
	// EmbeddedMetadata contains metadata relevant to an EmbeddedResource.
	// +optional
	EmbeddedObjectMetadata `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	// Spec defines the behavior of the service.
	// +optional
	Spec corev1.ServiceSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
}

func (*EmbeddedService) DeepCopy added in v0.2.0

func (in *EmbeddedService) DeepCopy() *EmbeddedService

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

func (*EmbeddedService) DeepCopyInto added in v0.2.0

func (in *EmbeddedService) DeepCopyInto(out *EmbeddedService)

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

type EtcdCluster

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

	Spec   EtcdClusterSpec   `json:"spec,omitempty"`
	Status EtcdClusterStatus `json:"status,omitempty"`
}

EtcdCluster is the Schema for the etcdclusters API

func (*EtcdCluster) CalculateQuorumSize added in v0.1.0

func (r *EtcdCluster) CalculateQuorumSize() int

CalculateQuorumSize returns minimum quorum size for current number of replicas

func (*EtcdCluster) DeepCopy

func (in *EtcdCluster) DeepCopy() *EtcdCluster

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

func (*EtcdCluster) DeepCopyInto

func (in *EtcdCluster) DeepCopyInto(out *EtcdCluster)

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

func (*EtcdCluster) DeepCopyObject

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

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

func (*EtcdCluster) Default

func (r *EtcdCluster) Default()

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

func (*EtcdCluster) SetupWebhookWithManager

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

SetupWebhookWithManager will setup the manager to manage the webhooks

func (*EtcdCluster) ValidateCreate

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

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

func (*EtcdCluster) ValidateDelete

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

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

func (*EtcdCluster) ValidateUpdate

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

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

type EtcdClusterList

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

EtcdClusterList contains a list of EtcdCluster

func (*EtcdClusterList) DeepCopy

func (in *EtcdClusterList) DeepCopy() *EtcdClusterList

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

func (*EtcdClusterList) DeepCopyInto

func (in *EtcdClusterList) DeepCopyInto(out *EtcdClusterList)

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

func (*EtcdClusterList) DeepCopyObject

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

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

type EtcdClusterSpec

type EtcdClusterSpec struct {
	// Replicas is the count of etcd instances in cluster.
	// +optional
	// +kubebuilder:default:=3
	// +kubebuilder:validation:Minimum:=0
	Replicas *int32 `json:"replicas,omitempty"`
	// Options are the extra arguments to pass to the etcd container.
	// +optional
	// +kubebuilder:example:={enable-v2: "false", debug: "true"}
	Options map[string]string `json:"options,omitempty"`
	// PodTemplate defines the desired state of PodSpec for etcd members. If not specified, default values will be used.
	PodTemplate PodTemplate `json:"podTemplate,omitempty"`
	// Service defines the desired state of Service for etcd members. If not specified, default values will be used.
	// +optional
	ServiceTemplate *EmbeddedService `json:"serviceTemplate,omitempty"`
	// HeadlessService defines the desired state of HeadlessService for etcd members. If not specified, default values will be used.
	// +optional
	HeadlessServiceTemplate *EmbeddedMetadataResource `json:"headlessServiceTemplate,omitempty"`
	// PodDisruptionBudgetTemplate describes PDB resource to create for etcd cluster members. Nil to disable.
	// +optional
	PodDisruptionBudgetTemplate *EmbeddedPodDisruptionBudget `json:"podDisruptionBudgetTemplate,omitempty"`
	Storage                     StorageSpec                  `json:"storage"`
	// Security describes security settings of etcd (authentication, certificates, rbac)
	// +optional
	Security *SecuritySpec `json:"security,omitempty"`
}

EtcdClusterSpec defines the desired state of EtcdCluster

func (*EtcdClusterSpec) DeepCopy

func (in *EtcdClusterSpec) DeepCopy() *EtcdClusterSpec

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

func (*EtcdClusterSpec) DeepCopyInto

func (in *EtcdClusterSpec) DeepCopyInto(out *EtcdClusterSpec)

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

type EtcdClusterStatus

type EtcdClusterStatus struct {
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

EtcdClusterStatus defines the observed state of EtcdCluster

func (*EtcdClusterStatus) DeepCopy

func (in *EtcdClusterStatus) DeepCopy() *EtcdClusterStatus

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

func (*EtcdClusterStatus) DeepCopyInto

func (in *EtcdClusterStatus) DeepCopyInto(out *EtcdClusterStatus)

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

type EtcdCondMessage added in v0.0.2

type EtcdCondMessage string
const (
	EtcdInitCondNegMessage           EtcdCondMessage = "Cluster initialization started"
	EtcdInitCondPosMessage           EtcdCondMessage = "Cluster managed resources created"
	EtcdReadyCondNegMessage          EtcdCondMessage = "Cluster StatefulSet is not Ready"
	EtcdReadyCondPosMessage          EtcdCondMessage = "Cluster StatefulSet is Ready"
	EtcdReadyCondNegWaitingForQuorum EtcdCondMessage = "Waiting for first quorum to be established"
)

type EtcdCondType added in v0.0.1

type EtcdCondType string
const (
	EtcdCondTypeInitStarted           EtcdCondType = "InitializationStarted"
	EtcdCondTypeInitComplete          EtcdCondType = "InitializationComplete"
	EtcdCondTypeWaitingForFirstQuorum EtcdCondType = "WaitingForFirstQuorum"
	EtcdCondTypeStatefulSetReady      EtcdCondType = "StatefulSetReady"
	EtcdCondTypeStatefulSetNotReady   EtcdCondType = "StatefulSetNotReady"
)

type PodDisruptionBudgetSpec added in v0.1.0

type PodDisruptionBudgetSpec struct {
	// MinAvailable describes minimum ready replicas. If both are empty, controller will implicitly
	// calculate MaxUnavailable based on number of replicas
	// Mutually exclusive with MaxUnavailable.
	// +optional
	MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"`
	// MinAvailable describes maximum not ready replicas. If both are empty, controller will implicitly
	// calculate MaxUnavailable based on number of replicas
	// Mutually exclusive with MinAvailable
	// +optional
	MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
}

func (*PodDisruptionBudgetSpec) DeepCopy added in v0.1.0

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

func (*PodDisruptionBudgetSpec) DeepCopyInto added in v0.1.0

func (in *PodDisruptionBudgetSpec) DeepCopyInto(out *PodDisruptionBudgetSpec)

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

type PodTemplate added in v0.1.0

type PodTemplate struct {
	// EmbeddedObjectMetadata contains metadata relevant to an EmbeddedResource
	// +optional
	EmbeddedObjectMetadata `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Spec follows the structure of a regular Pod spec. Overrides defined here will be strategically merged with the default pod spec, generated by the operator.
	// +optional
	// +kubebuilder:pruning:PreserveUnknownFields
	Spec corev1.PodSpec `json:"spec,omitempty"`
}

PodTemplate allows overrides, such as sidecars, init containers, changes to the security context, etc to the pod template generated by the operator.

func (*PodTemplate) DeepCopy added in v0.1.0

func (in *PodTemplate) DeepCopy() *PodTemplate

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

func (*PodTemplate) DeepCopyInto added in v0.1.0

func (in *PodTemplate) DeepCopyInto(out *PodTemplate)

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

type SecuritySpec added in v0.1.0

type SecuritySpec struct {
	// Section for user-managed tls certificates
	// +optional
	TLS TLSSpec `json:"tls,omitempty"`
}

SecuritySpec defines security settings for etcd. +k8s:openapi-gen=true

func (*SecuritySpec) DeepCopy added in v0.1.0

func (in *SecuritySpec) DeepCopy() *SecuritySpec

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

func (*SecuritySpec) DeepCopyInto added in v0.1.0

func (in *SecuritySpec) DeepCopyInto(out *SecuritySpec)

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

type StorageSpec added in v0.0.2

type StorageSpec struct {
	// EmptyDirVolumeSource to be used by the StatefulSets. If specified, used in place of any volumeClaimTemplate. More
	// info: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
	// +optional
	EmptyDir *corev1.EmptyDirVolumeSource `json:"emptyDir,omitempty"`
	// A PVC spec to be used by the StatefulSets.
	// +optional
	VolumeClaimTemplate EmbeddedPersistentVolumeClaim `json:"volumeClaimTemplate,omitempty"`
}

StorageSpec defines the configured storage for a etcd members. If neither `emptyDir` nor `volumeClaimTemplate` is specified, then by default an [EmptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) will be used. +k8s:openapi-gen=true

func (*StorageSpec) DeepCopy added in v0.0.2

func (in *StorageSpec) DeepCopy() *StorageSpec

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

func (*StorageSpec) DeepCopyInto added in v0.0.2

func (in *StorageSpec) DeepCopyInto(out *StorageSpec)

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

type TLSSpec added in v0.1.0

type TLSSpec struct {
	// Trusted CA certificate secret to secure peer-to-peer communication between etcd nodes. It is expected to have tls.crt field in the secret.
	// +optional
	PeerTrustedCASecret string `json:"peerTrustedCASecret,omitempty"`
	// Certificate secret to secure peer-to-peer communication between etcd nodes. It is expected to have tls.crt and tls.key fields in the secret.
	// +optional
	PeerSecret string `json:"peerSecret,omitempty"`
	// Server certificate secret to secure client-server communication. Is provided to the client who connects to etcd by client port (2379 by default).
	// It is expected to have tls.crt and tls.key fields in the secret.
	// +optional
	ServerSecret string `json:"serverSecret,omitempty"`
	// Trusted CA for client certificates that are provided by client to etcd. It is expected to have tls.crt field in the secret.
	// +optional
	ClientTrustedCASecret string `json:"clientTrustedCASecret,omitempty"`
	// Client certificate for etcd-operator to do maintenance. It is expected to have tls.crt and tls.key fields in the secret.
	// +optional
	ClientSecret string `json:"clientSecret,omitempty"`
}

TLSSpec defines user-managed certificates names.

func (*TLSSpec) DeepCopy added in v0.1.0

func (in *TLSSpec) DeepCopy() *TLSSpec

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

func (*TLSSpec) DeepCopyInto added in v0.1.0

func (in *TLSSpec) DeepCopyInto(out *TLSSpec)

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