charts icon indicating copy to clipboard operation
charts copied to clipboard

[artifactory] Added nginx.customCommand using inotifyd to reload nginx's config upon ssl secret or configmap changes

Open bramaq opened this issue 2 years ago • 10 comments

  • Add nginx.customCommand variable
  • Add nginx.command helper template
  • Replace nginx container command with a call to the template. This will render the nginx.customCommand. If empty defaults to nginx -g 'daemon off;'
  • Add an example nginx.customCommand using inotifyd to auto-reload nginx config if either ssl secrets or configmaps are updated.

PR Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • [x] Chart Version bumped
  • [x] CHANGELOG.md updated
  • [x] Variables and other changes are documented in the README.md
  • [x] Title of the PR starts with chart name (e.g. [artifactory])

What this PR does / why we need it: Add a new variable nginx.customCommand that can be used to override the command in the nginx containers. This can be used optionally, as per the commented out example in values.yaml, to setup inotifyd to reload nginx configuration upon configmaps/ssl secrets updates.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #1632

Special notes for your reviewer:

bramaq avatar Jun 06 '22 11:06 bramaq

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

github-actions[bot] avatar Jun 06 '22 11:06 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

bramaq avatar Jun 06 '22 11:06 bramaq

recheck

bramaq avatar Jun 06 '22 12:06 bramaq

@bramaq Thanks for the PR , can you please address the following things

  • To reduce values.yaml content , can this be moved under templates as configmap
  • Also add the same change in artifactory-ha chart

Let me know if you need any help on this

chukka avatar Jun 07 '22 03:06 chukka

@chukka Thanks for the review and feedback. Will it then be ok to use the "inotifyd enabled command" as default, but that still can be overridden via the nginx.customCommand variable?

Is there any value in using a CM here? Or adding it as the default in the _helpers.tpl would be enough? I cannot see much value in using a cm to be honest, but happy to go for the pattern of your choice.

bramaq avatar Jun 07 '22 10:06 bramaq

@bramaq for now, lets inotifyd enabled command be non default. Can you wrap command content into configreloader.sh as a file and a configmap to load it (reading file contents via CM in a editor is easier than in _helpers.tpl)

chukka avatar Jun 07 '22 15:06 chukka

@bramaq for now, lets inotifyd enabled command be non default. Can you wrap command content into configreloader.sh as a file and a configmap to load it (reading file contents via CM in a editor is easier than in _helpers.tpl)

@bramaq can you please work on above comments and update the PR

srinivasgowda097 avatar Jun 17 '22 06:06 srinivasgowda097

@srinivasgowda097 working on the requested changes... Sorry a bit hectic on my side...

bramaq avatar Jun 21 '22 07:06 bramaq

@srinivasgowda097, @chukka this is ready for review.

bramaq avatar Jun 27 '22 11:06 bramaq

@bramaq Thanks for updating the PR , we would like to review and take this in upcoming release (mostly 7.44.x of artifactory)

chukka avatar Jul 19 '22 02:07 chukka

@bramaq Can you please rebase and squash your commits to a single one

chukka avatar Oct 04 '22 07:10 chukka