API

This document enumerates the Custom Resource Definitions used by the M3DB Operator. It is auto-generated from code comments.

Table of Contents

ClusterCondition

ClusterCondition represents various conditions the cluster can be in.

FieldDescriptionSchemeRequired
typeType of cluster condition.ClusterConditionTypefalse
statusStatus of the condition (True, False, Unknown).corev1.ConditionStatusfalse
lastUpdateTimeLast time this condition was updated.stringfalse
lastTransitionTimeLast time this condition transitioned from one status to another.stringfalse
reasonReason this condition last changed.stringfalse
messageHuman-friendly message about this condition.stringfalse

Back to TOC

ClusterSpec

ClusterSpec defines the desired state for a M3 cluster to be converge to.

FieldDescriptionSchemeRequired
imageImage specifies which docker image to use with the clusterstringfalse
replicationFactorReplicationFactor defines how many replicasint32false
numberOfShardsNumberOfShards defines how many shards in totalint32false
isolationGroupsIsolationGroups specifies a map of key-value pairs. Defines which isolation groups to deploy persistent volumes for data nodes[]IsolationGroupfalse
namespacesNamespaces specifies the namespaces this cluster will hold.[]Namespacefalse
etcdEndpointsEtcdEndpoints defines the etcd endpoints to use for service discovery. Must be set if no custom configmap is defined. If set, etcd endpoints will be templated in to the default configmap template.[]stringfalse
keepEtcdDataOnDeleteKeepEtcdDataOnDelete determines whether the operator will remove cluster metadata (placement + namespaces) in etcd when the cluster is deleted. Unless true, etcd data will be cleared when the cluster is deleted.boolfalse
enableCarbonIngesterEnableCarbonIngester enables the listener port for the carbon ingesterboolfalse
configMapNameConfigMapName specifies the ConfigMap to use for this cluster. If unset a default configmap with template variables for etcd endpoints will be used. See “Configuring M3DB” in the docs for more.stringfalse
podIdentityConfigPodIdentityConfig sets the configuration for pod identity. If unset only pod name and UID will be used.PodIdentityConfigfalse
containerResourcesResources defines memory / cpu constraints for each container in the cluster.corev1.ResourceRequirementsfalse
dataDirVolumeClaimTemplateDataDirVolumeClaimTemplate is the volume claim template for an M3DB instance’s data. It claims PersistentVolumes for cluster storage, volumes are dynamically provisioned by when the StorageClass is defined.corev1.PersistentVolumeClaimfalse
podSecurityContextPodSecurityContext allows the user to specify an optional security context for pods.corev1.PodSecurityContextfalse
securityContextSecurityContext allows the user to specify a container-level security context.corev1.SecurityContextfalse
imagePullSecretsImagePullSecrets will be added to every pod.[]corev1.LocalObjectReferencefalse
envVarsEnvVars defines custom environment variables to be passed to M3DB containers.[]corev1.EnvVarfalse
labelsLabels sets the base labels that will be applied to resources created by the cluster. // TODO(schallert): design doc on labeling scheme.map[string]stringfalse
annotationsAnnotations sets the base annotations that will be applied to resources created by the cluster.map[string]stringfalse
tolerationsTolerations sets the tolerations that will be applied to all M3DB pods.[]corev1.Tolerationfalse
priorityClassNamePriorityClassName sets the priority class for all M3DB pods.stringfalse
nodeEndpointFormatNodeEndpointFormat allows overriding of the endpoint used for a node in the M3DB placement. Defaults to “{{ .PodName }}.{{ .M3DBService }}:{{ .Port }}”. Useful if access to the cluster from other namespaces is desired. See “Node Endpoint” docs for full variables available.stringfalse
hostNetworkHostNetwork indicates whether M3DB pods should run in the same network namespace as the node its on. This option should be used sparingly due to security concerns outlined in the linked documentation. https://kubernetes.io/docs/concepts/policy/pod-security-policy/#host-namespacesboolfalse
dnsPolicyDNSPolicy allows the user to set the pod’s DNSPolicy. This is often used in conjunction with HostNetwork.+optionalcorev1.DNSPolicyfalse
externalCoordinatorSpecify a “controlling” coordinator for the cluster.ExternalCoordinatorConfigfalse
initContainersCustom setup for db nodes can be done via initContainers Provide the complete spec for the initContainer here If any storage volumes are needed in the initContainer see InitVolumes below[]corev1.Containerfalse
initVolumesIf the InitContainers require any storage volumes Provide the complete specification for the required Volumes here[]corev1.Volumefalse
podMetadataPodMetadata is for any Metadata that is unique to the pods, and does not belong on any other objects, such as Prometheus scrape tagsmetav1.ObjectMetafalse
parallelPodManagementParallelPodManagement sets StatefulSets created by the operator to have Parallel pod management instead of OrderedReady. If nil, this will default to true.booltrue
serviceAccountNameTo use a non-default service account, specify the name here otherwise the service account “default” will be used. This is useful for advanced use-cases such as pod security policies. The service account must exist. This operator will not create it.stringfalse
frozenFrozen is used to stop the operator from taking any further actions on a cluster. This is useful when troubleshooting as it guarantees the operator won’t make any changes to the cluster.boolfalse

Back to TOC

ExternalCoordinatorConfig

ExternalCoordinatorConfig defines parameters for using an external coordinator to control the cluster.\n\n- It is expected that there is a separate standalone coordinator cluster. - It is externally managed - not managed by this operator. - It is expected to have a service endpoint.\n\nSetup this db cluster, but do not assume a co-located coordinator. Instead provide a selector here so we can point to a separate coordinator service.

FieldDescriptionSchemeRequired
selectormap[string]stringtrue
serviceEndpointstringfalse

Back to TOC

IsolationGroup

IsolationGroup defines the name of zone as well attributes for the zone configuration

FieldDescriptionSchemeRequired
nameName is the value that will be used in StatefulSet labels, pod labels, and M3DB placement “isolationGroup” fields.stringtrue
nodeAffinityTermsNodeAffinityTerms is an array of NodeAffinityTerm requirements, which are ANDed together to indicate what nodes an isolation group can be assigned to.[]NodeAffinityTermfalse
numInstancesNumInstances defines the number of instances.int32true
storageClassNameStorageClassName is the name of the StorageClass to use for this isolation group. This allows ensuring that PVs will be created in the same zone as the pinned statefulset on Kubernetes < 1.12 (when topology aware volume scheduling was introduced). Only has effect if the clusters dataDirVolumeClaimTemplate is non-nil. If set, the volume claim template will have its storageClassName field overridden per-isolationgroup. If unset the storageClassName of the volumeClaimTemplate will be used.stringfalse

Back to TOC

M3DBCluster

M3DBCluster defines the cluster

FieldDescriptionSchemeRequired
metadatametav1.ObjectMetafalse
typestringtrue
specClusterSpectrue
statusM3DBStatusfalse

Back to TOC

M3DBClusterList

M3DBClusterList represents a list of M3DB Clusters

FieldDescriptionSchemeRequired
metadatametav1.ListMetafalse
items[]M3DBClustertrue

Back to TOC

M3DBStatus

M3DBStatus contains the current state the M3DB cluster along with a human readable message

FieldDescriptionSchemeRequired
stateState is a enum of green, yellow, and red denoting the health of the clusterM3DBStatefalse
conditionsVarious conditions about the cluster.[]ClusterConditionfalse
messageMessage is a human readable message indicating why the cluster is in it’s current statestringfalse
observedGenerationObservedGeneration is the last generation of the cluster the controller observed. Kubernetes will automatically increment metadata.Generation every time the cluster spec is changed.int64false

Back to TOC

NodeAffinityTerm

NodeAffinityTerm represents a node label and a set of label values, any of which can be matched to assign a pod to a node.

FieldDescriptionSchemeRequired
keyKey is the label of the node.stringtrue
valuesValues is an array of values, any of which a node can have for a pod to be assigned to it.[]stringtrue

Back to TOC

AggregatedAttributes

AggregatedAttributes are attributes specifying how data points are aggregated.

