编辑coredns的confmap
kubectl -n kube-system edit configmaps coredns
apiVersion: v1
data:
Corefile: |
.:53 {
errors
health
ready
# 添加下面
log
rewrite stop {
name regex git.boge.com gitlab.gitlab-ver130806.svc.cluster.local
# 将域名解析到默认的svc域名
answer name gitlab.gitlab-ver130806.svc.cluster.local git.boge.com
# 反向解析
}
#
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods verified
fallthrough in-addr.arpa ip6.arpa
}
autopath @kubernetes
prometheus :9153
forward . /etc/resolv.conf
cache 30
loop
reload
loadbalance
}
kind: ConfigMap
metadata:
name: coredns
namespace: kube-system