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

Initial Helm Chart implementation #3036

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

kamiKAZIK
Copy link

Thank you for contributing your time to the Mosquitto project!

Before you go any further, please note that we cannot accept contributions if
you haven't signed the Eclipse Contributor Agreement.
If you aren't able to do that, or just don't want to, please describe your bug
fix/feature change in an issue. For simple bug fixes it is can be just as easy
for us to be told about the problem and then go fix it directly.

Then please check the following list of things we ask for in your pull request:

  • Have you signed the Eclipse Contributor Agreement, using the same email address as you used in your commits?
  • Do each of your commits have a "Signed-off-by" line, with the correct email address? Use "git commit -s" to generate this line for you.
  • If you are contributing a new feature, is your work based off the develop branch?
  • If you are contributing a bugfix, is your work based off the fixes branch?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run make test with your changes locally?

Greetings, I would like to contribute this Helm Chart for Mosquitto project. I would love if anyone could review it and write down necessary fixed, if there have to be any. It would be nice and useful if the project has it's own officially supported Helm Chart to speed up deployments on Kubernetes.

{{ .Values.mosquitto.configFile }}
{{- if .Values.mosquitto.authentication.passwordFile }}
password_file {{ required ".Values.mosquitto.authentication.passwordFilePath is required!" .Values.mosquitto.authentication.passwordFilePath | quote }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no password file then you should probably add allow_anonymous true since I don't see a way to enable an auth plugin with this chart.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hardillb this is actually possible to set-up by adding necessary values using:

{{ .Values.mosquitto.configFile }}

@@ -0,0 +1,39 @@
{{- if and .Values.mosquitto.persistence.enabled -}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file can be added in the statefulSet as volumeClaimtemplate instead

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jlpedrosa I have made this change. Could you please review it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks totally fine to me.

storageClassName: ""
{{- else }}
storageClassName: {{ . }}
{{- end }}
Copy link

@jlpedrosa jlpedrosa May 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add here the properties to managed static provisioned volumes? This enables to keep the volumes on the NAS/SAN on cluster reinstall.

{{- if .Values.persistence.existingVolume }}
      volumeName: {{ .Values.persistence.existingVolume }}
      {{- end }}
      {{- if or .Values.persistence.matchLabels (.Values.persistence.matchExpressions) }}
      selector:
      {{- if .Values.persistence.matchLabels }}
        matchLabels:
        {{ toYaml .Values.persistence.matchLabels | indent 8 }}
      {{- end -}}
      {{- if .Values.persistence.matchExpressions }}
        matchExpressions:
          {{ toYaml .Values.persistence.matchExpressions | indent 8 }}
        {{- end -}}
      {{- end }}

Here you have a full sample if you want: https://github.com/pajikos/home-assistant-helm-chart/pull/48/files
I still think probably should go to the stateful set, but no big deal.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added this enhancement. It would be great if you could review it

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it LGTM, in any case as soon as the chart goes out, I'll try it out, so I can do some fixes if required,

{{- end -}}

{{- define "mosquitto.capabilities.ingress.apiVersion" -}}
{{- if semverCompare "<1.14-0" (include "mosquitto.capabilities.kubeVersion" .) -}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the last supported version of kube (not EOL) is 1.27, I don't think you need to support 10 year old versions...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am more inclined to keep this, as it is already implemented and maybe there are some unlucky guys that are stuck with some very old k8s versions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you! I feel it keeps complexity for something very, very old that is EOL.

Copy link

@jlpedrosa jlpedrosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I indeed would keep the release process in a different PR.
I'd suggest adding a Makefile / similar (and run it in this PR) with https://github.com/norwoodj/helm-docs

.PHONY: helm-docs
helm-docs:
	go run github.com/norwoodj/helm-docs/cmd/helm-docs@latest

Side note: I'm not a maintainer at all.

@jlpedrosa
Copy link

@hardillb do you know if we can merge this in? it would be highly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants