naming

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// DecommissionedLabel expresses the intent to decommission
	// the specific member. The presence of the label expresses
	// the intent to decommission. If the value is true, it means
	// the member has finished decommissioning.
	// Values: {true, false}
	DecommissionedLabel = "scylla/decommissioned"

	// ReplaceLabel express the intent to replace pod under the specific member.
	ReplaceLabel = "scylla/replace"

	// ReplacingNodeHostIDLabel contains the Host ID of node labelled node is replacing.
	ReplacingNodeHostIDLabel = "internal.scylla-operator.scylladb.com/replacing-node-hostid"

	// NodeMaintenanceLabel means that node is under maintenance.
	// Readiness check will always fail when this label is added to member service.
	NodeMaintenanceLabel = "scylla/node-maintenance"

	LabelValueTrue  = "true"
	LabelValueFalse = "false"
)

These labels are only used on the ClusterIP services acting as each member's identity (static ip). Each of these labels is a record of intent to do something. The controller sets these labels and each member watches for them and takes the appropriate actions.

See the sidecar design doc for more details.

View Source
const (
	// HostIDAnnotation reflects the host_id of the scylla node.
	HostIDAnnotation = "internal.scylla-operator.scylladb.com/host-id"

	// CurrentTokenRingHashAnnotation reflects the current hash of token ring of the scylla node.
	CurrentTokenRingHashAnnotation = "internal.scylla-operator.scylladb.com/current-token-ring-hash"

	// LastCleanedUpTokenRingHashAnnotation reflects the last cleaned up hash of token ring of the scylla node.
	LastCleanedUpTokenRingHashAnnotation = "internal.scylla-operator.scylladb.com/last-cleaned-up-token-ring-hash"

	// CleanupJobTokenRingHashAnnotation reflects which version of token ring cleanup Job is cleaning.
	CleanupJobTokenRingHashAnnotation = "internal.scylla-operator.scylladb.com/cleanup-token-ring-hash"
)

Annotations used internally.

View Source
const (
	ClusterNameLabel             = "scylla/cluster"
	DatacenterNameLabel          = "scylla/datacenter"
	RackNameLabel                = "scylla/rack"
	RackOrdinalLabel             = "scylla/rack-ordinal"
	ScyllaVersionLabel           = "scylla/scylla-version"
	ScyllaServiceTypeLabel       = "scylla-operator.scylladb.com/scylla-service-type"
	ScyllaIngressTypeLabel       = "scylla-operator.scylladb.com/scylla-ingress-type"
	ManagedHash                  = "scylla-operator.scylladb.com/managed-hash"
	NodeConfigJobForNodeUIDLabel = "scylla-operator.scylladb.com/node-config-job-for-node-uid"
	NodeConfigJobTypeLabel       = "scylla-operator.scylladb.com/node-config-job-type"
	NodeConfigJobData            = "scylla-operator.scylladb.com/node-config-job-data"
	NodeConfigNameLabel          = "scylla-operator.scylladb.com/node-config-name"
	ConfigMapTypeLabel           = "scylla-operator.scylladb.com/config-map-type"
	OwnerUIDLabel                = "scylla-operator.scylladb.com/owner-uid"
	ScyllaDBMonitoringNameLabel  = "scylla-operator.scylladb.com/scylladbmonitoring-name"
	ControllerNameLabel          = "scylla-operator.scylladb.com/controller-name"
	NodeJobLabel                 = "scylla-operator.scylladb.com/node-job"
	NodeJobTypeLabel             = "scylla-operator.scylladb.com/node-job-type"

	AppName           = "scylla"
	OperatorAppName   = "scylla-operator"
	ManagerAppName    = "scylla-manager"
	NodeConfigAppName = "scylla-node-config"

	PrometheusScrapeAnnotation = "prometheus.io/scrape"
	PrometheusPortAnnotation   = "prometheus.io/port"

	ForceRedeploymentReasonAnnotation = "scylla-operator.scylladb.com/force-redeployment-reason"
)

Generic Labels used on objects created by the operator.

