Documentation ¶
Index ¶
- Constants
- func ClientServiceName(lockserverName string) string
- func NewClientService(key client.ObjectKey, labels map[string]string) *corev1.Service
- func NewPDB(key client.ObjectKey, labels map[string]string) *policyv1.PodDisruptionBudget
- func NewPVC(key client.ObjectKey, spec *Spec) *corev1.PersistentVolumeClaim
- func NewPeerService(key client.ObjectKey, labels map[string]string) *corev1.Service
- func NewPod(key client.ObjectKey, spec *Spec) *corev1.Pod
- func PDBName(lockserverName string) string
- func PeerServiceName(lockserverName string) string
- func PodName(lockserverName string, index int) string
- func UpdateClientService(svc *corev1.Service, labels map[string]string)
- func UpdatePDBInPlace(obj *policyv1.PodDisruptionBudget, labels map[string]string)
- func UpdatePVCInPlace(obj *corev1.PersistentVolumeClaim, spec *Spec)
- func UpdatePeerService(svc *corev1.Service, labels map[string]string)
- func UpdatePod(obj *corev1.Pod, spec *Spec)
- func UpdatePodInPlace(obj *corev1.Pod, spec *Spec)
- type Spec
Constants ¶
const ( // LockserverLabel is the label that should be added to Pods to identify // which lockserver cluster they belong to. LockserverLabel = "etcd.planetscale.com/lockserver" // IndexLabel is the label used to identify the index of a member. IndexLabel = "etcd.planetscale.com/index" // NumReplicas is the number of members per etcd cluster. // // This is currently hard-coded because it doesn't really make sense to // allow it to be customized. Anything less than 3 cannot maintain quorum // if a single member becomes unavailable. Anything more than 3 adds latency // without providing significant benefit to Vitess. // // WARNING: DO NOT change this value. That would break all existing EtcdLockservers. // The only way to change this is to implement a new feature to support // having different sizes for different EtcdLockserver objects. NumReplicas = 3 )
const ( ClientPortName = "client" ClientPortNumber = 2379 PeerPortName = "peer" PeerPortNumber = 2380 )
const ( // QuorumSize is the number of replicas that must be available for the etcd // lockserver to respond to queries. QuorumSize = NumReplicas/2 + 1 )
Variables ¶
This section is empty.
Functions ¶
func ClientServiceName ¶
ClientServiceName returns the name of the etcd client Service.
func NewClientService ¶
NewClientService creates a new client Service.
func NewPVC ¶
func NewPVC(key client.ObjectKey, spec *Spec) *corev1.PersistentVolumeClaim
NewPVC creates a new PVC.
func NewPeerService ¶
NewPeerService creates a new client Service.
func PeerServiceName ¶
PeerServiceName returns the name of the etcd peer headless Service.
func UpdateClientService ¶
UpdateClientService updates the mutable parts of the client Service.
func UpdatePDBInPlace ¶
func UpdatePDBInPlace(obj *policyv1.PodDisruptionBudget, labels map[string]string)
UpdatePDBInPlace updates an existing PDB in-place.
func UpdatePVCInPlace ¶
func UpdatePVCInPlace(obj *corev1.PersistentVolumeClaim, spec *Spec)
UpdatePVCInPlace updates an existing PVC in-place.
func UpdatePeerService ¶
UpdatePeerService updates the mutable parts of the client Service.
func UpdatePod ¶
UpdatePod updates all parts of an etcd Pod to match the desired state, including parts that are immutable. If anything actually changes, the Pod must be deleted and recreated as part of a rolling update in order to converge to the desired state.
func UpdatePodInPlace ¶
UpdatePodInPlace updates only the parts of an etcd Pod that can be changed immediately by an in-place update.
Types ¶
type Spec ¶
type Spec struct { LockserverName string Image string ImagePullPolicy corev1.PullPolicy ImagePullSecrets []corev1.LocalObjectReference Resources corev1.ResourceRequirements Labels map[string]string Zone string Index int DataVolumePVCName string DataVolumePVCSpec *corev1.PersistentVolumeClaimSpec ExtraFlags map[string]string ExtraEnv []corev1.EnvVar ExtraVolumes []corev1.Volume ExtraVolumeMounts []corev1.VolumeMount InitContainers []corev1.Container SidecarContainers []corev1.Container Affinity *corev1.Affinity Annotations map[string]string ExtraLabels map[string]string AdvertisePeerURLs []string Tolerations []corev1.Toleration }
Spec specifies all the internal parameters needed to deploy an etcd instance.