winkingzou 2019-10-06 00:05 采纳率: 100%
浏览 1214
已采纳

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条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      问题事件

      • 已采纳回答 3月17日

      悬赏问题

      • ¥20 有ASP .NET MVC做的小说阅读网站吗?
      • ¥20 beeline客户端支持ipv6地址连接hive服务
      • ¥15 香农解码的代码问题,无法输出解码结果
      • ¥15 Python操作注册表
      • ¥45 入门级别的一段VUE前端拍照像后端发送请求的代码,帮排错
      • ¥15 anaconda打开spyder后一直闪退,不知道怎么办
      • ¥15 解决迷宫问题中无法运行的问题
      • ¥15 关于aspnetcore中使用mqttnet库的entire
      • ¥15 关于#python#的问题,请各位专家解答!
      • ¥100 关于远控软件的两个问题