Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support more DNS search paths #5198

@gjkim42

Description

@gjkim42

Description

kubernetes issue: kubernetes/kubernetes#104352

cri-o does not allow DnsConfig to have more than 6 search paths. However, modern libcs allow more search paths(many are unlimited)

According to https://man7.org/linux/man-pages/man5/resolv.conf.5.html,

In glibc 2.25 and earlier, the search list is limited to
six domains with a total of 256 characters.  Since glibc
2.26, the search list is unlimited.

Steps to reproduce the issue:

  1. Launch kubernetes v1.22.0 with enabling the feature gate ExpandedDNSConfig
  2. Create a pod with 7 search paths
apiVersion: v1
kind: Pod 
metadata:
  creationTimestamp: null
  labels:
    run: test
  name: test
spec:
  containers:
  - args:
    - sleep
    - "3600"
    image: ubuntu
    name: test
    resources: {}
  dnsConfig:
    searches:
    - 1.com
    - 2.com
    - 3.com
    - 4.com
    - 5.com
    - 6.com
    - 7.com
  dnsPolicy: ClusterFirst
  restartPolicy: Always
status: {}

Describe the results you received:

$ kubectl describe pods test
...
Events:
  Type     Reason                  Age               From     Message
  ----     ------                  ----              ----     -------
  Warning  FailedCreatePodSandBox  6s (x5 over 45s)  kubelet  Failed to create pod sandbox: rpc error: code = Unknown desc = DNSOption.Searches has more than 6 domains

Describe the results you expected:

The pod should run successfully.

Additional information you deem important (e.g. issue happens only occasionally):

Output of crio --version:

$ crio --version
WARN[0000] Encountered error detecting link mode of binary:  
WARN[0000] Encountered error detecting link mode of binary:  
crio version 1.22.0
Version:       1.22.0
GitCommit:     78f06f200a544ec3be594d58a37d247f822c1946
GitTreeState:  dirty
BuildDate:     1980-01-01T00:00:00Z
GoVersion:     go1.16.6
Compiler:      gc
Platform:      linux/amd64
Linkmode:      unknown

Additional environment details (AWS, VirtualBox, physical, etc.):

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions