# coredns forward
在k8s 中 依賴coredns 做service name 服務的DNS 解析。在實際生產中如果有我們的服務依賴自己的私有私有域名(.aliyun.ftc.dianrong.io) 可在coredns 添加轉發功能,由自建Bind 完成DNDS 域名解析。
### 修改coredns configmap
cat coredns-config.yml
---
apiVersion: v1
kind: ConfigMap
metadata:
name: coredns
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: EnsureExists
data:
Corefile: |
.:53 {
errors
health
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream /etc/resolv.conf
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
proxy . /etc/resolv.conf
cache 30
}
.aliyun.ftc.dianrong.io {
forward . 10.34.11.10
}
### kubernetes 1.14.X
---
apiVersion: v1
kind: ConfigMap
metadata:
name: coredns
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: EnsureExists
data:
Corefile: |
.:53 {
errors
health
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
upstream 172.16.20.132 172.16.20.133 # /etc/resolv.conf 文件修改成上游dns 地址
fallthrough in-addr.arpa ip6.arpa
}
prometheus :9153
proxy . 172.16.20.132 172.16.20.133 # /etc/resolv.conf 文件修改成上游dns 地址
cache 30
loop
reload
loadbalance
}
參考文檔
[k8s官方文檔 dns 轉發策略說明](https://kubernetes.io/cn/docs/tasks/administer-cluster/dns-custom-nameservers/)
[coredns forward 官方文檔](https://coredns.io/explugins/forward/)
- 方案設計
- 使用kubespray部署k8s集群
- 使用ingress 訪問dashboard v1.8.3
- 在 Kubernetes 中配置私有 DNS 和上游域名服務器(coredns forward)
- master 節點添加taint
- limitrang
- 配置私有倉庫
- 利用NFS動態提供Kubernetes后端存儲卷
- ingress 添加https 客戶端雙向認證
- 應用日采集
- eureka 遷移 k8s 集群
- 鏡像下載地址
- helm install
- Install istio
- zookeeper 集群部署
- 基于prometheus自定義rabbitmq—exporter指標HPA彈性伸縮
- nacos huaweicloud