doc-exports/docs/cce/umn/cce_faq_00195.html
Dong, Qiu Jian 86fb05065f CCE UMN for 24.2.0 version -20240428
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com>
Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
2024-06-10 08:19:07 +00:00

30 lines
3.8 KiB
HTML

<a name="cce_faq_00195"></a><a name="cce_faq_00195"></a>
<h1 class="topictitle1">How Do I Optimize the Configuration If the External Domain Name Resolution Is Slow or Times Out?</h1>
<div id="body1570791416900"><p class="msonormal" id="cce_faq_00195__p55450074">The following is an example <strong id="cce_faq_00195__b268816854516">resolv.conf</strong> file for a container in a workload:</p>
<p class="msonormal" id="cce_faq_00195__p29288625"><span><img id="cce_faq_00195__image64179269" src="en-us_image_0000001897904433.png"></span></p>
<p id="cce_faq_00195__p21701752112918">In the preceding information:</p>
<ul id="cce_faq_00195__ul239438142919"><li class="msonormal" id="cce_faq_00195__li43946832912"><strong id="cce_faq_00195__b10380102854611">nameserver</strong>: IP address of the DNS. Set this parameter to the cluster IP address of CoreDNS.</li><li class="msonormal" id="cce_faq_00195__li8394085291"><strong id="cce_faq_00195__b1344924318466">search</strong>: domain name search list, which is a common suffix of Kubernetes.</li><li class="msonormal" id="cce_faq_00195__li163948815294"><strong id="cce_faq_00195__b9277144164716">ndots</strong>: If the number of dots (.) is less than the domain name, <strong id="cce_faq_00195__b04041316124711">search</strong> is preferentially used for resolution.</li><li class="msonormal" id="cce_faq_00195__li13394983299"><strong id="cce_faq_00195__b618019244473">timeout</strong>: timeout interval.</li><li class="msonormal" id="cce_faq_00195__li2394158102910"><strong id="cce_faq_00195__b20186174434719">single-request-reopen</strong>: indicates that different source ports are used to send different types of requests.</li></ul>
<p class="msonormal" id="cce_faq_00195__p56649665">By default, when you create a workload on the CCE console, the preceding parameters are configured as follows:</p>
<pre class="screen" id="cce_faq_00195__screen14990193893213"> dnsConfig:
options:
- name: timeout
value: '2'
- name: ndots
value: '5'
- name: single-request-reopen</pre>
<p id="cce_faq_00195__p027554012317">These parameters can be optimized or modified based on service requirements.</p>
<div class="section" id="cce_faq_00195__section578433103316"><h4 class="sectiontitle">Scenario 1: Slow External Domain Name Resolution</h4><p class="msonormal" id="cce_faq_00195__p1341313356336">Optimization Solution</p>
<ol id="cce_faq_00195__ol81511502334"><li class="msonormal" id="cce_faq_00195__li71585016339">If the workload does not need to access the Kubernetes Service in the cluster, see <a href="cce_faq_00194.html">How Do I Configure a DNS Policy for a Container?</a>.</li><li class="msonormal" id="cce_faq_00195__li715145003319">If the number of dots (.) in the domain name used by the working Service to access other Kubernetes Services is less than 2, set <strong id="cce_faq_00195__b1424182535214">ndots</strong> to <strong id="cce_faq_00195__b196896261523">2</strong>.</li></ol>
</div>
<div class="section" id="cce_faq_00195__section975041813336"><h4 class="sectiontitle">Scenario 2: External Domain Name Resolution Timeout</h4><p class="msonormal" id="cce_faq_00195__p1730365793312">Optimization Solution</p>
<ol id="cce_faq_00195__ol7779132153419"><li class="msonormal" id="cce_faq_00195__li777910219345">Generally, the timeout of a Service must be greater than the value of <strong id="cce_faq_00195__b1389145617520">timeout</strong> multiplied by <strong id="cce_faq_00195__b9306105895217">attempts</strong>.</li><li class="msonormal" id="cce_faq_00195__li167793217348">If it takes more than 2s to resolve the domain name, you can set <strong id="cce_faq_00195__b1975083816532">timeout</strong> to a larger value.</li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="cce_faq_00001.html">DNS FAQs</a></div>
</div>
</div>