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
- Variables
- type EmbeddedObjectMetadata
- type EmbeddedPersistentVolumeClaim
- type EmbeddedPodDisruptionBudget
- type EtcdCluster
- func (r *EtcdCluster) CalculateQuorumSize() int
- func (in *EtcdCluster) DeepCopy() *EtcdCluster
- func (in *EtcdCluster) DeepCopyInto(out *EtcdCluster)
- func (in *EtcdCluster) DeepCopyObject() runtime.Object
- func (r *EtcdCluster) Default()
- func (r *EtcdCluster) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (r *EtcdCluster) ValidateCreate() (admission.Warnings, error)
- func (r *EtcdCluster) ValidateDelete() (admission.Warnings, error)
- func (r *EtcdCluster) ValidateUpdate(old runtime.Object) (admission.Warnings, error)
- type EtcdClusterList
- type EtcdClusterSpec
- type EtcdClusterStatus
- type EtcdCondMessage
- type EtcdCondType
- type PodDisruptionBudgetSpec
- type PodSpec
- type PodTemplate
- type SecuritySpec
- type StorageSpec
- type TLSSpec
Constants ¶
const ( EtcdConditionInitialized = "Initialized" EtcdConditionReady = "Ready" )
Variables ¶
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 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
func (in *EmbeddedObjectMetadata) DeepCopy() *EmbeddedObjectMetadata
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.
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
func (in *EmbeddedPersistentVolumeClaim) DeepCopy() *EmbeddedPersistentVolumeClaim
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmbeddedPersistentVolumeClaim.
func (*EmbeddedPersistentVolumeClaim) DeepCopyInto ¶ added in v0.0.2
func (in *EmbeddedPersistentVolumeClaim) DeepCopyInto(out *EmbeddedPersistentVolumeClaim)
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
func (in *EmbeddedPodDisruptionBudget) DeepCopy() *EmbeddedPodDisruptionBudget
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmbeddedPodDisruptionBudget.
func (*EmbeddedPodDisruptionBudget) DeepCopyInto ¶ added in v0.1.0
func (in *EmbeddedPodDisruptionBudget) DeepCopyInto(out *EmbeddedPodDisruptionBudget)
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 ¶
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"`
// 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 ¶
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"`
// 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
func (in *PodDisruptionBudgetSpec) DeepCopy() *PodDisruptionBudgetSpec
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 PodSpec ¶ added in v0.0.2
type PodSpec struct {
// Containers allows the user to add containers to the pod and change "etcd" container if such options are not
// available in the EtcdCluster custom resource.
// +optional
Containers []corev1.Container `json:"containers" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=containers"`
// ImagePullSecrets An optional list of references to secrets in the same namespace
// to use for pulling images from registries
// see https://kubernetes.io/docs/concepts/containers/images/#referring-to-an-imagepullsecrets-on-a-pod
// +optional
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
// ServiceAccountName is the name of the ServiceAccount to use to run the etcd pods.
// +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// ReadinessGates is an optional list of conditions that must be true for the pod to be considered ready for
// traffic. A pod is considered ready when all of its containers are ready.
// +optional
ReadinessGates []corev1.PodReadinessGate `json:"readinessGates,omitempty"`
// Affinity sets the scheduling constraints for the pod.
// +optional
Affinity *corev1.Affinity `json:"affinity,omitempty"`
// NodeSelector is a selector which must be true for the pod to fit on a node.
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// TopologySpreadConstraints describes how a group of pods ought to spread across topology domains.
// +optional
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// Tolerations is a list of tolerations.
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// SecurityContext holds pod-level security attributes and common container settings.
// +optional
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
// PriorityClassName is the name of the PriorityClass for this pod.
// +optional
PriorityClassName string `json:"priorityClassName,omitempty"`
// TerminationGracePeriodSeconds is the time to wait before forceful pod shutdown.
// +optional
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
// SchedulerName is the name of the scheduler to be used for scheduling the pod.
// +optional
SchedulerName string `json:"schedulerName,omitempty"`
// RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod.
// +optional
RuntimeClassName *string `json:"runtimeClassName,omitempty"`
// Volumes are volumes for being used by the pods. Cannot collide with "data" volume used by etcd.
// +optional
Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,1,rep,name=volumes"`
}
PodSpec defines the desired state of PodSpec for etcd members. +k8s:openapi-gen=true
func (*PodSpec) DeepCopy ¶ added in v0.0.2
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSpec.
func (*PodSpec) DeepCopyInto ¶ added in v0.0.2
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 defines the desired state of spec for etcd members. If not specified, default values will be used.
// +optional
Spec PodSpec `json:"spec,omitempty"`
}
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
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSSpec.
func (*TLSSpec) DeepCopyInto ¶ added in v0.1.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.