Skip to content

API Reference (v3beta1) ​

Packages ​

apps.emqx.io/v3beta1 ​

Package v3beta1 contains API Schema definitions for the apps.emqx.io v3beta1 API group.

Resource Types ​

Config ​

Appears in:

FieldDescriptionDefaultValidation
roots ConfigRootsTop-level EMQX configuration roots. Values must be JSON-compatible. The Operator
serializes runtime-applicable roots into base.hocon and settings that take effect
when EMQX starts into emqx.conf.
HOCON-only syntax such as includes, substitutions, and duplicate declarations is not supported.
Removing a root relinquishes Operator ownership; it does not delete values persisted by EMQX.
The node.cookie path is reserved for the Operator and must not be specified here.

ConfigRoots ​

Underlying type: JSON

Appears in:

ConfigStatus ​

ConfigStatus contains controller-owned reconciliation checkpoints. These fields are informational implementation details and may change.

Appears in:

FieldDescriptionDefaultValidation
desiredRevision stringRevision of the complete desired configuration in spec.config.roots.
runtimeRevision stringRevision of runtime configuration most recently accepted by the EMQX API.
Before initial startup, it is the revision staged for cluster bootstrap.
desiredStartupRevision stringRevision of the desired settings that take effect when EMQX starts.
activeStartupRevisions string arrayRevisions of startup configuration used by ready Pods.
Multiple revisions indicate that ready Pods started with different versions of those settings.

CoreNodesStatus ​

CoreNodesStatus is the summary status of core nodes managed by a single StatefulSet.

Appears in:

FieldDescriptionDefaultValidation
readyReplicas integerNumber of ready replicas.
updatedReplicas integerNumber of replicas already updated to the desired pod template.
currentReplicas integerNumber of replicas still running the previous pod template.

DSDBReplicationStatus ​

Appears in:

FieldDescriptionDefaultValidation
name stringName of the database
numShards integerNumber of shards of the database
numShardReplicas integerTotal number of shard replicas
lostShardReplicas integerTotal number of shard replicas belonging to lost sites
numTransitions integerCurrent number of shard ownership transitions
minReplicas integerMinimum replication factor among database shards
maxReplicas integerMaximum replication factor among database shards

DSReplicationStatus ​

Summary of DS replication status per database.

Appears in:

FieldDescriptionDefaultValidation
dbs DSDBReplicationStatus array

EMQX ​

Custom Resource representing an EMQX cluster.

FieldDescriptionDefaultValidation
apiVersion stringapps.emqx.io/v3beta1
kind stringEMQX
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec EMQXSpecSpecification of the desired state of the EMQX cluster.
status EMQXStatusCurrent status of the EMQX cluster.

EMQXCoreTemplate ​

Appears in:

FieldDescriptionDefaultValidation
metadata TemplateObjectMetaMetadata applied to objects generated from this template.
spec EMQXCoreTemplateSpecSpecification of the desired state of a core node.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
{ }

EMQXCoreTemplateSpec ​

Appears in:

FieldDescriptionDefaultValidation
nodeSelector object (keys:string, values:string)Selector which must be true for the pod to fit on a node.
Must match a node's labels for the pod to be scheduled on that node.
More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
nodeName stringRequest to schedule this pod onto a specific node.
If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.
affinity AffinityAffinity for pod assignment
ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
tolerations Toleration arrayPod tolerations.
If specified, Pod tolerates any taint that matches the triple <key,value,effect> using the matching operator.
topologySpreadConstraints TopologySpreadConstraint arraySpecifies how to spread matching pods among the given topology.
dnsConfig PodDNSConfigSpecifies the DNS parameters of a pod.
Parameters specified here will be merged to the generated DNS
configuration based on DNSPolicy (always ClusterFirst).
More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config
minReadySeconds integerMinReadySeconds is the minimum time (seconds) a pod must be Ready before it counts as available.
For core nodes this is applied to the StatefulSet (mirrors apps/v1 StatefulSetSpec.minReadySeconds);
for replicants, to the ReplicaSet (mirrors apps/v1 ReplicaSetSpec.minReadySeconds).
Omitted or zero matches the apps/v1 default (0).
Minimum: 0
command string arrayEntrypoint array. Not executed within a shell.
The container image's ENTRYPOINT is used if this is not provided.
Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. $$(VAR_NAME) will
produce the string literal $(VAR_NAME). Escaped references will never be expanded, regardless
of whether the variable exists or not. Cannot be updated.
More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
Optional: {}
args string arrayArguments to the entrypoint.
The container image's CMD is used if this is not provided.
Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. $$(VAR_NAME) will
produce the string literal $(VAR_NAME). Escaped references will never be expanded, regardless
of whether the variable exists or not.
More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
ports ContainerPort arrayList of ports to expose from the container.
Exposing a port here gives the system additional information about the network connections a
container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that
port from being exposed. Any port which is listening on the default 0.0.0.0 address inside a
container will be accessible from the network.
Port names dashboard and dashboard-https are reserved by the Operator and cannot be supplied
in the template. The Operator derives these named ports from
spec.config.roots.dashboard.listeners for probes, Services, and per-Pod API requests.
Change their container port by changing the corresponding listener bind instead.
env EnvVar arrayList of environment variables to set in the container.
envFrom EnvFromSource arrayList of sources to populate environment variables from in the container.
The keys defined within a source must be a C_IDENTIFIER. All invalid keys
will be reported as an event when the container is starting. When a key exists in multiple
sources, the value associated with the last source will take precedence.
Values defined by an Env with a duplicate key will take precedence.
resources ResourceRequirementsCompute Resources required by this container.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
podSecurityContext PodSecurityContextPod-level security attributes and common container settings.{ fsGroup:1000 fsGroupChangePolicy:Always runAsGroup:1000 runAsNonRoot:true runAsUser:1000 }
containerSecurityContext SecurityContextSecurity options the container should be run with.
If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
initContainers Container arrayList of initialization containers belonging to the pod.
Init containers are executed in order prior to containers being started. If any
init container fails, the pod is considered to have failed and is handled according
to its restartPolicy. The name for an init container or normal container must be
unique among all containers.
Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
The resourceRequirements of an init container are taken into account during scheduling
by finding the highest request/limit for each resource type, and then using the max of
of that value or the sum of the normal containers. Limits are applied to init containers
in a similar fashion.
More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
extraContainers Container arrayAdditional containers to run alongside the main container.
extraVolumes Volume arrayAdditional volumes to provide to a Pod.
extraVolumeMounts VolumeMount arraySpecifies how additional volumes are mounted into the main container.
livenessProbe ProbePeriodic probe of container liveness.
Container will be restarted if the probe fails.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
{ failureThreshold:3 httpGet:map[path:/status port:dashboard] initialDelaySeconds:60 periodSeconds:30 }
readinessProbe ProbePeriodic probe of container service readiness.
Container will be removed from service endpoints if the probe fails.
Strongly advised to keep the current default: it takes into account ongoing node evacuations managed
by the Operator as part of scaling operations and rolling updates.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
{ failureThreshold:1 httpGet:map[path:/api/v5/load_rebalance/availability_check port:dashboard] initialDelaySeconds:10 periodSeconds:5 timeoutSeconds:3 }
startupProbe ProbeStartupProbe indicates that the Pod has successfully initialized.
If specified, no other probes are executed until this completes successfully.
If this probe fails, the Pod will be restarted, just as if the livenessProbe failed.
This can be used to provide different probe parameters at the beginning of a Pod's lifecycle,
when it might take a long time to load data or warm a cache, than during steady-state operation.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
lifecycle LifecycleActions that the management system should take in response to container lifecycle events.
replicas integerDesired number of Core nodes. Each instance has a consistent identity.1Minimum: 0
persistentVolumeClaimSpec PersistentVolumeClaimSpecPVC specification for a core node data storage.

EMQXNode ​

Appears in:

FieldDescriptionDefaultValidation
name stringNode name
podName stringCorresponding pod name
status stringNode status
otpRelease stringErlang/OTP version node is running on
version stringEMQX version
role stringNode role, either "core" or "replicant", omitted when unknown
sessions integerNumber of MQTT sessions
connections integerNumber of connected MQTT clients

EMQXReplicantTemplate ​

Appears in:

FieldDescriptionDefaultValidation
metadata TemplateObjectMetaMetadata applied to objects generated from this template.
spec EMQXReplicantTemplateSpecSpecification of the desired state of a replicant node.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
{ replicas:0 }

EMQXReplicantTemplateSpec ​

Appears in:

FieldDescriptionDefaultValidation
nodeSelector object (keys:string, values:string)Selector which must be true for the pod to fit on a node.
Must match a node's labels for the pod to be scheduled on that node.
More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
nodeName stringRequest to schedule this pod onto a specific node.
If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.
affinity AffinityAffinity for pod assignment
ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
tolerations Toleration arrayPod tolerations.
If specified, Pod tolerates any taint that matches the triple <key,value,effect> using the matching operator.
topologySpreadConstraints TopologySpreadConstraint arraySpecifies how to spread matching pods among the given topology.
dnsConfig PodDNSConfigSpecifies the DNS parameters of a pod.
Parameters specified here will be merged to the generated DNS
configuration based on DNSPolicy (always ClusterFirst).
More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config
minReadySeconds integerMinReadySeconds is the minimum time (seconds) a pod must be Ready before it counts as available.
For core nodes this is applied to the StatefulSet (mirrors apps/v1 StatefulSetSpec.minReadySeconds);
for replicants, to the ReplicaSet (mirrors apps/v1 ReplicaSetSpec.minReadySeconds).
Omitted or zero matches the apps/v1 default (0).
Minimum: 0
command string arrayEntrypoint array. Not executed within a shell.
The container image's ENTRYPOINT is used if this is not provided.
Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. $$(VAR_NAME) will
produce the string literal $(VAR_NAME). Escaped references will never be expanded, regardless
of whether the variable exists or not. Cannot be updated.
More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
Optional: {}
args string arrayArguments to the entrypoint.
The container image's CMD is used if this is not provided.
Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. $$(VAR_NAME) will
produce the string literal $(VAR_NAME). Escaped references will never be expanded, regardless
of whether the variable exists or not.
More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
ports ContainerPort arrayList of ports to expose from the container.
Exposing a port here gives the system additional information about the network connections a
container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that
port from being exposed. Any port which is listening on the default 0.0.0.0 address inside a
container will be accessible from the network.
Port names dashboard and dashboard-https are reserved by the Operator and cannot be supplied
in the template. The Operator derives these named ports from
spec.config.roots.dashboard.listeners for probes, Services, and per-Pod API requests.
Change their container port by changing the corresponding listener bind instead.
env EnvVar arrayList of environment variables to set in the container.
envFrom EnvFromSource arrayList of sources to populate environment variables from in the container.
The keys defined within a source must be a C_IDENTIFIER. All invalid keys
will be reported as an event when the container is starting. When a key exists in multiple
sources, the value associated with the last source will take precedence.
Values defined by an Env with a duplicate key will take precedence.
resources ResourceRequirementsCompute Resources required by this container.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
podSecurityContext PodSecurityContextPod-level security attributes and common container settings.{ fsGroup:1000 fsGroupChangePolicy:Always runAsGroup:1000 runAsNonRoot:true runAsUser:1000 }
containerSecurityContext SecurityContextSecurity options the container should be run with.
If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
initContainers Container arrayList of initialization containers belonging to the pod.
Init containers are executed in order prior to containers being started. If any
init container fails, the pod is considered to have failed and is handled according
to its restartPolicy. The name for an init container or normal container must be
unique among all containers.
Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
The resourceRequirements of an init container are taken into account during scheduling
by finding the highest request/limit for each resource type, and then using the max of
of that value or the sum of the normal containers. Limits are applied to init containers
in a similar fashion.
More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
extraContainers Container arrayAdditional containers to run alongside the main container.
extraVolumes Volume arrayAdditional volumes to provide to a Pod.
extraVolumeMounts VolumeMount arraySpecifies how additional volumes are mounted into the main container.
livenessProbe ProbePeriodic probe of container liveness.
Container will be restarted if the probe fails.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
{ failureThreshold:3 httpGet:map[path:/status port:dashboard] initialDelaySeconds:60 periodSeconds:30 }
readinessProbe ProbePeriodic probe of container service readiness.
Container will be removed from service endpoints if the probe fails.
Strongly advised to keep the current default: it takes into account ongoing node evacuations managed
by the Operator as part of scaling operations and rolling updates.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
{ failureThreshold:1 httpGet:map[path:/api/v5/load_rebalance/availability_check port:dashboard] initialDelaySeconds:10 periodSeconds:5 timeoutSeconds:3 }
startupProbe ProbeStartupProbe indicates that the Pod has successfully initialized.
If specified, no other probes are executed until this completes successfully.
If this probe fails, the Pod will be restarted, just as if the livenessProbe failed.
This can be used to provide different probe parameters at the beginning of a Pod's lifecycle,
when it might take a long time to load data or warm a cache, than during steady-state operation.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
lifecycle LifecycleActions that the management system should take in response to container lifecycle events.
replicas integerDesired number of Replicant nodes.0Minimum: 0

EMQXSpec ​

EMQXSpec defines the desired state of EMQX.

Appears in:

FieldDescriptionDefaultValidation
image stringEMQX container image.
More info: https://kubernetes.io/docs/concepts/containers/images
imagePullPolicy PullPolicyContainer image pull policy.
One of Always, Never, IfNotPresent.
Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
imagePullSecrets LocalObjectReference arrayImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
If specified, these secrets will be passed to individual puller implementations for them to use.
More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
serviceAccountName stringServiceAccount name.
Managed ReplicaSets and StatefulSets are associated with the specified ServiceAccount for authentication purposes.
More info: https://kubernetes.io/docs/concepts/security/service-accounts
config ConfigEMQX Configuration.
clusterDomain stringKubernetes cluster domain.cluster.local
revisionHistoryLimit integerNumber of old ReplicaSets to retain to allow rollback.3
updateStrategy UpdateStrategyCluster upgrade strategy settings.{ type:RollingUpdate }
coreTemplate EMQXCoreTemplateTemplate for Pods running EMQX core nodes.{ spec:map[persistentVolumeClaimSpec:map[accessModes:[ReadWriteOnce] resources:map[requests:map[storage:500Mi]]] replicas:1] }
replicantTemplate EMQXReplicantTemplateTemplate for Pods running EMQX replicant nodes.{ spec:map[replicas:0] }
dashboardServiceTemplate ServiceTemplateTemplate for Service exposing the EMQX Dashboard.
Dashboard Service always points to the set of EMQX core nodes.
A port named dashboard or dashboard-https in the template overrides the corresponding
generated Service port. Its port may expose the listener on a different Service port, but
its targetPort must resolve to the corresponding Dashboard listener. Prefer the reserved
named target port so it follows changes to the listener bind.
listenersServiceTemplate ServiceTemplateTemplate for Service exposing enabled EMQX listeners.
Listeners Service points to the set of EMQX replicant nodes if they are enabled and exist.
Otherwise, it points to the set of EMQX core nodes.

EMQXStatus ​

EMQXStatus defines the observed state of EMQX

Appears in:

FieldDescriptionDefaultValidation
conditions Condition arrayConditions representing the current status of the EMQX Custom Resource.
coreReplicas integerObserved replica count for the core set.
coreSelector stringSerialized label selector matching core pods.
replicantReplicas integerObserved replica count for the replicant set pods.
Used by the scale subresource.
replicantSelector stringSerialized label selector matching replicant pods.
Used by the scale subresource for HPA pod discovery.
coreNodesStatus CoreNodesStatusSummary status of the set of core nodes.
replicantNodesStatus ReplicantNodesStatusSummary status of the set of replicant nodes.
clusterNodes EMQXNode arrayObserved cluster nodes, including nodes whose role is unknown.
nodeEvacuations NodeEvacuationStatus arrayStatus of active node evacuations in the cluster.
dsReplication DSReplicationStatusStatus of EMQX Durable Storage replication.
config ConfigStatusDeclarative EMQX configuration reconciliation status.
Fields are informational implementation details. Prefer the ConfigApplied
condition to determine configuration lifecycle state.