View Source
const (
	ScyllaContainerName          = "scylla"
	SidecarInjectorContainerName = "sidecar-injection"
	PerftuneContainerName        = "perftune"
	CleanupContainerName         = "cleanup"

	PVCTemplateName = "data"

	SharedDirName = "/mnt/shared"

	ScyllaConfigDirName          = "/mnt/scylla-config"
	ScyllaAgentConfigDirName     = "/mnt/scylla-agent-config"
	ScyllaAgentConfigFileName    = "scylla-manager-agent.yaml"
	ScyllaAgentAuthTokenFileName = "auth-token.yaml"
	ScyllaAgentConfigDefaultFile = "/etc/scylla-manager-agent/scylla-manager-agent.yaml"
	ScyllaClientConfigDirName    = "/mnt/scylla-client-config"
	ScyllaConfigName             = "scylla.yaml"
	ScyllaRackDCPropertiesName   = "cassandra-rackdc.properties"
	ScyllaIOPropertiesName       = "io_properties.yaml"

	DataDir = "/var/lib/scylla"

	ReadinessProbePath = "/readyz"
	LivenessProbePath  = "/healthz"
	ProbePort          = 8080
	ScyllaAPIPort      = 10000

	OperatorEnvVarPrefix = "SCYLLA_OPERATOR_"
)

Configuration Values

View Source
const (
	ScyllaManagerNamespace   = "scylla-manager"
	ScyllaManagerServiceName = "scylla-manager"

	ScyllaOperatorNodeTuningNamespace = "scylla-operator-node-tuning"

	ScyllaClusterMemberClusterRoleName = "scyllacluster-member"

	SingletonName = "cluster"

	PerftuneJobPrefixName = "perftune"

	// TODO: Make sure this doesn't get out of date.
	DefaultScyllaUtilsImage = "docker.io/scylladb/scylla:5.0.5"
)
View Source
const (
	CQLProtocolDNSLabel = "cql"
)
View Source
const (
	NodeConfigJobForNodeKey = "scylla-operator.scylladb.com/node-config-job-for-node"
)
View Source
const (
	ScyllaRuntimeConfigKey string = "ScyllaRuntimeConfig"
)

Variables

This section is empty.

Functions

func AgentAuthTokenSecretName added in v1.3.0

func AgentAuthTokenSecretName(clusterName string) string

func CleanupJobForService added in v1.10.0

func CleanupJobForService(svcName string) string

func ClusterLabels

func ClusterLabels(c *scyllav1.ScyllaCluster) map[string]string

ClusterLabels returns a map of label keys and values for the given Cluster.

func ClusterSelector added in v1.11.0

func ClusterSelector(c *scyllav1.ScyllaCluster) labels.Selector

ClusterSelector returns a labels selector for the given ScyllaCluster.

func CrossNamespaceServiceNameForCluster added in v0.3.0

func CrossNamespaceServiceNameForCluster(c *scyllav1.ScyllaCluster) string

func DatacenterLabels

func DatacenterLabels(c *scyllav1.ScyllaCluster) map[string]string

DatacenterLabels returns a map of label keys and values for the given Datacenter.

func FindContainerWithName added in v1.1.0

func FindContainerWithName(containers []corev1.Container, name string) (int, error)

FindContainerWithName returns container having

func FindScyllaContainer

func FindScyllaContainer(containers []corev1.Container) (int, error)

FindScyllaContainer returns Scylla container from given list.

func FindSidecarInjectorContainer added in v1.1.0

func FindSidecarInjectorContainer(containers []corev1.Container) (int, error)

FindSidecarInjectorContainer returns sidecar injector container from given list.

func GetCQLHostIDSubDomain added in v1.8.0

func GetCQLHostIDSubDomain(hostID, domain string) string

func GetCQLProtocolSubDomain added in v1.8.0

func GetCQLProtocolSubDomain(domain string) string

func GetProtocolSubDomain added in v1.8.0

func GetProtocolSubDomain(protocol, domain string) string

func GetScyllaClusterLocalAdminCQLConnectionConfigsName added in v1.8.0

func GetScyllaClusterLocalAdminCQLConnectionConfigsName(scName string) string

func GetScyllaClusterLocalClientCAName added in v1.8.0

func GetScyllaClusterLocalClientCAName(scName string) string

func GetScyllaClusterLocalServingCAName added in v1.8.0

func GetScyllaClusterLocalServingCAName(scName string) string

func GetScyllaClusterLocalServingCertName added in v1.8.0

func GetScyllaClusterLocalServingCertName(scName string) string

func GetScyllaClusterLocalUserAdminCertName added in v1.8.0

func GetScyllaClusterLocalUserAdminCertName(scName string) string

func GetScyllaClusterRootCASecretName added in v1.8.0

func GetScyllaClusterRootCASecretName(scName string) string

