Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [osboxes@kubemaster pods]$ kubectl get pods -o wide
- NAME READY STATUS RESTARTS AGE IP NODE
- busybox 1/1 Running 0 3m 172.17.60.3 192.168.6.103
- mongodb 1/1 Running 0 21m 172.17.60.2 192.168.6.103
- [osboxes@kubemaster pods]$ kubectl get services -o wide
- NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
- kubernetes 10.254.0.1 <none> 443/TCP 17d <none>
- mongoservice 10.254.244.175 <none> 27017/TCP 47m name=mongodb
- [osboxes@kubemaster pods]$ kubectl describe svc mongoservice
- Name: mongoservice
- Namespace: default
- Labels: name=mongoservice
- Selector: name=mongodb
- Type: ClusterIP
- IP: 10.254.244.175
- Port: <unset> 27017/TCP
- Endpoints: 172.17.60.2:27017
- Session Affinity: None
- 8707a465771b busybox "sh" 9 minutes ago Up 9minutes k8s_busybox.53e510d6_busybox_default_c4892314-cde3-11e6-8a53-08002700df07_492b1a89
- bea9de4e05cf registry.access.redhat.com/rhel7/pod-infrastructure:latest "/pod" 9 minutes ago Up 9 minutes k8s_POD.ae8ee9ac_busybox_default_c4892314-cde3-11e6-8a53-08002700df07_2bffae46
- eaff8dc1a360 mongo "/entrypoint.sh mongo" 28 minutes ago Up 28 minutes k8s_mongodb.d1eca71a_mongodb_default_240cd411-cde1-11e6-8a53-08002700df07_ef5a8bbe
- 6a90b06cd434 registry.access.redhat.com/rhel7/pod-infrastructure:latest "/pod" 28 minutes ago Up 28 minutes k8s_POD.7ce0ec0_mongodb_default_240cd411-cde1-11e6-8a53-08002700df07_11074b20
- [osboxes@kubemaster pods]$ sudo kubectl run -i --tty busybox --image=busybox --generator="run-pod/v1"
- Waiting for pod default/busybox to be running, status is Pending, pod ready: false
- Waiting for pod default/busybox to be running, status is Pending, pod ready: false
- If you don't see a command prompt, try pressing enter.
- Error attaching, falling back to logs: dial tcp 192.168.6.103:10250: getsockopt: connection refused
- Error from server: Get https://192.168.6.103:10250/containerLogs/default/busybox/busybox: dial tcp 192.168.6.103:10250: getsockopt: connection refused
- [osboxes@kubemaster pods]$ curl 172.17.60.2:27017
- curl: (7) Failed connect to 172.17.60.2:27017; No route to host
- [osboxes@kubemaster pods]$ curl 10.254.244.175:27017
- curl: (7) Failed connect to 10.254.244.175:27017; Connection timed out
- [osboxes@kubemaster pods]$ kubectl exec -ti mongodb -c k8s_mongodb.d1eca71a_mongodb_default_240cd411-cde1-11e6-8a53-08002700df07_ef5a8bbe sh
- Error from server: container k8s_mongodb.d1eca71a_mongodb_default_240cd411-cde1-11e6-8a53-08002700df07_ef5a8bbe is not valid for pod mongodb
- [osboxes@kubemaster pods]$ kubectl exec -ti mongodb -c k8s_POD.7ce0ec0_mongodb_default_240cd411-cde1-11e6-8a53-08002700df07_11074b20 sh
- Error from server: container k8s_POD.7ce0ec0_mongodb_default_240cd411-cde1-11e6-8a53-08002700df07_11074b20 is not valid for pod mongodb
- [osboxes@kubemaster pods]$ kubectl exec -ti mongodb sh
- Error from server: dial tcp 192.168.6.103:10250: getsockopt: connection refused
- [osboxes@kubemaster pods]$ kubectl describe svc mongoservice
- Name: mongoservice
- Namespace: default
- Labels: name=mongoservice
- Selector: name=mongodb
- Type: ClusterIP
- IP: 10.254.244.175
- Port: <unset> 27017/TCP
- Endpoints: 172.17.60.2:27017
- Session Affinity: None
- [osboxes@kubemaster pods]$ curl 172.17.60.2:27017
- curl: (7) Failed connect to 172.17.60.2:27017; No route to host
- kubectl expose service mongoservice --port=27017 --type=NodePort
- Name: mongo-4025718836
- Namespace: default
- Labels: pod-template-hash=4025718836
- run=mongo
- Selector: pod-template-hash=4025718836,run=mongo
- Type: NodePort
- IP: 10.0.0.11
- Port: <unset> 27017/TCP
- NodePort: <unset> 32076/TCP
- Endpoints: 172.17.0.9:27017
- Session Affinity: None
- curl NODE:32076
- It looks like you are trying to access MongoDB over HTTP on the native driver port.
- #KUBELET_ADDRESS="--address=127.0.0.1"
- KUBELET_ADDRESS="--address=0.0.0.0"
- curl 10.254.39.156:27017
- It looks like you are trying to access MongoDB over HTTP on the native driver port.
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- 0.0.0.0 192.168.6.1 0.0.0.0 UG 100 0 0 enp0s3
- 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
- 192.168.6.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
- 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- 0.0.0.0 192.168.6.1 0.0.0.0 UG 100 0 0 enp0s3
- 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 flannel0
- 172.17.100.0 0.0.0.0 255.255.255.0 U 0 0 0 docker0
- 192.168.6.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
- 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- 0.0.0.0 192.168.6.1 0.0.0.0 UG 100 0 0 enp0s3
- 0.0.0.0 10.0.3.2 0.0.0.0 UG 101 0 0 enp0s8
- 10.0.3.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s8
- 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 flannel0
- 172.17.95.0 0.0.0.0 255.255.255.0 U 0 0 0 docker0
- 192.168.6.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement