winkingzou 2019-10-06 00:05 采纳率: 80%
浏览 1227
已采纳

k8s的dns解析不到问题,安装redis时nslookup redis-app-0.redis-service错误

其它redis服务及dns等启动正常,redis的service等配置检查了好几遍也没什么问题,但是这里dns就是解析不到,请大神帮忙解答一下!

[k8s@centos01 kubernetes-dashboard]$ kubectl run -i --tty --image busybox dns-test --restart=Never --rm /bin/sh
If you don't see a command prompt, try pressing enter.
/ # nslookup redis-app-0.redis-service
Server: 10.96.0.10
Address: 10.96.0.10:53

** server can't find redis-app-0.redis-service: NXDOMAIN

*** Can't find redis-app-0.redis-service: No answer

[k8s@centos01 kubernetes-dashboard]$ kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-5c98db65d4-sjmp5 1/1 Running 10 18d
coredns-5c98db65d4-v9zfs 1/1 Running 10 18d
etcd-centos01 1/1 Running 13 18d
kube-apiserver-centos01 1/1 Running 15 18d
kube-controller-manager-centos01 1/1 Running 15 18d
kube-flannel-ds-amd64-cc9nc 1/1 Running 16 18d
kube-flannel-ds-amd64-hzvxc 1/1 Running 9 18d
kube-flannel-ds-amd64-l48zg 1/1 Running 9 18d
kube-proxy-8r2rj 1/1 Running 11 18d
kube-proxy-gbvr8 1/1 Running 9 18d
kube-proxy-m85wg 1/1 Running 9 18d
kube-scheduler-centos01 1/1 Running 14 18d
kubernetes-dashboard-f4f9ff989-blfkh 1/1 Running 9 17d

[k8s@centos01 kubernetes-dashboard]$ kubectl get pods
NAME READY STATUS RESTARTS AGE
centos 0/1 Error 0 11d
redis-app-0 1/1 Running 2 11d
redis-app-1 1/1 Running 2 11d
redis-app-2 1/1 Running 2 11d
redis-app-3 1/1 Running 2 11d
redis-app-4 1/1 Running 2 11d
redis-app-5 1/1 Running 2 11d

[k8s@centos01 kubernetes-dashboard]$ kubectl describe pod redis-app-0
Name: redis-app-0
Namespace: default
Priority: 0
Node: centos03/192.168.1.122
Start Time: Tue, 24 Sep 2019 22:14:38 +0800
Labels: app=redis
appCluster=redis-cluster
controller-revision-hash=redis-app-6f44c78fbb
statefulset.kubernetes.io/pod-name=redis-app-0
Annotations:
Status: Running
IP: 10.244.2.30
Controlled By: StatefulSet/redis-app
Containers:
redis:
Container ID: docker://dd48411a225592fc743385ec73aafde6aa4365abd560ba1bcec008cee9fc1a55
Image: redis
Image ID: docker-pullable://redis@sha256:cb379e1a076fcd3d3f09e10d7b47ca631fb98fb33149ab559fa02c1b11436345
Ports: 6379/TCP, 16379/TCP
Host Ports: 0/TCP, 0/TCP
Command:
redis-server
Args:
/etc/redis/redis.conf
--protected-mode
no
State: Running
Started: Sat, 05 Oct 2019 23:39:27 +0800
Last State: Terminated
Reason: Error
Exit Code: 255
Started: Wed, 25 Sep 2019 07:52:46 +0800
Finished: Sat, 05 Oct 2019 16:48:50 +0800
Ready: True
Restart Count: 2
Requests:
cpu: 100m
memory: 100Mi
Environment:
Mounts:
/etc/redis from redis-conf (rw)
/var/lib/redis from redis-data (rw)
/var/run/secrets/kubernetes.io/serviceaccount from default-token-9lbbk (ro)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
redis-data:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: redis-data-redis-app-0
ReadOnly: false
redis-conf:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: redis-conf
Optional: false
default-token-9lbbk:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-9lbbk
Optional: false
QoS Class: Burstable
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message


Warning FailedMount 10d kubelet, centos03 MountVolume.SetUp failed for volume "redis-conf" : couldn't propagate object cache: timed out waiting for the condition
Warning FailedMount 10d kubelet, centos03 MountVolume.SetUp failed for volume "default-token-9lbbk" : couldn't propagate object cache: timed out waiting for the condition

  • 写回答

1条回答 默认 最新

  • dabocaiqq 2019-10-06 09:39
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 已采纳回答 3月17日

悬赏问题

  • ¥15 生成的QRCode圖片加上下載按鈕
  • ¥15 板材切割优化算法,数学建模,python,lingo
  • ¥15 科来模拟ARP欺骗困惑求解
  • ¥100 iOS开发关于快捷指令截屏后如何将截屏(或从截屏中提取出的文本)回传给本应用并打开指定页面
  • ¥15 unity连接Sqlserver
  • ¥15 图中这种约束条件lingo该怎么表示出来
  • ¥15 VSCode里的Prettier如何实现等式赋值后的对齐效果?
  • ¥15 流式socket文件传输答疑
  • ¥20 keepalive配置业务服务双机单活的方法。业务服务一定是要双机单活的方式
  • ¥50 关于多次提交POST数据后,无法获取到POST数据参数的问题