# API Reference

# Packages

# apps.emqx.io/v2alpha1

Package v2alpha1 contains API Schema definitions for the apps v2alpha1 API group

# Resource Types

# BlueGreenUpdate

Appears in:

FieldDescription
initialDelaySeconds integerNumber of seconds before evacuation connection start.
evacuationStrategy EvacuationStrategyNumber of seconds before evacuation connection timeout.

# BootstrapAPIKey

Appears in:

FieldDescription
key string
secret string

# Condition

Appears in:

FieldDescription
type ConditionTypeStatus of cluster condition.
status ConditionStatus (opens new window)Status of the condition, one of True, False, Unknown.
reason stringThe reason for the condition's last transition.
message stringA human readable message indicating details about the transition.
lastTransitionTime stringLast time the condition transitioned from one status to another.
lastUpdateTime stringThe last time this condition was updated.

# ConditionType

Underlying type: string

Appears in:

# EMQX

EMQX is the Schema for the emqxes API

Appears in:

FieldDescription
apiVersion stringapps.emqx.io/v2alpha1
kind stringEMQX
metadata ObjectMeta (opens new window)Refer to Kubernetes API documentation for fields of metadata.
spec EMQXSpecSpec defines the desired identities of EMQX nodes in this set.
status EMQXStatusStatus is the current status of EMQX nodes. This data may be out of date by some window of time.

# EMQXCoreTemplate

Appears in:

FieldDescription
metadata ObjectMeta (opens new window)Refer to Kubernetes API documentation for fields of metadata.
spec EMQXCoreTemplateSpecSpecification of the desired behavior of the EMQX core node. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status

# EMQXCoreTemplateSpec

Appears in:

FieldDescription
nodeSelector object (keys:string, values:string)NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
nodeName stringNodeName is a request 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 Affinity (opens new window)Affinity for pod assignment ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
toleRations Toleration (opens new window) arrayIf specified, the pod's tolerations. The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator .
replicas integerReplicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. Defaults to 2 if EMQX core node, or 3 if EMQX replicant node.
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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
ports ContainerPort (opens new window) 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. Cannot be updated.
env EnvVar (opens new window) arrayList of environment variables to set in the container. Cannot be updated.
envFrom EnvFromSource (opens new window) arrayList of sources to populate environment variables 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. Cannot be updated.
resources ResourceRequirements (opens new window)Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
podSecurityContext PodSecurityContext (opens new window)SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.
containerSecurityContext SecurityContext (opens new window)SecurityContext defines the security 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 (opens new window) 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. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
extraContainers Container (opens new window) arrayExtraContainers represents extra containers to be added to the pod. See https://github.com/emqx/emqx-operator/issues/252
extraVolumes Volume (opens new window) arraySee https://github.com/emqx/emqx-operator/pull/72
extraVolumeMounts VolumeMount (opens new window) arraySee https://github.com/emqx/emqx-operator/pull/72
livenessProbe Probe (opens new window)Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
readinessProbe Probe (opens new window)Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
startupProbe Probe (opens new window)StartupProbe 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. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
lifecycle Lifecycle (opens new window)Actions that the management system should take in response to container lifecycle events. Cannot be updated.
volumeClaimTemplates PersistentVolumeClaimSpec (opens new window)VolumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name. More than EMQXReplicantTemplateSpec

# EMQXList

EMQXList contains a list of EMQX

FieldDescription
apiVersion stringapps.emqx.io/v2alpha1
kind stringEMQXList
metadata ListMeta (opens new window)Refer to Kubernetes API documentation for fields of metadata.
items EMQX array

# EMQXNode

Appears in:

FieldDescription
node stringEMQX node name, example: emqx@127.0.0.1
node_status stringEMQX node status, example: Running
otp_release stringErlang/OTP version used by EMQX, example: 24.2/12.2
version stringEMQX version
role stringEMQX cluster node role, enum: "core" "replicant"
edition stringEMQX cluster node edition, enum: "Opensource" "Enterprise"
uptime integerEMQX node uptime, milliseconds
connections integerMQTT connection count

# EMQXReplicantTemplate

Appears in:

FieldDescription
metadata ObjectMeta (opens new window)Refer to Kubernetes API documentation for fields of metadata.
spec EMQXReplicantTemplateSpecSpecification of the desired behavior of the EMQX replicant node. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status

# EMQXReplicantTemplateSpec

Appears in:

FieldDescription
nodeSelector object (keys:string, values:string)NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
nodeName stringNodeName is a request 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 Affinity (opens new window)Affinity for pod assignment ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
toleRations Toleration (opens new window) arrayIf specified, the pod's tolerations. The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator .
replicas integerReplicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. Defaults to 2 if EMQX core node, or 3 if EMQX replicant node.
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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
ports ContainerPort (opens new window) 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. Cannot be updated.
env EnvVar (opens new window) arrayList of environment variables to set in the container. Cannot be updated.
envFrom EnvFromSource (opens new window) arrayList of sources to populate environment variables 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. Cannot be updated.
resources ResourceRequirements (opens new window)Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
podSecurityContext PodSecurityContext (opens new window)SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.
containerSecurityContext SecurityContext (opens new window)SecurityContext defines the security 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 (opens new window) 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. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
extraContainers Container (opens new window) arrayExtraContainers represents extra containers to be added to the pod. See https://github.com/emqx/emqx-operator/issues/252
extraVolumes Volume (opens new window) arraySee https://github.com/emqx/emqx-operator/pull/72
extraVolumeMounts VolumeMount (opens new window) arraySee https://github.com/emqx/emqx-operator/pull/72
livenessProbe Probe (opens new window)Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
readinessProbe Probe (opens new window)Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
startupProbe Probe (opens new window)StartupProbe 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. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
lifecycle Lifecycle (opens new window)Actions that the management system should take in response to container lifecycle events. Cannot be updated.

# EMQXSpec

EMQXSpec defines the desired state of EMQX

Appears in:

FieldDescription
image stringEMQX image name. More info: https://kubernetes.io/docs/concepts/containers/images
imagePullPolicy PullPolicy (opens new window)Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
imagePullSecrets LocalObjectReference (opens new window) 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
blueGreenUpdate BlueGreenUpdateBlueGreenUpdate is the object that describes the EMQX blue-green update strategy
bootstrapAPIKeys BootstrapAPIKey arrayEMQX bootstrap user Cannot be updated.
bootstrapConfig stringEMQX bootstrap config, HOCON style, like emqx.conf Cannot be updated.
coreTemplate EMQXCoreTemplateCoreTemplate is the object that describes the EMQX core node that will be created
replicantTemplate EMQXReplicantTemplateReplicantTemplate is the object that describes the EMQX replicant node that will be created
dashboardServiceTemplate Service (opens new window)DashboardServiceTemplate is the object that describes the EMQX dashboard service that will be created This service always selector the EMQX core node
listenersServiceTemplate Service (opens new window)ListenersServiceTemplate is the object that describes the EMQX listener service that will be created If the EMQX replicant node exist, this service will selector the EMQX replicant node Else this service will selector EMQX core node

# EMQXStatus

EMQXStatus defines the observed state of EMQX

Appears in:

FieldDescription
currentImage stringCurrentImage, indicates the image of the EMQX used to generate Pods in the
coreNodeReplicas integerCoreNodeReplicas is the number of EMQX core node Pods created by the EMQX controller.
coreNodeReadyReplicas integerCoreNodeReadyReplicas is the number of EMQX core node Pods created for this EMQX Custom Resource with a Ready Condition.
replicantNodeReplicas integerReplicantNodeReplicas is the number of EMQX replicant node Pods created by the EMQX controller.
replicantNodeReadyReplicas integerReplicantNodeReadyReplicas is the number of EMQX replicant node Pods created for this EMQX Custom Resource with a Ready Condition.
emqxNodes EMQXNode arrayEMQX nodes info
conditions Condition arrayRepresents the latest available observations of a EMQX Custom Resource current state.

# EvacuationStrategy

Appears in:

FieldDescription
waitTakeover integer
connEvictRate integerJust work in EMQX Enterprise.
sessEvictRate integerJust work in EMQX Enterprise.