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

Exposing dnsPolicy and dnsConfig on the Strimzi api PodTemplate to allow custom name resolution for Pod resources #10949

Merged
merged 9 commits into from
Dec 23, 2024

Conversation

gertschouten
Copy link
Contributor

@gertschouten gertschouten commented Dec 12, 2024

Type of change

  • Enhancement / new feature

Description

By appending Strimzi's common PodTemplate in the Strimzi api with additional properties dnsPolicy and dnsConfig the system configuration file /etc/recolv.conf for Strimzi Pod resources can be controlled, thereby deciding how domain name resolution should be performed on a resource level.
Strimzi's CRDs will thereby allow user input for name resolution customization.
WorkloadUtils in the Strimzi cluster operator for PodBuilder and PodTemplateSpecBuilder propagate these properties to Pods controlled by the operator.
Provisioned Pods will thereby utilize name resolution configuration based on the user input if specified and fall back to defaults, similar to the current situation, in case no dnsConfig or dnsPolicy is specified by the user.

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md
  • Supply screenshots for visual changes, such as Grafana dashboards

@scholzj
Copy link
Member

scholzj commented Dec 13, 2024

You should update the title and the description of the PR. You also seem to have some bad commits in there. The Pr has to be done against the main branch with the code from there. That might be also what broker the DCO signoff.

@scholzj scholzj linked an issue Dec 13, 2024 that may be closed by this pull request
@gertschouten gertschouten force-pushed the issue-10835 branch 2 times, most recently from b9e2cb2 to dddc11d Compare December 13, 2024 09:17
@gertschouten gertschouten changed the title Issue 10835 Exposing dnsPolicy and dnsConfig on the Strimzi api PodTemplate to allow custom name resolution for Pod resources Dec 13, 2024
Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

We in general deal with the PR only once the proposal is approved. But I left one comment. No need to address it now, you can do it only once the proposal is approved. It would be also great to fix all the unnecessary whitespace changes that make the reviews harder, but will also mess up the Git history etc. (e.g. in the pom.xml files, the values.yaml, etc.)

You will also need to run make crd_install to get the CRD changes copied out to the Helm Chart as well. And you will need to fix the DCO signoff. The instructions should be under the Details link next to the DCO signoff status in the PR.

@@ -53,6 +54,8 @@ public class PodTemplate implements HasMetadataTemplate, UnknownPropertyPreservi
private String priorityClassName;
private String schedulerName;
private List<HostAlias> hostAliases;
private PodDNSConfig dnsConfig;
private String dnsPolicy;
Copy link
Member

Choose a reason for hiding this comment

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

I think this should have an Enum for the supported values. Check for example how

is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 9bd12a2

@scholzj scholzj added this to the 0.46.0 milestone Dec 15, 2024
Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

I left some more nits. Also, there have been some changes to the main branch in between - could oyu please rebase it to address the conflicts? Thanks.

This might be also worth a record in the CHANGELOG.md file?

@@ -339,6 +341,8 @@ public static PodTemplateSpec createPodTemplateSpec(
.withPriorityClassName(template != null ? template.getPriorityClassName() : null)
.withSchedulerName(template != null && template.getSchedulerName() != null ? template.getSchedulerName() : "default-scheduler")
.withHostAliases(template != null ? template.getHostAliases() : null)
.withDnsPolicy(template != null ? template.getDnsPolicy() != null ? template.getDnsPolicy().toValue() : null : null)
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in fffc5db

@@ -402,6 +406,8 @@ public static Pod createPod(
.withPriorityClassName(template != null ? template.getPriorityClassName() : null)
.withSchedulerName(template != null && template.getSchedulerName() != null ? template.getSchedulerName() : "default-scheduler")
.withHostAliases(template != null ? template.getHostAliases() : null)
.withDnsPolicy(template != null ? template.getDnsPolicy() != null ? template.getDnsPolicy().toValue() : null : null)
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in fffc5db

gertschouten and others added 6 commits December 21, 2024 20:18
Signed-off-by: gertschouten <[email protected]>
Signed-off-by: gertschouten <[email protected]>
…el/WorkloadUtils.java

Co-authored-by: Jakub Scholz <[email protected]>
Signed-off-by: gertschouten <[email protected]>
…using the template sections

Signed-off-by: gertschouten <[email protected]>
@scholzj
Copy link
Member

scholzj commented Dec 22, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the PR.

@scholzj scholzj requested a review from ppatierno December 22, 2024 10:40
Copy link
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR! I left a couple of nits so when they are fixed I guess we can merge this.

@ppatierno
Copy link
Member

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj scholzj merged commit 039c911 into strimzi:main Dec 23, 2024
18 checks passed
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.

[Enhancement]: Nameserver
3 participants