EvacuationStrategy ​

Appears in:

FieldDescriptionDefaultValidation
type EvacuationStrategyTypeType of the evacuation policy.NodeEvacuationEnum: [NodeEvacuation Disabled]
connectionEvictionRate integerClient disconnect rate (number per second).
Same as conn-evict-rate in EMQX Node Evacuation.
1000Minimum: 1
sessionEvictionRate integerSession evacuation rate (number per second).
Same as sess-evict-rate in EMQX Node Evacuation.
1000Minimum: 1
waitTakeover integerAmount of time (in seconds) to wait before starting session evacuation.
Same as wait-takeover in EMQX Node Evacuation.
10Minimum: 0
waitHealthCheck integerDuration (in seconds) during which the node waits for the Load Balancer to remove it from the active backend node list.
Same as wait-health-check in EMQX Node Evacuation.
60Minimum: 0

EvacuationStrategyType ​

Underlying type: string

Appears in:

FieldDescription
NodeEvacuation
Disabled

NodeEvacuationStatus ​

Appears in:

FieldDescriptionDefaultValidation
nodeName stringEvacuated node name
state stringEvacuation state
sessionRecipients string arraySession recipients
sessionEvictionRate integerSession eviction rate, in sessions per second.
connectionEvictionRate integerConnection eviction rate, in connections per second.
initialSessions integerInitial number of sessions on this node
initialConnections integerInitial number of connections to this node

ReplicantNodesStatus ​

ReplicantNodesStatus is the summary status of the set of replicant nodes. The multi-ReplicaSet pattern requires revision tracking at the CR level.

Appears in:

FieldDescriptionDefaultValidation
readyReplicas integerNumber of ready replicas.
currentRevision stringCurrent revision of the replicant set.
currentReplicas integerNumber of replicas running current revision.
updateRevision stringUpdate revision of the replicant set.
When different from the current revision, the set is being updated.
updateReplicas integerNumber of replicas running update revision.
collisionCount integer

ReplicantsUpdateStrategy ​

ReplicantsUpdateStrategy controls the pace of replicant ReplicaSet rollouts. Semantics mirror apps/v1 Deployment.spec.strategy.rollingUpdate.

Appears in:

FieldDescriptionDefaultValidation
maxUnavailable IntOrStringMaxUnavailable is the maximum number of old replicant pods that may be drained (evacuating,
terminating, or marked for deletion) at once during a replicant ReplicaSet rollout.
Integers are absolute counts; strings are percentages of desired replicant replicas (e.g. "25%").
Defaults to 1 (serial drain).
XIntOrString: {}
maxSurge IntOrStringMaxSurge is the number of extra replicant pods allowed above the desired replica count on the
new ReplicaSet during a template rollout. Integers are absolute; strings are percentages of desired replicas.
Defaults to 0.
XIntOrString: {}

ServiceTemplate ​

Appears in:

FieldDescriptionDefaultValidation
enabled booleanSpecifies whether the Service should be created.true
metadata TemplateObjectMetaMetadata applied to objects generated from this template.
spec ServiceSpecSpecification of the desired state of a Service.
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status

TemplateObjectMeta ​

TemplateObjectMeta contains metadata propagated to objects created from a template.

Appears in:

FieldDescriptionDefaultValidation
labels object (keys:string, values:string)Labels applied to generated objects.
annotations object (keys:string, values:string)Annotations applied to generated objects.

UpdateStrategy ​

Appears in:

FieldDescriptionDefaultValidation
type stringDetermines how cluster upgrade is performed.
* RollingUpdate: Perform a rolling upgrade, updating pods gradually; core pods are
always updated one at a time, updating of replicants is controlled by replicants
strategy.
RollingUpdateEnum: [RollingUpdate]
evacuationStrategy EvacuationStrategyEvacuation strategy settings.{ type:NodeEvacuation }
replicants ReplicantsUpdateStrategyParameters of the rolling update for replicant ReplicaSet rollouts.