ibm-messaging / mq-helm

Apache License 2.0
28 stars 35 forks source link

Complex if statement in statefulset v8.0.0 #74

Closed schmiuwe closed 8 months ago

schmiuwe commented 8 months ago

Hi Callum,

I was able to deploy our Azure cloud QMgr with helm chart v8.0.0 since we need more control over starting and configuring the web server.

However, it does not work with the current checked in quite complex if statement in line 284 in stateful-set.yaml: {{- if or .Values.web.enable (eq .Values.web.enable false)}} With this statement I do not get it deployed. I changed it to: {{- if .Values.web.enable }} and then it works.

Another question, we have seen that the web server inside of the active pod has to be started by bashing into the container and starting it manually using strmqweb.

The new param support in values.yaml: web: enabled: manualConfig: configMap: name: secret: name:

Does this really start the web server process if set to true inside of the pods? I tried to use a postStart hook, this works for the active pod but causes trouble with the non-active pods.

Thank you, Uwe

schmiuwe commented 8 months ago

also I would like to create a configmap that sets/activates this parameter:

Is there an example about the yaml structure that explains how to set this parameter via a yaml file?

callumpjackson commented 8 months ago

Hi Uwe, hope everything is going well. Do you have the parameters that you used during the initial test and the failing output so I can review? I will try and recreate locally so I can debug the issue. In general the web.enable option should cause strmqweb to be called. I'm assuming if we can get you over that issue things might start falling into place. Thanks Callum

schmiuwe commented 8 months ago

I have just activated web.enable and tested, it works, web server is started after deploying this parameter set to true. Until now I did not set any params over yaml file. Instead I used the xml file out of the container and uncommented the line . I configured this in the file mqwebuser.xml. I just want to transfer this setting into my yaml file now and I dont know the structure of the config map it needs here:

web: 
  enabled: true
  manualConfig:
    configMap:
      name:
schmiuwe commented 8 months ago
<!-- 
By default the server listens for HTTP/HTTPS requests on localhost only. To 
listen on all available network interfaces uncomment the line below. To listen
on a specific IP address or hostname replace the * with an appropriate value.
-->
<variable name="httpHost" value="*"/>
schmiuwe commented 8 months ago

sorry was wrong: when deploying setting web.enabled to true, the web server does not get started inside of the container: bash-4.4$ dspmqweb MQWB1125I: Server 'mqweb' is not running. bash-4.4$

did you test this already?

callumpjackson commented 8 months ago

Just to make sure I'm understanding your setup, you have a yaml file with:

web: 
  enabled: true

What container image are you testing with? Is it the MQ Advanced for Developers image, or a custom build image?

schmiuwe commented 8 months ago

yes, just deployed it and web server does not get started t01n02a.zip added the files

schmiuwe commented 8 months ago

9.3.0.11-r2

schmiuwe commented 8 months ago

and helm chart v8.0.0 where I fixed the if statement in stateful-set.yaml to {{- if .Values.web.enable }}

callumpjackson commented 8 months ago

For interest what error did you receive when the condition was set to its original value:

{{- if or .Values.web.enable (eq .Values.web.enable false)}}
          - name: MQ_ENABLE_EMBEDDED_WEB_SERVER
            value: "{{ .Values.web.enable | default false }}"
          {{- end }}

I want to make sure we understand that issue, and address anything if required.

schmiuwe commented 8 months ago

when I deploy with the original if statement then I am getting this error while deploying with argocd: failed exit status 1: Error: template: t01n02a/charts/bmw-ibm-mqs/charts/ibm-mq/templates/stateful-set.yaml:284:40: executing "t01n02a/charts/bmw-ibm-mqs/charts/ibm-mq/templates/stateful-set.yaml" at <eq .Values.web.enable false>: error calling eq: incompatible types for comparison Use --debug flag to render out invalid YAML

I attached you full error text

deployment_error.txt

schmiuwe commented 8 months ago

besides the web.enabled flag, do I also need to set s.th. in the routes config?

route: nodePort: webconsole: false mqtraffic: false openShiftRoute: webconsole: false mqtraffic: false loadBalancer: webconsole: false mqtraffic: false

Additional annotations to be added to the load balancer annotations

  annotations: {}
  loadBalancerSourceRanges: []
ingress:
  webconsole: 
    enable: false
    hostname: 
    path: /
    tls: 
      enable: false 
      secret: 
  annotations: {}

but actually I dont need this because we on top deploy a loadbalancer for ports 1414 and 9443 so when I change the web server binding config in the xml file in the container to also accept connections from outside of localhost then I can reach the web application. Problems only are:

schmiuwe commented 8 months ago

btw. we are using the config file: /opt/mqm/web/mq/samp/configuration/basic_registry.xml and overwrite the file mqwebuser.xml in your chart the file mqwebuser.xml is located at: name: cm-webxml-{{ .Values.web.manualConfig.configMap.name }} mountPath: "/etc/mqm/web/installations/Installation1/servers/mqweb/mqwebuser.xml"

we are using the file in this path: /var/mqm/web/installations/Installation1/servers/mqweb/

I checked you path, there is also a mqwebuser.xml file, however if I change it in /var/mqm ... it also reflects, maybe the server checks both files?

callumpjackson commented 8 months ago

I’ve re-tested in my local environment and everything is working as expected (no error) when I set the web console enable flag. I’m thinking a call to discuss may help. I’ll email you directly to setup.

schmiuwe commented 8 months ago

I’ve re-tested in my local environment and everything is working as expected (no error) when I set the web console enable flag. I’m thinking a call to discuss may help. I’ll email you directly to setup.

ok thank you

callumpjackson commented 8 months ago

We resolved the issue. After further testing it appears to be working as expected. I've added some additional documentation here that outlines how to use the capability.