Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.93 KB | None | 0 0
  1. [osboxes@kubemaster pods]$ kubectl get pods -o wide
  2. NAME READY STATUS RESTARTS AGE IP NODE
  3. busybox 1/1 Running 0 3m 172.17.60.3 192.168.6.103
  4. mongodb 1/1 Running 0 21m 172.17.60.2 192.168.6.103
  5. [osboxes@kubemaster pods]$ kubectl get services -o wide
  6. NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
  7. kubernetes 10.254.0.1 <none> 443/TCP 17d <none>
  8. mongoservice 10.254.244.175 <none> 27017/TCP 47m name=mongodb
  9.  
  10.  
  11. [osboxes@kubemaster pods]$ kubectl describe svc mongoservice
  12. Name: mongoservice
  13. Namespace: default
  14. Labels: name=mongoservice
  15. Selector: name=mongodb
  16. Type: ClusterIP
  17. IP: 10.254.244.175
  18. Port: <unset> 27017/TCP
  19. Endpoints: 172.17.60.2:27017
  20. Session Affinity: None
  21.  
  22. 8707a465771b busybox "sh" 9 minutes ago Up 9minutes k8s_busybox.53e510d6_busybox_default_c4892314-cde3-11e6-8a53-08002700df07_492b1a89
  23. 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
  24. eaff8dc1a360 mongo "/entrypoint.sh mongo" 28 minutes ago Up 28 minutes k8s_mongodb.d1eca71a_mongodb_default_240cd411-cde1-11e6-8a53-08002700df07_ef5a8bbe
  25. 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
  26.  
  27. [osboxes@kubemaster pods]$ sudo kubectl run -i --tty busybox --image=busybox --generator="run-pod/v1"
  28. Waiting for pod default/busybox to be running, status is Pending, pod ready: false
  29. Waiting for pod default/busybox to be running, status is Pending, pod ready: false
  30. If you don't see a command prompt, try pressing enter.
  31. Error attaching, falling back to logs: dial tcp 192.168.6.103:10250: getsockopt: connection refused
  32. Error from server: Get https://192.168.6.103:10250/containerLogs/default/busybox/busybox: dial tcp 192.168.6.103:10250: getsockopt: connection refused
  33.  
  34.  
  35. [osboxes@kubemaster pods]$ curl 172.17.60.2:27017
  36. curl: (7) Failed connect to 172.17.60.2:27017; No route to host
  37. [osboxes@kubemaster pods]$ curl 10.254.244.175:27017
  38. curl: (7) Failed connect to 10.254.244.175:27017; Connection timed out
  39.  
  40. [osboxes@kubemaster pods]$ kubectl exec -ti mongodb -c k8s_mongodb.d1eca71a_mongodb_default_240cd411-cde1-11e6-8a53-08002700df07_ef5a8bbe sh
  41. Error from server: container k8s_mongodb.d1eca71a_mongodb_default_240cd411-cde1-11e6-8a53-08002700df07_ef5a8bbe is not valid for pod mongodb
  42. [osboxes@kubemaster pods]$ kubectl exec -ti mongodb -c k8s_POD.7ce0ec0_mongodb_default_240cd411-cde1-11e6-8a53-08002700df07_11074b20 sh
  43. Error from server: container k8s_POD.7ce0ec0_mongodb_default_240cd411-cde1-11e6-8a53-08002700df07_11074b20 is not valid for pod mongodb
  44. [osboxes@kubemaster pods]$ kubectl exec -ti mongodb sh
  45. Error from server: dial tcp 192.168.6.103:10250: getsockopt: connection refused
  46.  
  47. [osboxes@kubemaster pods]$ kubectl describe svc mongoservice
  48. Name: mongoservice
  49. Namespace: default
  50. Labels: name=mongoservice
  51. Selector: name=mongodb
  52. Type: ClusterIP
  53. IP: 10.254.244.175
  54. Port: <unset> 27017/TCP
  55. Endpoints: 172.17.60.2:27017
  56. Session Affinity: None
  57.  
  58. [osboxes@kubemaster pods]$ curl 172.17.60.2:27017
  59.  
  60. curl: (7) Failed connect to 172.17.60.2:27017; No route to host
  61.  
  62. kubectl expose service mongoservice --port=27017 --type=NodePort
  63.  
  64. Name: mongo-4025718836
  65. Namespace: default
  66. Labels: pod-template-hash=4025718836
  67. run=mongo
  68. Selector: pod-template-hash=4025718836,run=mongo
  69. Type: NodePort
  70. IP: 10.0.0.11
  71. Port: <unset> 27017/TCP
  72. NodePort: <unset> 32076/TCP
  73. Endpoints: 172.17.0.9:27017
  74. Session Affinity: None
  75.  
  76. curl NODE:32076
  77. It looks like you are trying to access MongoDB over HTTP on the native driver port.
  78.  
  79. #KUBELET_ADDRESS="--address=127.0.0.1"
  80. KUBELET_ADDRESS="--address=0.0.0.0"
  81.  
  82. curl 10.254.39.156:27017
  83. It looks like you are trying to access MongoDB over HTTP on the native driver port.
  84.  
  85. Kernel IP routing table
  86. Destination Gateway Genmask Flags Metric Ref Use Iface
  87. 0.0.0.0 192.168.6.1 0.0.0.0 UG 100 0 0 enp0s3
  88. 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
  89. 192.168.6.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
  90. 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
  91.  
  92. Kernel IP routing table
  93. Destination Gateway Genmask Flags Metric Ref Use Iface
  94. 0.0.0.0 192.168.6.1 0.0.0.0 UG 100 0 0 enp0s3
  95. 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 flannel0
  96. 172.17.100.0 0.0.0.0 255.255.255.0 U 0 0 0 docker0
  97. 192.168.6.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
  98. 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
  99.  
  100. Kernel IP routing table
  101. Destination Gateway Genmask Flags Metric Ref Use Iface
  102. 0.0.0.0 192.168.6.1 0.0.0.0 UG 100 0 0 enp0s3
  103. 0.0.0.0 10.0.3.2 0.0.0.0 UG 101 0 0 enp0s8
  104. 10.0.3.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s8
  105. 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 flannel0
  106. 172.17.95.0 0.0.0.0 255.255.255.0 U 0 0 0 docker0
  107. 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