Repository navigation
Add dns ports to the master service - #5094
Conversation
There was a problem hiding this comment.
only do this if the master is configured to be a DNS server (options.DNSConfig != nil, I think)
d43be15 to
017e61f
Compare
|
@liggitt PTAL |
There was a problem hiding this comment.
shouldn't we be using the port from DNSConfig.BindAddress? It is typically port 53, but not in some integration test scenarios (like test/integration/dns_test.go)
There was a problem hiding this comment.
should there be an integration test added for this to dns_test.go?
fcd2e0b to
b303ee4
Compare
|
@liggitt Something like this ☝️ ? |
There was a problem hiding this comment.
don't swallow the error?... not sure what 0 would do here
There was a problem hiding this comment.
@liggitt similar message as the first error or is there a better way to chain the splithostport and strconv?
There was a problem hiding this comment.
Or some catch all "unexpected error"
|
@liggitt went with "invalid DNS port" |
There was a problem hiding this comment.
Append your ports, don't stomp in case anything was already added
|
@liggitt Appended |
There was a problem hiding this comment.
m.ExtraServicePorts = append(m.ExtraServicePorts,
{Name: "dns", Port: dnsPort, Protocol: kapi.ProtocolUDP, TargetPort: util.NewIntOrStringFromInt(dnsPort)},
{Name: "dns-tcp", Port: dnsPort, Protocol: kapi.ProtocolTCP, TargetPort: util.NewIntOrStringFromInt(dnsPort)},
)
There was a problem hiding this comment.
Each will need type but I've changed it to
m.ExtraServicePorts = append(m.ExtraServicePorts,
kapi.ServicePort{Name: "dns", Port: dnsPort, Protocol: kapi.ProtocolUDP, TargetPort: util.NewIntOrStringFromInt(dnsPort)},
kapi.ServicePort{Name: "dns-tcp", Port: dnsPort, Protocol: kapi.ProtocolTCP, TargetPort: util.NewIntOrStringFromInt(dnsPort)},
)
m.ExtraEndpointPorts = append(m.ExtraEndpointPorts,
kapi.EndpointPort{Name: "dns", Port: dnsPort, Protocol: kapi.ProtocolUDP},
kapi.EndpointPort{Name: "dns-tcp", Port: dnsPort, Protocol: kapi.ProtocolTCP},
)
There was a problem hiding this comment.
you need to recreate the stop channel... the block above closes it, right?
There was a problem hiding this comment.
|
[test] |
There was a problem hiding this comment.
s/MASTER_IP/MASTER_SERVICE_IP/
fff4149 to
66b43ed
Compare
|
@liggitt think we got it nailed down 🔨 |
There was a problem hiding this comment.
DNSConfig.BindAddress won't be meaningful to them, since that's not what the config field is named. What about unable to parse DNS bind address %s: %v", options.DNSConfig.BindAddress, err)
|
what's here looks ok... wondering how this connects to the |
|
Where are we on this? |
There was a problem hiding this comment.
@smarterclayton, if they specified a port named "dns" on port 53, should we even ping it or just use it?
There was a problem hiding this comment.
Failing to ping 53 will fall back to the endpoint which is what we want without sdn?
There was a problem hiding this comment.
Just use it
On Oct 29, 2015, at 8:00 AM, Jordan Liggitt [email protected]
wrote:
In pkg/cmd/server/kubernetes/node.go
#5094 (comment):
@@ -126,17 +126,29 @@ func (c *NodeConfig) initializeVolumeDir(ce commandExecutor, path string) (strin
// RunKubelet starts the Kubelet.
func (c *NodeConfig) RunKubelet() {
- // TODO: clean this up and make it more formal (service named 'dns'?). Use multiple ports.
- clusterDNS := c.KubeletConfig.ClusterDNS
- if clusterDNS == nil {
if service, err := c.Client.Endpoints(kapi.NamespaceDefault).Get("kubernetes"); err == nil {if ip, ok := firstIP(service, 53); ok {if err := cmdutil.WaitForSuccessfulDial(false, "tcp", fmt.Sprintf("%s:%d", ip, 53), 50*time.Millisecond, 0, 2); err == nil {c.KubeletConfig.ClusterDNS = net.ParseIP(ip)- if c.KubeletConfig.ClusterDNS == nil {
// Set ClusterDNS to "kubernetes" master service ip if port 53/tcp can be successfully dialedif service, err := c.Client.Services(kapi.NamespaceDefault).Get("kubernetes"); err == nil {if includesServicePort(service.Spec.Ports, 53, "dns-tcp") {serviceIP := service.Spec.ClusterIPif err := cmdutil.WaitForSuccessfulDial(false, "tcp", fmt.Sprintf("%s:%d", serviceIP, 53), 50*time.Millisecond, 0, 2); err == nil {
@smarterclayton https://github.com/smarterclayton, if they specified a
port named "dns" on port 53, should we even ping it or just use it?
—
Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/5094/files#r43376225.
There was a problem hiding this comment.
Failing to ping 53 will fall back to the endpoint which is what we want without sdn?
Won't port 53 through the service work without SDN?
Just use it
In that case, switch from checking "dns-tcp" to "dns"
There was a problem hiding this comment.
I could see keeping the existing fallback to use port 53 on the kubernetes endpoint (regardless of name) if we can ping it. So the priority order would be:
- configured dns ip
- specified "dns" port 53 for service (no ping test)
- specified "dns" port 53 for endpoint (no ping test)
- any named port 53 for endpoint (ping test)
There was a problem hiding this comment.
- configured dns ip
- specified "dns" port 53 for service (no ping test)
- specified "dns" port 53 for endpoint (no ping test)
- any named port 53 for endpoint (ping test)
We'll need to test 2 & 3 to fallback to 4?
There was a problem hiding this comment.
Why? If they configured a dns port in the service, trust it. We don't ping the IP from the config, do we?
|
cherry pick kubernetes/kubernetes#15791 into this as well? |
|
@liggitt Updated the priority of |
|
squash non-upstream commits |
|
origin changes lgtm |
|
Squashed and replaced upstream commit |
|
[test] |
|
flake: [test] |
|
Evaluated for origin test up to ec21c22 |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/6385/) |
|
[merge] |
|
Evaluated for origin merge up to ec21c22 |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/6385/) (Image: devenv-rhel7_2606) |
Merged by openshift-bot
Provides a load balanced endpoint for dns in a clustered environment via the master service. Relies on #5046.