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

Support different service and container ports #175

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

abaguas
Copy link
Contributor

@abaguas abaguas commented Sep 30, 2024

Why is this pull request needed and what does it do?

This PR allows exposing coreDNS on a service port different from the ports exposed by the container.
We want to expose coreDNS publicly. To increase security we would like to open a container port above 1024 to not add the NET_BIND_SERVICE capability, while still exposing the service on port 53.

The change adds an optional servers.servicePort key that can be used to set a service port. If this value is not set, the value of the servers.port is used both as service and container port (old behavior). Thus, the change is fully backwards compatible.

helm package . && helm template coredns coredns-1.33.0.tgz -f values.yaml > manifests2.yaml
...
diff manifests.yaml manifests2.yaml                                                        
111,112c111,112
<   - {"name":"udp-53","port":53,"protocol":"UDP"}
<   - {"name":"tcp-53","port":53,"protocol":"TCP"}
---
>   - {"name":"udp-53","port":53,"protocol":"UDP","targetPort":53}
>   - {"name":"tcp-53","port":53,"protocol":"TCP","targetPort":53}

Checklist:

  • I have bumped the chart version according to versioning.
  • I have updated the chart changelog with all the changes that come with this pull request according to changelog.
  • Any new values are backwards compatible and/or have sensible default.
  • I have signed off all my commits as required by DCO.

Changes are automatically published when merged to main. They are not published on branches.

Note on DCO

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Copy link
Collaborator

@hagaibarel hagaibarel left a comment

Choose a reason for hiding this comment

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

Small nit

charts/coredns/Chart.yaml Outdated Show resolved Hide resolved
Signed-off-by: Andre Baptista Aguas <andre.aguas@protonmail.com>
@hagaibarel hagaibarel merged commit ecdc676 into coredns:master Oct 1, 2024
2 checks passed
@hagaibarel
Copy link
Collaborator

Thanks for the PR!

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.

2 participants