当前位置:网站首页>[tke] modify the cluster corendns service address
[tke] modify the cluster corendns service address
2022-06-24 16:16:00 【jokey】
Use scenarios
TKE Medium Coredns service IP At present, there is no way to specify when creating a cluster , It is configured from the customer by default Service CIDR A random... Is assigned to the network segment IP, The following describes how to customize and modify Coredns service IP.
Prerequisite
- In configuration service CIDR Select a network segment that is not currently used in the cluster IP
- Inventory in the cluster Pods It is acceptable to be rebuilt .
Operation steps
1. modify kubelet Launch parameters First, go to the stock node to modify kubelet In profile --cluster-dns The parameter is new Cluster IP And restart kubelet, The operation command is as follows :
DNS_CLUSTER_IP=xxx.xxx.xxx.xxx
sed -i "/CLUSTER_DNS/c\CLUSTER_DNS=\"--cluster-dns=${DNS_CLUSTER_IP}\"" /etc/kubernetes/kubelet
systemctl restart kubelet2. Rebuild specifies a new ClusterIP Of Coredns Of Service resources
because .spec.clusterIP Fields are not modifiable , So you must delete the original Service resources :
kubectl delete svc kube-dns -n kube-system
And then recreate Service kube-dns, The following can be modified and applied according to the requirements YAML The reconstruction :
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/port: "9153"
prometheus.io/scrape: "true"
labels:
addonmanager.kubernetes.io/mode: Reconcile
kubernetes.io/cluster-service: "true"
kubernetes.io/name: CoreDNS
name: kube-dns
namespace: kube-system
spec:
clusterIP: xxx.xxx.xxx.xxx # The service you want to specify IP
ports:
- name: dns-tcp
port: 53
protocol: TCP
targetPort: 53
- name: dns
port: 53
protocol: UDP
targetPort: 53
selector:
k8s-app: kube-dns
sessionAffinity: None
type: ClusterIP3. Rebuild all the stocks in the cluster Pods
because kubelet Use --cluster-dns=<DNS service IP> The logo will DNS The parser information is passed to each container , So stock Pods It needs to be rebuilt and updated to the new Cluster IP, Use the normal delete command :
kubectl delete pod --all --all-namespaces
4. Specify... When creating a new node kubelet Parameters
When creating a new node, you can specify through the function of user-defined parameters kubelet In profile --cluster-dns Parameters , However, at present, you need to contact the after-sales students to open a white list, which can be configured on the console .
reminder : because Coredns Pods A special , stay Coredns When created, the container /etc/resolv.conf The default is to inherit from the same path of the current node Dnsservers To configure , Can't use kubelet Parameter , And it won't follow watch And synchronization nodes /etc/resolv.conf Changes to the contents of , Therefore, the configuration on the node needs to be rebuilt after modification coredns Pods Update new configuration .
边栏推荐
- C. K-th not divisible by n (Mathematics + thinking) codeforces round 640 (Div. 4)
- Understanding of deep separable convolution, block convolution, extended convolution, transposed convolution (deconvolution)
- Istio FAQ: return 426 status code
- #夏日挑战赛# HarmonyOS - 实现带日期效果的待办事项
- C. K-th Not Divisible by n(数学+思维) Codeforces Round #640 (Div. 4)
- 存在安全隐患 部分冒险家混动版将召回
- 【附下载】汉化版Awvs安装与简单使用
- Istio FAQ: region awareness does not take effect
- Summary of common tools and usage
- I just came back from the Ali software test. I worked for Alibaba P7 in 3+1, with an annual salary of 28*15
猜你喜欢

B. Terry sequence (thinking + greed) codeforces round 665 (Div. 2)
![[download attached] installation and simple use of Chinese version of awvs](/img/3b/f26617383690c86edff465c9a1099e.png)
[download attached] installation and simple use of Chinese version of awvs

My network relationship with "apifox"
![[application recommendation] the hands-on experience and model selection suggestions of apifox & apipost in the recent fire](/img/dd/24df91a8a1cf1f1b9ac635abd6863a.png)
[application recommendation] the hands-on experience and model selection suggestions of apifox & apipost in the recent fire

一文详解JackSon配置信息

I just came back from the Ali software test. I worked for Alibaba P7 in 3+1, with an annual salary of 28*15

Cap: multiple attention mechanism, interesting fine-grained classification scheme | AAAI 2021

ZOJ - 4104 sequence in the pocket

使用阿里云RDS for SQL Server性能洞察优化数据库负载-初识性能洞察

一文理解OpenStack网络
随机推荐
基于STM32的MD5校验
Istio FAQ: virtualservice route matching sequence
Detailed explanation of transpose convolution in pytorch
打破内存墙的新利器成行业“热搜”!持久内存让打工人也能玩转海量数据+高维模型
How to obtain ECS metadata
2021-04-27: if the adjacent position of a character does not have the same character
A memory leak caused by timeout scheduling of context and goroutine implementation
构建Go命令行程序工具链
Implement Domain Driven Design - use ABP framework - domain logic & application logic
2021-05-02: given the path of a file directory, write a function
Cap: multiple attention mechanism, interesting fine-grained classification scheme | AAAI 2021
[interview high frequency questions] sequential DP questions with difficulty of 3/5 and direct construction
How to easily realize online karaoke room and sing "mountain sea" with Wang Xinling
[application recommendation] the hands-on experience and model selection suggestions of apifox & apipost in the recent fire
[my advanced OpenGL learning journey] learning notes of OpenGL coordinate system
Global and Chinese markets of natural insect repellents 2022-2028: Research Report on technology, participants, trends, market size and share
2021-04-22: given many line segments, each line segment has two numbers [start, end],
Little red book, hovering on the edge of listing
MySQL Innodb和Myisam
Find out the invisible assets -- use hosts collision to break through the boundary