FieldDescriptionSchemeRequired
resolutionResolution is the time range to aggregate data across.stringfalse
downsampleOptionsDownsampleOptions stores options for downsampling data points.*DownsampleOptionsfalse

Back to TOC

Aggregation

Aggregation describes data points within a namespace.

FieldDescriptionSchemeRequired
aggregatedAggregated indicates whether data points are aggregated or not.boolfalse
attributesAttributes defines how data is aggregated when Aggregated is set to true. This field is ignored when aggregated is false.AggregatedAttributesfalse

Back to TOC

AggregationOptions

AggregationOptions is a set of options for aggregating data within the namespace.

FieldDescriptionSchemeRequired
aggregationsAggregations are the aggregations for a namespace.[]Aggregationfalse

Back to TOC

DownsampleOptions

DownsampleOptions is a set of options related to downsampling data.

FieldDescriptionSchemeRequired
allAll indicates whether to send data points to this namespace. If set to false, this namespace will not receive data points. In this case, data will need to be sent to the namespace via another mechanism (e.g. rollup/recording rules).boolfalse

Back to TOC

IndexOptions

IndexOptions defines parameters for indexing.

FieldDescriptionSchemeRequired
enabledEnabled controls whether metric indexing is enabled.boolfalse
blockSizeBlockSize controls the index block size.stringfalse

Back to TOC

Namespace

Namespace defines an M3DB namespace or points to a preset M3DB namespace.

FieldDescriptionSchemeRequired
nameName is the namespace name.stringfalse
presetPreset indicates preset namespace options.stringfalse
optionsOptions points to optional custom namespace configuration.*NamespaceOptionsfalse

Back to TOC

NamespaceOptions

NamespaceOptions defines parameters for an M3DB namespace. See https://m3db.io/docs/operational_guide/namespace_configuration/ for more details.

FieldDescriptionSchemeRequired
bootstrapEnabledBootstrapEnabled control if bootstrapping is enabled.boolfalse
flushEnabledFlushEnabled controls whether flushing is enabled.boolfalse
writesToCommitLogWritesToCommitLog controls whether commit log writes are enabled.boolfalse
cleanupEnabledCleanupEnabled controls whether cleanups are enabled.boolfalse
repairEnabledRepairEnabled controls whether repairs are enabled.boolfalse
snapshotEnabledSnapshotEnabled controls whether snapshotting is enabled.boolfalse
retentionOptionsRetentionOptions sets the retention parameters.RetentionOptionsfalse
indexOptionsIndexOptions sets the indexing parameters.IndexOptionsfalse
coldWritesEnabledColdWritesEnabled controls whether cold writes are enabled.boolfalse
aggregationOptionsAggregationOptions sets the aggregation parameters.AggregationOptionsfalse

Back to TOC

RetentionOptions

RetentionOptions defines parameters for data retention.

FieldDescriptionSchemeRequired
retentionPeriodRetentionPeriod controls how long data for the namespace is retained.stringfalse
blockSizeBlockSize controls the block size for the namespace.stringfalse
bufferFutureBufferFuture controls how far in the future metrics can be written.stringfalse
bufferPastBufferPast controls how far in the past metrics can be written.stringfalse
blockDataExpiryBlockDataExpiry controls the block expiry.boolfalse
blockDataExpiryAfterNotAccessPeriodBlockDataExpiry controls the not after access period for expiration.stringfalse

Back to TOC

PodIdentity

PodIdentity contains all the fields that may be used to identify a pod’s identity in the M3DB placement. Any non-empty fields will be used to identity uniqueness of a pod for the purpose of M3DB replace operations.

FieldDescriptionSchemeRequired
namestringfalse
uidstringfalse
nodeNamestringfalse
nodeExternalIDstringfalse
nodeProviderIDstringfalse

Back to TOC

PodIdentityConfig

PodIdentityConfig contains cluster-level configuration for deriving pod identity.

FieldDescriptionSchemeRequired
sourcesSources enumerates the sources from which to derive pod identity. Note that a pod’s name will always be used. If empty, defaults to pod name and UID.[]PodIdentitySourcetrue

Back to TOC