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

[7.11] A secret used in an A-MQ Broker Operator custom resource is not mounted when using a particular file name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Undefined Undefined
    • None
    • None
    • None

      When using this secret definition
      -----------------------------------------------------------------
      kind: Secret
      apiVersion: v1
      metadata:
        name: secret-bp
      stringData:
        broker-props-page1.properties: |
          maxDiskUsage=97
      included in this ActivemqArtemis CR definition
      -----------------------------------------------------------------
      apiVersion: broker.amq.io/v1beta1
      kind: ActiveMQArtemis
      metadata:
        name: ex-aao
      spec:
        deploymentPlan:
          image: placeholder
          jolokiaAgentEnabled: false
          journalType: nio
          managementRBACEnabled: true
          messageMigration: false
          persistenceEnabled: false
          requireLogin: false
          size: 1
          extraMounts:
            secrets:
              - secret-bp
        env:
          - name: JAVA_ARGS_APPEND
            value: -Dbroker.properties=/amq/extra/secrets/ex-aao-props/broker.properties,/amq/extra/secrets/secret-bp/broker-props-page1.properties

      You notice the pod is in CrashLoopBackOff, and there is an exception on the pod:

      java.io.FileNotFoundException: /amq/extra/secrets/secret-bp/broker-props-page1.properties (No such file or directory)

      But if you correct the file name on the secret, to start with a string different than "broker-", like:
      ------------------------------------------------------------------------

      kind: Secret
      apiVersion: v1
      metadata:
        name: secret-bp
      stringData:
        x-broker-props-page1.properties: |
          maxDiskUsage=97
      And you correct the broker's definition accordingly

      ------------------------------------------------------------------------
      apiVersion: broker.amq.io/v1beta1
      kind: ActiveMQArtemis...

        env:
        - name: JAVA_ARGS_APPEND
          value: -Dbroker.properties=/amq/extra/secrets/ex-aao-props/broker.properties,/amq/extra/secrets/secret-bp/x-broker-props-page1.properties

      then, the pod is recreated and runs as expected

      sdds

            dbruscin Domenico Francesco Bruscino
            rh-messaging-ci Messaging CI
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: