k8 流水线 缺少maven 依赖包 coredns加域名解析

2023-12-13 05:54:52

?在k8s 里面加域名解析hosts

kubectl edit configmap coredns -n kube-system

apiVersion: v1
data:
  Corefile: |
    .:53 {
        errors
        health {
           lameduck 5s
        }
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
           pods insecure
           fallthrough in-addr.arpa ip6.arpa
           ttl 30
        }
        hosts {
         182.92.29.16  maven.aliyun.com
         211.154.222.157  archiva-maven-storage-prod.oss-cn-beijing.aliyuncs.com
         59.110.190.73  oss-cn-beijing.aliyuncs.com
         fallthrough
        }
        prometheus :9153
        cache 30
        loop
        reload
        loadbalance
    }
kind: ConfigMap
metadata:
  creationTimestamp: "2023-04-13T02:27:14Z"
  name: coredns
  namespace: kube-system
  resourceVersion: "160191242"
  uid: bb9bce1e-6ef5-4b3c-8530-f6105cbea464

  这些解析域名的IP如何来的呢:

[root@node01 tmp]# ping maven.aliyun.com
PING tyjr-common-cn-beijing.aliyun.com.vipgds.alibabadns.com (182.92.29.16) 56(84) bytes of data.
64 bytes from 182.92.29.16 (182.92.29.16): icmp_seq=1 ttl=87 time=21.5 ms
64 bytes from 182.92.29.16 (182.92.29.16): icmp_seq=2 ttl=87 time=21.3 ms

[root@master01 ~]# ping archiva-maven-storage-prod.oss-cn-beijing.aliyuncs.com
PING archiva-maven-storage-prod.oss-cn-beijing.aliyuncs.com.gds.alibabadns.com (211.154.222.157) 56(84) bytes of data.
64 bytes from 211.154.222.157 (211.154.222.157): icmp_seq=1 ttl=83 time=20.2 ms
64 bytes from 211.154.222.157 (211.154.222.157): icmp_seq=2 ttl=83 time=20.0 ms
64 bytes from 211.154.222.157 (211.154.222.157): icmp_seq=3 ttl=83 time=20.0 ms
^C
--- archiva-maven-storage-prod.oss-cn-beijing.aliyuncs.com.gds.alibabadns.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 20.076/20.130/20.236/0.074 ms
[root@master01 ~]# ping oss-cn-beijing.aliyuncs.com
PING oss-cn-beijing.aliyuncs.com (59.110.190.79) 56(84) bytes of data.
64 bytes from 59.110.190.79 (59.110.190.79): icmp_seq=1 ttl=87 time=42.8 ms

文章来源:https://blog.csdn.net/epmgy315/article/details/134944194
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。