当前位置:网站首页>[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.yaml
Description 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_IP
analysis , The stock of Pods The configuration needs to be rebuilt or modifieddnsConfig
Effective 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 kubelet
2. Then delete the deployed NodeLocal DNS Cache All the resources of :
kubectl delete -f nodelocaldns.yaml
️ Corresponding , Already used
NODE_LOCAL_DNS
Analytical stock Pods The configuration needs to be rebuilt or modifieddnsConfig
Effective after .
Reference resources
https://kubernetes.io/zh/docs/tasks/administer-cluster/nodelocaldns
边栏推荐
- 50 growers | closed door meeting of marketing circle of friends ス gathering Magic City thinking collision to help enterprise marketing growth
- Percona Toolkit series - Pt deadlock logger
- A set of very good H3C and Tianrongxin Internet cutover scheme templates, with word document download
- Popular explanation [redirection] and its practice
- What is cloud development? Why cloud development? Talk about our story
- 期货怎么开户安全些?哪些期货公司靠谱些?
- [play with Tencent cloud] my operation strategy from domain name application to website filing in Tencent cloud
- Week7 weekly report
- Fastjson 漏洞利用技巧
- Kubernetes characteristic research: sidecar containers
猜你喜欢
C. K-th not divisible by n (Mathematics + thinking) codeforces round 640 (Div. 4)
MySQL Advanced Series: Locks - Locks in InnoDB
Applet - use of template
MySQL進階系列:鎖-InnoDB中鎖的情况
Ui- first lesson
There are potential safety hazards Land Rover recalls some hybrid vehicles
Cognition and difference of service number, subscription number, applet and enterprise number (enterprise wechat)
[go] concurrent programming channel
Applet wxss
Advanced programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization
随机推荐
Use Google search like a professional
An error is reported during SVN uploading -svn sqlite[s13]
山金期货安全么?期货开户都是哪些流程?期货手续费怎么降低?
Popular explanation [redirection] and its practice
Cloud + community [play with Tencent cloud] video solicitation activity winners announced
Principle analysis of robot hardware in the loop system
Global and Chinese markets of Leyte coin exchange 2022-2028: Research Report on technology, participants, trends, market size and share
Little red book, hovering on the edge of listing
Problems encountered in the work of product manager
06. Tencent cloud IOT device side learning - Introduction to basic functions
Serial of H3CNE experiment column - VLAN configuration experiment, access and trunk
Summer Challenge harmonyos - to do list with date effect
What is a server
Recent progress of ffmpeg go
Batch BOM Bapi test
[go] runtime package for concurrent programming and its common methods
Nonholonomic constrained robot
Don't let [mana] destroy your code!
Percona Toolkit series - Pt deadlock logger
What is a reptile