fix(helm): make helm service port configurable to port 80 #3013
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This makes the Service port able to be configured to a normally privileged port like port 80.
To do so, I'm pinning the containerPort to 4954 to match what
trivy server
runs on by default, and am making theservice.port
to not be "overloaded" to be the container port as well.I took a quick look at other charts like prometheus and grafana, to see if they allow containerPort to be configurable in the values.yml, but it looks like they don't, so I'm thinking it's not so common. I can't think of a use-case for configuring it at least, since all traffic to the Pod comes from the Service. I can make it configurable if you would like though.
To test locally:
Set up a test cluster:
Before
Confirm that setting the Service port to 80 causes the pod to crash:
After
Try the same from this branch, and confirm that pod isn't crashing:
And confirm that we can access the Service on port 80:
Related issues
Checklist