kubernetes常见问题持续更新

1、关于coreDNS和公司内部dns打通问题

1.1 修改ConfigMap

---
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
        }
        prometheus :9153
        #注释代码
        #forward . /etc/resolv.conf {
         #  max_concurrent 1000
        #}
        #此处是公司内部的dns地址
        forward . 192.168.0.253 192.168.0.254 {
           prefer_udp
        }
        cache 30
        loop
        reload
        loadbalance
    }
kind: ConfigMap
metadata:
  name: coredns
  namespace: kube-system

1.2 批量执行yaml

## 有文件夹的情况下
# apply
for i in $(ls ./); do  cd ./$i && kubectl apply -f . && cd .. ; done
# delete 
for i in $(ls ./); do  cd ./$i && kubectl delete -f . && cd .. ; done

## 无文件夹的情况下
# apply
kubectl apply -f .
# delete 
kubectl delete -f .

猜你喜欢

转载自blog.csdn.net/helenyqa/article/details/129707788