Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-7119

[Operator] The 'resourceVersion' is being set when creating resources

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • AMQ 7.11.0.GA
    • AMQ 7.10.0.OPR.3.GA
    • operator
    • False
    • None
    • False
    • +
    • Hide

      1 Install the AMQ operator for watching your testing namespace

      2 Create a keystore containing a self-signed certificate for the web-console. Use 'password' as password and the defaults for the rest of the fields.

      keytool -genkey -alias broker -keyalg RSA -keystore broker.ks
      

      3 Create a secret with name "my-console-secret" containing the previous keystore in your namespace

      oc create secret generic my-console-secret \
      --from-file=broker.ks=broker.ks \
      --from-file=client.ts=broker.ks \
      --from-literal=keyStorePassword=password \
      --from-literal=trustStorePassword=password
      

      4 Apply the following CustomResource:

      apiVersion: broker.amq.io/v1beta1
      kind: ActiveMQArtemis
      metadata:
        name: ex-aao
      spec:
        deploymentPlan:
          persistenceEnabled: true
          storage:
            size: 1024Mi
          size: 1
          image: placeholder
          resources:
            limits:
              cpu: 500m
              memory: 512Mi
            requests:
              cpu: 200m
              memory: 128Mi
        console:
          expose: true
          sslEnabled: true
          sslSecret: my-console-secret
      

      The operator will deploy the AMQ and the console will be exposed using SSL and the certificate. But the logs will contain the error traces mentioned in the description section. It seems the error does not have a negative impact on the broker deployment.

      Show
      1 Install the AMQ operator for watching your testing namespace 2 Create a keystore containing a self-signed certificate for the web-console. Use 'password' as password and the defaults for the rest of the fields. keytool -genkey -alias broker -keyalg RSA -keystore broker.ks 3 Create a secret with name " my-console-secret " containing the previous keystore in your namespace oc create secret generic my-console-secret \ --from-file=broker.ks=broker.ks \ --from-file=client.ts=broker.ks \ --from-literal=keyStorePassword=password \ --from-literal=trustStorePassword=password 4 Apply the following CustomResource: apiVersion: broker.amq.io/v1beta1 kind: ActiveMQArtemis metadata: name: ex-aao spec: deploymentPlan: persistenceEnabled: true storage: size: 1024Mi size: 1 image: placeholder resources: limits: cpu: 500m memory: 512Mi requests: cpu: 200m memory: 128Mi console: expose: true sslEnabled: true sslSecret: my-console-secret The operator will deploy the AMQ and the console will be exposed using SSL and the certificate. But the logs will contain the error traces mentioned in the description section. It seems the error does not have a negative impact on the broker deployment.

      The operator is trying to create an already created resource (in this example, a secret with name my-console-secret) when deploying an AMQ cluster, and the webconsole is exposed with SSL enabled.

      The secret containing the keystore/certificate to be used for securing the console was created before applying the CustomResource (CR). Then, it's referenced by the CR. After applying the CR, the operator tries to create the secret:

      ERROR	package k8s_actions	Failed to create new *v1.Secret	{"ActiveMQArtemis Name": "my-console-secret", "Namespace": "test-operator", "error": "resourceVersion should not be set on objects to be created"}
      github.com/artemiscloud/activemq-artemis-operator/controllers.(*ActiveMQArtemisReconcilerImpl).ProcessResources
      	/remote-source/app/controllers/activemqartemis_reconciler.go:1170
      github.com/artemiscloud/activemq-artemis-operator/controllers.(*ActiveMQArtemisReconcilerImpl).Process
      	/remote-source/app/controllers/activemqartemis_reconciler.go:129
      github.com/artemiscloud/activemq-artemis-operator/controllers.(*ActiveMQArtemisReconciler).Reconcile
      	/remote-source/app/controllers/activemqartemis_controller.go:142
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
      	/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:114
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
      	/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:311
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
      	/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:266
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
      	/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227
      

      Also, the operator sets the 'resourceVersion' attribute, and it should not be set, as mentioned in the operator-output.log

            gaohoward Howard Gao
            ryanezil Rafael Yáñez Illescas
            Michal Toth Michal Toth
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: