当前位置:网站首页>[tke] nodelocaldnschache is used in IPVS forwarding mode
[tke] nodelocaldnschache is used in IPVS forwarding mode
2022-06-24 16:36:00 【jokey】
Use scenarios
In the cluster with Daemonset How to run NodeLocal DNS Cache Components , Can greatly improve the cluster of DNS Analytical performance , And effectively avoid conntrack The conflict triggered DNS Five second delay .
at present TKE Have already put NodeLocal DNS Cache As an enhanced component for users to install in the cluster , But at present, it is only limited to Kube-proxy The forwarding mode is Iptables Cluster installation of , In the following, the forwarding mode is IPVS How to deploy and use NodeLocal DNS Cache .
Operation steps
1. Stock node installation
1. According to the example nodelocaldns.yaml Prepare a list of resources , Save it as nodelocaldns.yaml.
2. hold nodelocaldns.yaml Change the variables in the listing to the correct values :
DNS_SERVICE="kube-dns"
DNS_CLUSTER_IP=`kubectl get svc ${DNS_SERVICE} -n kube-system -o jsonpath={.spec.clusterIP}`
CUSTOM_DOMAIN="cluster.local"
NODE_LOCAL_DNS="169.254.20.10"
sed -i "s/__PILLAR__LOCAL__DNS__/$NODE_LOCAL_DNS/g; s/__PILLAR__DNS__DOMAIN__/$CUSTOM_DOMAIN/g; s/,__PILLAR__DNS__SERVER__//g; s/__PILLAR__CLUSTER__DNS__/$DNS_CLUSTER_IP/g" nodelocaldns.yamlDescription of the replaced variable name :
DNS_CLUSTER_IP: This can be done by executingkubectl get svc <DNS_SERVICE>-n kube-system -o jsonpath={.spec.clusterIP}Command acquisition , among<DNS_SERVICE>For clusters DNS Service Service name , stay TKE In the cluster "kube-dns".CUSTOM_DOMAIN:K8S If it is not specified during cluster creation , The default value is "cluster.local".NODE_LOCAL_DNS: yes NodeLocalDNSCache Listening on the node IP Address , Direct use is recommended "169.254.20.10" IP.
3. Application deployment NodeLocal DNSCache Component resources :
kubectl create -f nodelocaldns.yaml
4. modify kubelet Parameters :
because kube-proxy Running on the IPVS Pattern , Need modification kubelet Of --cluster-dns Parameter is NodeLocal DNSCache Listening on the node NODE_LOCAL_DNS Address , All nodes in the cluster execute the following commands in turn , modify kubelet Start the parameters and restart .
NODE_LOCAL_DNS="169.254.20.10"
sed -i "/CLUSTER_DNS/c\CLUSTER_DNS=\"--cluster-dns=${NODE_LOCAL_DNS}\"" /etc/kubernetes/kubelet
systemctl restart kubelet️ NodeLocalDNSCache After the components are installed and configured, the stock is Pods Still in use
DNS_CLUSTER_IPanalysis , The stock of Pods The configuration needs to be rebuilt or modifieddnsConfigEffective after .
2. New node configuration
When the inventory node has been deployed and run NodeLocal DNS Cache When the component , To add a new node, you only need to customize the configuration kubelet Parameters --cluster-dns For the above NODE_LOCAL_DNS address , At present, the user-defined parameters need to be enabled , Contact TKE After sales students help open .
Unload resources ( cautious )
If you don't want to use this feature anymore , The unloading steps are as follows :
1. Restore pair first kubelet All changes made to the configuration ( Note the variable name ).
DNS_CLUSTER_IP=${DNS_CLUSTER_IP}
sed -i "/CLUSTER_DNS/c\CLUSTER_DNS=\"--cluster-dns=${DNS_CLUSTER_IP}\"" /etc/kubernetes/kubelet
systemctl restart kubelet2. Then delete the deployed NodeLocal DNS Cache All the resources of :
kubectl delete -f nodelocaldns.yaml
️ Corresponding , Already used
NODE_LOCAL_DNSAnalytical stock Pods The configuration needs to be rebuilt or modifieddnsConfigEffective after .
Reference resources
https://kubernetes.io/zh/docs/tasks/administer-cluster/nodelocaldns
边栏推荐
- How does easydss, an online classroom / online medical live on demand platform, separate audio and video data?
- MySQL日期时间戳转换
- Global and Chinese markets of Leyte coin exchange 2022-2028: Research Report on technology, participants, trends, market size and share
- How do HPE servers make RAID5 arrays? Teach you step by step today!
- Virtual machine virtual disk recovery case tutorial
- Recent progress of ffmpeg go
- [go] concurrent programming channel
- 国泰君安期货安全么?期货开户怎么开?期货手续费怎么降低?
- [idea] dynamic planning (DP)
- Where is the most formal and safe account opening for speculation futures? How to open a futures account?
猜你喜欢

C. Three displays codeforces round 485 (Div. 2)

Ui- first lesson
MySQL Advanced Series: locks - locks in InnoDB

Cognition and difference of service number, subscription number, applet and enterprise number (enterprise wechat)

C. Three displays(动态规划)Codeforces Round #485 (Div. 2)

Problems encountered in the work of product manager

B. Terry sequence (thinking + greed) codeforces round 665 (Div. 2)

ZOJ - 4104 sequence in the pocket

A survey on dynamic neural networks for natural language processing, University of California
MySQL進階系列:鎖-InnoDB中鎖的情况
随机推荐
TRTC web end imitation Tencent conference microphone mute detection
Transpose convolution explanation
Inter thread communication of embedded development foundation
How to open a futures account safely? Which futures companies are more reliable?
Greenplum role-based fine-grained permission control
Some experiences of K project: global template highlights
What can Lu yuanjiu Jiao buy?
Several characteristics of pharmaceutical industry
Is Guotai Junan Futures safe? How to open a futures account? How to reduce the futures commission?
Principle analysis of robot hardware in the loop system
2021-05-03: given a non negative integer num, how to avoid circular statements,
If only 2 people are recruited, can the enterprise do a good job in content risk control?
50 growers | closed door meeting of marketing circle of friends ス gathering Magic City thinking collision to help enterprise marketing growth
How to use the national standard streaming media server to view the video stream of the surveillance camera? How to correctly use UDP and TCP protocols?
A memory leak caused by timeout scheduling of context and goroutine implementation
炒期货在哪里开户最正规安全?怎么期货开户?
MySQL Advanced Series: Locks - Locks in InnoDB
找出隐形资产--利用Hosts碰撞突破边界
How does the effective date of SAP PP ECM affect the work order?
How to pop up an alarm through the national standard gb28181 protocol video platform easygbs for mobile detection / perimeter intrusion detection video recording