标签:href 计算机 版本 image exe man ide dom ada
[toc]安装DNS后,pod就可以通过dns来解析service,从而实现通信
kubernetes 版本:
kubectl version
我当前的版本是1.9.0
https://github.com/kubernetes/kubernetes
具体路径是cluster/addons/dns/kube-dns
可能版本不一样,路径略有不同
该路径下有三个相似的配置文件:
kube-dns.yaml.base
kube-dns.yaml.in
kube-dns.yaml.sed
在此,我们使用kube-dns.yaml.sed配置文件作为模板;
将kube-dns.yaml.sed配置文件,拷贝到k8s集群所在的某个服务器中
kubectl create -f kube-dns.yaml
配置文件curl.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: curl
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
app: curl
spec:
containers:
- name: curl
image: appropriate/curl
command: ["sleep"]
args: ["5000"]
---
apiVersion: v1
kind: Service
metadata:
name: curl
namespace: kube-system
labels:
app: curl
spec:
type: ClusterIP
selector:
app: curl
ports:
- port: 80
targetPort: 80
name: http
protocol: TCP
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: tools-dns
namespace: default
spec:
replicas: 1
template:
metadata:
labels:
app: tools-dns
spec:
containers:
- name: tools-dns
image: tutum/dnsutils:latest
command: ["sleep"]
args: ["5000"]
kubectl get pod
kubectl exec -it tools-dns-5665d49688-8jrnw /bin/bash
查看A记录(就是地址记录IPv4)
1、 如果发现镜像有问题的话,需要更新镜像,
如“k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.10” 改成“ index.tenxcloud.com/jimmy/k8s-dns-dnsmasq-nanny-amd64:1.14.1”
将"k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.10" 改成"index.tenxcloud.com/jimmy/k8s-dns-sidecar-amd64:1.14.1"
将" k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.10" 替换为"index.tenxcloud.com/jimmy/k8s-dns-kube-dns-amd64:1.14.1
2、如果发现"Liveness probe failed: Get http://172.17.97.2:10054/healthcheck/kubedns: dial tcp 172.17.97.2:10054: getsockopt: connection refused"问题,需要将"SRV"改成"A"
参考文献:
https://blog.csdn.net/kozazyh/article/details/79443852
标签:href 计算机 版本 image exe man ide dom ada
原文地址:http://blog.51cto.com/xingej/2130490