Skip to content

API Reference (v2)

Packages

apps.emqx.io/v2

package v2 contains API Schema definitions for the apps v2 API group.

Resource Types

BootstrapAPIKey

Appears in:

FieldDescriptionDefaultValidation
key stringPattern: ^[a-zA-Z\d-_]+$
secret stringMaxLength: 128
MinLength: 3
secretRef SecretRefReference to a Secret entry containing the EMQX API Key.

Config

Appears in:

FieldDescriptionDefaultValidation
mode stringDetermines how configuration updates are applied.
* Merge: Merge the new configuration into the existing configuration.
* Replace: Replace the whole configuration.
MergeEnum: [Merge Replace]
data stringEMQX configuration, in HOCON format.
This configuration will be supplied as base.hocon to the container. See respective
documentation.

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/v2
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 ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
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/config/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/config/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.
replicas integerDesired number of instances.
In case of core nodes, each instance has a consistent identity.
2Minimum: 0
minAvailable IntOrStringAn eviction is allowed if at least "minAvailable" pods selected by
"selector" will still be available after the eviction, i.e. even in the
absence of the evicted pod. So for example you can prevent all voluntary
evictions by specifying "100%".
XIntOrString: {}
maxUnavailable IntOrStringAn eviction is allowed if at most "maxUnavailable" pods selected by
"selector" are unavailable after the eviction, i.e. even in absence of
the evicted pod. For example, one can prevent all voluntary evictions
by specifying 0. This is a mutually exclusive setting with "minAvailable".
XIntOrString: {}
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
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.
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/config/manage-resources-containers/
podSecurityContext PodSecurityContextPod-level security attributes and common container settings.{ fsGroup:1000 fsGroupChangePolicy:Always runAsGroup:1000 runAsUser:1000 supplementalGroups:[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/
{ runAsGroup:1000 runAsNonRoot:true runAsUser:1000 }
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.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
{ failureThreshold:12 httpGet:map[path:/status port:dashboard] initialDelaySeconds:10 periodSeconds:5 }
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.
volumeClaimTemplates PersistentVolumeClaimSpecPVC specification for a core node data storage.
Note: this field named inconsistently, it is actually just a PersistentVolumeClaimSpec.

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"
sessions integerNumber of MQTT sessions
connections integerNumber of connected MQTT clients

EMQXNodesStatus

Appears in:

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

EMQXReplicantTemplate

Appears in:

FieldDescriptionDefaultValidation
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
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

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/config/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/config/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.
replicas integerDesired number of instances.
In case of core nodes, each instance has a consistent identity.
2Minimum: 0
minAvailable IntOrStringAn eviction is allowed if at least "minAvailable" pods selected by
"selector" will still be available after the eviction, i.e. even in the
absence of the evicted pod. So for example you can prevent all voluntary
evictions by specifying "100%".
XIntOrString: {}
maxUnavailable IntOrStringAn eviction is allowed if at most "maxUnavailable" pods selected by
"selector" are unavailable after the eviction, i.e. even in absence of
the evicted pod. For example, one can prevent all voluntary evictions
by specifying 0. This is a mutually exclusive setting with "minAvailable".
XIntOrString: {}
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
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.
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/config/manage-resources-containers/
podSecurityContext PodSecurityContextPod-level security attributes and common container settings.{ fsGroup:1000 fsGroupChangePolicy:Always runAsGroup:1000 runAsUser:1000 supplementalGroups:[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/
{ runAsGroup:1000 runAsNonRoot:true runAsUser:1000 }
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.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
{ failureThreshold:12 httpGet:map[path:/status port:dashboard] initialDelaySeconds:10 periodSeconds:5 }
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.

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
bootstrapAPIKeys BootstrapAPIKey arrayBootstrap API keys to access EMQX API.
Cannot be updated.
config ConfigEMQX Configuration.
clusterDomain stringKubernetes cluster domain.cluster.local
revisionHistoryLimit integerNumber of old ReplicaSets, old StatefulSets and old PersistentVolumeClaims to retain to allow rollback.3
updateStrategy UpdateStrategyCluster upgrade strategy settings.{ type:Recreate }
coreTemplate EMQXCoreTemplateTemplate for Pods running EMQX core nodes.{ spec:map[replicas:2] }
replicantTemplate EMQXReplicantTemplateTemplate for Pods running EMQX replicant nodes.
dashboardServiceTemplate ServiceTemplateTemplate for Service exposing the EMQX Dashboard.
Dashboard Service always points to the set of EMQX core nodes.
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.
coreNodes EMQXNode arrayStatus of each core node in the cluster.
coreNodesStatus EMQXNodesStatusSummary status of the set of core nodes.
replicantNodes EMQXNode arrayStatus of each replicant node in the cluster.
replicantNodesStatus EMQXNodesStatusSummary status of the set of replicant nodes.
nodeEvacuationsStatus NodeEvacuationStatus arrayStatus of active node evacuations in the cluster.
dsReplication DSReplicationStatusStatus of EMQX Durable Storage replication.

EvacuationStrategy

Appears in:

FieldDescriptionDefaultValidation
connEvictRate integerClient disconnect rate (number per second).
Same as conn-evict-rate in EMQX Node Evacuation.
1000Minimum: 1
sessEvictRate 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

KeyRef

Appears in:

FieldDescriptionDefaultValidation
secretName stringName of the Secret object.
secretKey stringEntry within the Secret data.Pattern: ^[a-zA-Z\d-_]+$

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

SecretRef

Appears in:

FieldDescriptionDefaultValidation
key KeyRefReference to a Secret entry containing the EMQX API Key.
secret KeyRefReference to a Secret entry containing the EMQX API Key's secret.

ServiceTemplate

Appears in:

FieldDescriptionDefaultValidation
enabled booleanSpecifies whether the Service should be created.true
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.
spec ServiceSpecSpecification of the desired state of a Service.
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status

UpdateStrategy

Appears in:

FieldDescriptionDefaultValidation
type stringDetermines how cluster upgrade is performed.
* Recreate: Perform blue-green upgrade.
RecreateEnum: [Recreate]
initialDelaySeconds integerNumber of seconds before connection evacuation starts.10Minimum: 0
evacuationStrategy EvacuationStrategyEvacuation strategy settings.