func GetTuningConfigMapNameForPod added in v1.6.0

func GetTuningConfigMapNameForPod(pod *corev1.Pod) string

func HeadlessServiceNameForCluster

func HeadlessServiceNameForCluster(c *scyllav1.ScyllaCluster) string

func ImageToVersion

func ImageToVersion(image string) (string, error)

ImageToVersion strips version part from container image.

func IndexFromName

func IndexFromName(n string) (int32, error)

IndexFromName attempts to get the index from a name using the naming convention <name>-<index>.

func ManagerClusterName added in v0.3.0

func ManagerClusterName(c *scyllav1.ScyllaCluster) string

func ManagerSelector added in v0.3.0

func ManagerSelector() labels.Selector

func ManualRef added in v1.6.0

func ManualRef(namespace, name string) string

func MemberServiceAccountNameForScyllaCluster added in v1.8.0

func MemberServiceAccountNameForScyllaCluster(scName string) string

func MemberServiceName added in v1.0.0

func MemberServiceName(r scyllav1.RackSpec, c *scyllav1.ScyllaCluster, idx int) string

func ObjRef added in v1.4.0

func ObjRef(obj metav1.Object) string

func ObjRefWithUID added in v1.6.0

func ObjRefWithUID(obj metav1.Object) string

func PVCNameForPod

func PVCNameForPod(podName string) string

func PVCNameForService added in v1.4.0

func PVCNameForService(svcName string) string

func PVCNameForStatefulSet added in v1.4.0

func PVCNameForStatefulSet(stsName string, ordinal int32) string

func PVCNamePrefixForScyllaCluster added in v1.4.0

func PVCNamePrefixForScyllaCluster(scName string) string

func PerftuneResultName added in v1.6.0

func PerftuneResultName(uid string) string

func PodDisruptionBudgetName added in v1.2.0

func PodDisruptionBudgetName(c *scyllav1.ScyllaCluster) string

func RackLabels

func RackLabels(r scyllav1.RackSpec, c *scyllav1.ScyllaCluster) (map[string]string, error)

RackLabels returns a map of label keys and values for the given Rack.

func RackSelector

RackSelector returns a LabelSelector for the given rack.

func ScyllaLabels added in v1.6.0

func ScyllaLabels() map[string]string

func ScyllaSelector added in v1.6.0

func ScyllaSelector() labels.Selector

func ScyllaVersion added in v1.1.0

func ScyllaVersion(containers []corev1.Container) (string, error)

ScyllaVersion returns version of Scylla container.

func ServiceDNSName added in v1.0.0

func ServiceDNSName(service string, c *scyllav1.ScyllaCluster) string

func ServiceNameFromPod added in v1.0.0

func ServiceNameFromPod(pod *corev1.Pod) string

func SidecarVersion added in v1.1.0

func SidecarVersion(containers []corev1.Container) (string, error)

SidecarVersion returns version of sidecar container.

func StatefulSetNameForRack

func StatefulSetNameForRack(r scyllav1.RackSpec, c *scyllav1.ScyllaCluster) string

func StatefulSetPodLabel

func StatefulSetPodLabel(name string) map[string]string

StatefulSetPodLabel returns a map of labels to uniquely identify a StatefulSet Pod with the given name

Types

type ConfigMapType added in v1.6.0

type ConfigMapType string
const (
	NodeConfigDataConfigMapType ConfigMapType = "NodeConfigData"
)

type NodeConfigJobType added in v1.6.0

type NodeConfigJobType string
const (
	NodeConfigJobTypeNode       NodeConfigJobType = "Node"
	NodeConfigJobTypeContainers NodeConfigJobType = "Containers"
)

type NodeJobType added in v1.10.0

type NodeJobType string
const (
	JobTypeCleanup NodeJobType = "Cleanup"
)

type ProtocolDNSLabel added in v1.8.0

type ProtocolDNSLabel string

type ScyllaIngressType added in v1.8.0

type ScyllaIngressType string
const (
	ScyllaIngressTypeNode    ScyllaIngressType = "Node"
	ScyllaIngressTypeAnyNode ScyllaIngressType = "AnyNode"
)

type ScyllaServiceType added in v1.8.0

type ScyllaServiceType string
const (
	ScyllaServiceTypeIdentity ScyllaServiceType = "identity"
	ScyllaServiceTypeMember   ScyllaServiceType = "member"
)

Jump to

Keyboard shortcuts

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