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

Inconsistent MQ tlsSecretName variable logic #28

Closed
meathead23 opened this issue Aug 5, 2020 · 1 comment · Fixed by #52
Closed

Inconsistent MQ tlsSecretName variable logic #28

meathead23 opened this issue Aug 5, 2020 · 1 comment · Fixed by #52
Assignees
Labels
bug Something isn't working

Comments

@meathead23
Copy link

meathead23 commented Aug 5, 2020

Issue:

When setting variables for MQ as follows:

  mq:
    version: 9.1.3.0
    # Set to True if running MQ in HA mode
    useConnectionNameList: true
    tlsSecretName: 'spm-dev01-mq-secret'

The pods for mqserver-curam and mqserver-rest don't start correctly and throw the following error:

MountVolume.SetUp failed for volume "service-certs" : secret "spm-dev01-spm-dev01-mq-secret" not found

This seems to be caused by inconsistencies between apps/templates/deployment-consumer.yaml, apps/templates/deployment-producer.yaml and mqserver/templates/deployment.yaml

the Apps producer/consumer deployment scripts set the mq-cert secret volume as such:

        {{- if $.Values.global.mq.tlsSecretName }}
        - name: mq-certs
          secret:
            {{- if $.Values.global.mq.useConnectionNameList }}
            secretName: {{ $.Values.global.mq.tlsSecretName }}
            {{- else }}
            secretName: {{ $.Release.Name }}-mq-secret
            {{- end }}
        {{- end}}

Whereas the MQ deployment.yaml sets service-certs as:

        {{- if $.Values.global.mq.tlsSecretName }}
        - name: service-certs
          secret:
            secretName: {{ $.Release.Name }}-{{ $.Values.global.mq.tlsSecretName }}
        {{- end}}

This leads the the namespace, in the this case spm-dev01 been suffixed to service-certs but not to mq-certs

If tlsSecretName is left at the default of mq-secret the opposite occurs and the consumer/producer pods fail to deploy.

Solution:

Changing mqserver/templates/deployment.yaml and mqserver/templates/statefulset.yaml

from:

        {{- if $.Values.global.mq.tlsSecretName }}
        - name: service-certs
          secret:
            secretName: {{ $.Release.Name }}-{{ $.Values.global.mq.tlsSecretName }}
        {{- end}}

to:

        {{- if $.Values.global.mq.tlsSecretName }}
        - name: service-certs
          secret:
            {{- if $.Values.global.mq.useConnectionNameList }}
            secretName: {{ $.Values.global.mq.tlsSecretName }}
            {{- else }}
            secretName: {{ $.Release.Name }}-mq-secret
            {{- end }}
        {{- end}}

Fixes the issue, although i'm a bit unsure on some of the logic here, don't the if statements need to be other other way round e.g

        {{- if $.Values.global.mq.useConnectionNameList }}
        - name: service-certs
          secret:
            {{- if $.Values.global.mq.tlsSecretName }}
            secretName: {{ $.Values.global.mq.tlsSecretName }}
            {{- else }}
            secretName: {{ $.Release.Name }}-mq-secret
            {{- end }}
        {{- end}}
@meathead23 meathead23 changed the title inconsistent mq-secret variables Inconsistent tlsSecretName variable logic Aug 5, 2020
@meathead23 meathead23 changed the title Inconsistent tlsSecretName variable logic Inconsistent MQ tlsSecretName variable logic Aug 5, 2020
@niambhscullion12 niambhscullion12 added the bug Something isn't working label Aug 11, 2020
@andreyzher andreyzher self-assigned this Dec 16, 2020
@andreyzher
Copy link
Contributor

Sorry, a couple of issues slipped off the radar.

Whether certificates are used or not was never supposed to be conditional - certificates must always be available, it is a matter of whether they are system-generated, or provided externally, specifically in the case of MQ hosted outside the cluster (on VMs).

We will look at getting the logic cleaned up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants