Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMQX Operator rejects valid EMQX zone configuration with '.mqtt' path segment #1090

Closed
Saddamus opened this issue Dec 23, 2024 · 4 comments
Closed
Labels
help wanted Extra attention is needed #triage/stale

Comments

@Saddamus
Copy link

Issue Description:
The EMQX operator's CRD validation rejects zone configurations that include the '.mqtt' path segment (e.g., 'zones.internal.mqtt.force_shutdown'), despite this being a valid configuration path required by EMQX itself. This creates a conflict where operators cannot apply certain valid EMQX configurations through the Kubernetes operator.

Impact:

  • Unable to configure certain EMQX zone settings through the operator
  • Configurations get rejected during validation despite being valid EMQX configurations
  • Forces users to find workarounds or avoid using certain configuration options

Current Behavior:

  • The operator rejects configurations with paths like 'zones.internal.mqtt.force_shutdown'
  • Validation error indicates unknown fields: "unknown_fields,path => zones.internal.mqtt, unknown => force_shutdown"
  • The operator expects 'zones.internal.force_shutdown' format

Expected Behavior:

  • The operator should accept valid EMQX configuration paths including the '.mqtt' segment
  • Configuration like 'zones.internal.mqtt.force_shutdown' should pass validation
  • Applied configuration should be reflected in EMQX's running configuration

Steps to Reproduce:

  1. Install EMQX operator (latest version)
  2. Create an EMQX custom resource with the following configuration:
spec:
    config:
    data: |
        zones.internal.mqtt.force_shutdown {
        enable = false
        }
  1. Apply the configuration
  2. Observe validation error in operator logs

Configuration Examples:
Valid EMQX configuration (rejected by operator):

zones.internal.mqtt.force_shutdown {
enable = false
}

Operator-accepted configuration (not fully recognized by EMQX):

zones.internal.force_shutdown {
enable = false
}

Error Logs:

unknown_fields,path => "zones.internal.mqtt", unknown => "force_shutdown"

Relevant Configuration:

  • Operator installed with skipCRDs: false (default CRD installation)
  • Using standard EMQX custom resource for configuration

Attempted Workarounds:

  1. Tried using the operator's expected format (zones.internal.force_shutdown), but configuration not recognized by EMQX
  2. Verified that the .mqtt path segment is required in native EMQX configuration

Additional Notes:

  • The validation rules in the operator's CRDs need to be updated to match EMQX's actual configuration schema
  • This appears to be a mismatch between the operator's validation rules and EMQX's configuration requirements
@Saddamus Saddamus added the bug Something isn't working label Dec 23, 2024
@Rory-Z
Copy link
Member

Rory-Z commented Dec 23, 2024

Hi,@Saddamus I'm sorry, the results I got are inconsistent with yours.
I try deploy emqx use this YAML

apiVersion: apps.emqx.io/v2beta1
kind: EMQX
metadata:
  name: emqx
spec:
  image: emqx:5
  config:
    data: |
      zones.internal.mqtt.force_shutdown {
        enable = false
      }

And EMQX operator is work, but EMQX pod can not work because the configure of zones.internal.mqtt.force_shutdown is not exist, I got this error

2024-12-23T07:11:22.352465+00:00 [error] #{reason => unknown_fields,path => "zones.internal.mqtt",unknown => "force_shutdown",kind => validation_error,unmatched => "await_rel_timeout,client_attrs_init,..."}

@Rory-Z Rory-Z added help wanted Extra attention is needed and removed bug Something isn't working labels Dec 23, 2024
@Saddamus
Copy link
Author

Please try to deploy emqx-cluster.yaml together with this chart. You will find that line zones.internal.mqtt.force_shutdown doesnt pass validation, while without mqtt segment will pass.
According to documentation, this settings is behind mqtt segment:
https://docs.emqx.com/en/emqx/latest/configuration/configuration.html#zone-override

emqx-operator.zip

@Rory-Z
Copy link
Member

Rory-Z commented Dec 24, 2024

Deploy EMQX form your emqx-cluster.yaml, looks EMQX operator is work, and EMQX pod can not work because the configure of zones.internal.mqtt.force_shutdown is not exist

image

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed #triage/stale
Projects
None yet
Development

No branches or pull requests

2 participants