wangyang0918 commented on code in PR #20982:
URL: https://github.com/apache/flink/pull/20982#discussion_r1003093842
##########
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/utils/KubernetesUtils.java:
##########
@@ -487,6 +489,22 @@ public static <T> String resolveUserDefinedValue(
return resolvedValue;
}
+ /**
+ * Resolve the DNS policy defined value. First check if there is a DNS
Policy override in
+ * PodTemplate, if not, check if host network is enabled.
+ *
+ * @param dnsPolicy DNS Policy defined in PodTemplate spec
+ * @param hostNetworkEnabled Host Network enabled
+ * @return the resolved value
+ */
+ public static String resolveDNSPolicy(String dnsPolicy, boolean
hostNetworkEnabled) {
Review Comment:
Given that the Flink configuration options have a higher priority, I think
`DNS_POLICY_HOSTNETWORK` need to be used if the host network enabled by
`kubernetes.hostnetwork.enabled` explicitly.
The resolving order could be as following.
1. Set to `DNS_POLICY_HOSTNETWORK` if configured via
`kubernetes.hostnetwork.enabled: true` explicitly
2. The value configured via the pod template
3. The default `DNS_POLICY_DEFAULT `
And we need a test to guard this behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]