首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >K8s:如何在尝试访问集群外的某个域名时更改pod的名称服务器

K8s:如何在尝试访问集群外的某个域名时更改pod的名称服务器
EN

Stack Overflow用户
提问于 2019-05-29 02:18:25
回答 1查看 426关注 0票数 0

由于某些原因,4.2.1,208.67.220.220这样的域名服务器在中国并不是最好的选择。当pod尝试解析群集外部的域时,守护进程set nodelocaldns会报告解析域名的i/o超时

代码语言:javascript
复制
[ERROR] plugin/errors: 2 checkpoint-api.hashicorp.com. A: read udp 192.168.1.15:35630->4.2.2.1:53: i/o timeout
[ERROR] plugin/errors: 2 checkpoint-api.hashicorp.com. AAAA: read udp 192.168.1.15:37137->4.2.2.2:53: i/o timeout

我在configmap中修改了coredns的核心文件,以使用另一个名称服务器114.114.114.114,但没有效果。

代码语言:javascript
复制
---
kind: ConfigMap
apiVersion: v1
metadata:
  name: coredns
  namespace: kube-system
  selfLink: "/api/v1/namespaces/kube-system/configmaps/coredns"
  uid: 844355d4-7dd3-11e9-ab0b-0800274131a7
  resourceVersion: '919'
  creationTimestamp: '2019-05-24T03:25:02Z'
  labels:
    addonmanager.kubernetes.io/mode: EnsureExists
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: '{"apiVersion":"v1","data":{"Corefile":".:53
      {\n    errors\n    health\n    kubernetes cluster.local in-addr.arpa ip6.arpa
      {\n      pods insecure\n      upstream /etc/resolv.conf\n      fallthrough in-addr.arpa
      ip6.arpa\n    }\n    prometheus :9153\n    forward . /etc/resolv.conf\n    cache
      30\n    loop\n    reload\n    loadbalance\n}\n"},"kind":"ConfigMap","metadata":{"annotations":{},"labels":{"addonmanager.kubernetes.io/mode":"EnsureExists"},"name":"coredns","namespace":"kube-system"}}

'
data:
  Corefile: |
    .:53 {
        errors
        health
        kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          upstream 114.114.114.114
          fallthrough in-addr.arpa ip6.arpa
        }
        prometheus :9153
        forward . 114.114.114.114
        cache 30
        loop
        reload
        loadbalance
    }
    consul:53 {
        errors
        cache 30
        forward . 10.233.5.74
}

那么我错过了哪些配置呢?

EN

回答 1

Stack Overflow用户

发布于 2019-05-29 08:52:56

您可以在here中找到相关信息。更准确地说:

代码语言:javascript
复制
proxy .  172.16.0.1
upstream 172.16.0.1
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56347982

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档