Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.18 KB | None | 0 0
  1. $ kubectl get mappings --all-namespaces
  2. NAMESPACE NAME PREFIX SERVICE STATE REASON
  3. default ambassador-devportal-api /openapi/ 127.0.0.1:8500 Running
  4. default ambassador-devportal /documentation/ 127.0.0.1:8500 Running
  5. default ambassador-devportal-demo /docs/ 127.0.0.1:8500 Running
  6. default httpbin /httpbin/ httpbin.org Running
  7. default productpage /productpage/ productpage:9080 Running
  8. $
  9. $ ###############################################################################################################
  10. $ # I cannot curl the /httpbin in the Ambassador container (even when there is a Mapping for it)
  11. $ kubectl exec -it ambassador-6f6ccf6dbd-9p5k4 -- curl -v http://localhost:8080/httpbin/ip
  12. * Trying ::1:8080...
  13. * TCP_NODELAY set
  14. * connect to ::1 port 8080 failed: Connection refused
  15. * Trying 127.0.0.1:8080...
  16. * TCP_NODELAY set
  17. * Connected to localhost (127.0.0.1) port 8080 (#0)
  18. > GET /httpbin/ip HTTP/1.1
  19. > Host: localhost:8080
  20. > User-Agent: curl/7.66.0
  21. > Accept: */*
  22. >
  23. * Mark bundle as not supporting multiuse
  24. < HTTP/1.1 504 Gateway Timeout
  25. < date: Thu, 12 Dec 2019 19:39:57 GMT
  26. < server: envoy
  27. < content-length: 0
  28. <
  29. * Connection #0 to host localhost left intact
  30. $
  31. $ ###############################################################################################################
  32. $ # according to the Envoy logs, there is a listener on 8080
  33. $ kubectl exec -it ambassador-6f6ccf6dbd-9p5k4 -- cat /ambassador/envoy/envoy.json
  34. {
  35. "@type": "/envoy.config.bootstrap.v2.Bootstrap",
  36. "static_resources": {
  37. "clusters": [
  38. {
  39. "connect_timeout": "3.000s",
  40. "dns_lookup_family": "V4_ONLY",
  41. "http2_protocol_options": {},
  42. "lb_policy": "ROUND_ROBIN",
  43. "load_assignment": {
  44. "cluster_name": "cluster_127_0_0_1_8500",
  45. "endpoints": [
  46. {
  47. "lb_endpoints": [
  48. {
  49. "endpoint": {
  50. "address": {
  51. "socket_address": {
  52. "address": "127.0.0.1",
  53. "port_value": 8500,
  54. "protocol": "TCP"
  55. }
  56. }
  57. }
  58. }
  59. ]
  60. }
  61. ]
  62. },
  63. "name": "cluster_127_0_0_1_8500",
  64. "type": "STRICT_DNS"
  65. },
  66. {
  67. "connect_timeout": "3.000s",
  68. "dns_lookup_family": "V4_ONLY",
  69. "lb_policy": "ROUND_ROBIN",
  70. "load_assignment": {
  71. "cluster_name": "cluster_127_0_0_1_8877",
  72. "endpoints": [
  73. {
  74. "lb_endpoints": [
  75. {
  76. "endpoint": {
  77. "address": {
  78. "socket_address": {
  79. "address": "127.0.0.1",
  80. "port_value": 8877,
  81. "protocol": "TCP"
  82. }
  83. }
  84. }
  85. }
  86. ]
  87. }
  88. ]
  89. },
  90. "name": "cluster_127_0_0_1_8877",
  91. "type": "STRICT_DNS"
  92. },
  93. {
  94. "connect_timeout": "3.000s",
  95. "dns_lookup_family": "V4_ONLY",
  96. "http2_protocol_options": {},
  97. "lb_policy": "ROUND_ROBIN",
  98. "load_assignment": {
  99. "cluster_name": "cluster_extauth_127_0_0_1_8500",
  100. "endpoints": [
  101. {
  102. "lb_endpoints": [
  103. {
  104. "endpoint": {
  105. "address": {
  106. "socket_address": {
  107. "address": "127.0.0.1",
  108. "port_value": 8500,
  109. "protocol": "TCP"
  110. }
  111. }
  112. }
  113. }
  114. ]
  115. }
  116. ]
  117. },
  118. "name": "cluster_extauth_127_0_0_1_8500",
  119. "type": "STRICT_DNS"
  120. },
  121. {
  122. "connect_timeout": "3.000s",
  123. "dns_lookup_family": "V4_ONLY",
  124. "lb_policy": "ROUND_ROBIN",
  125. "load_assignment": {
  126. "cluster_name": "cluster_httpbin_org",
  127. "endpoints": [
  128. {
  129. "lb_endpoints": [
  130. {
  131. "endpoint": {
  132. "address": {
  133. "socket_address": {
  134. "address": "httpbin.org",
  135. "port_value": 80,
  136. "protocol": "TCP"
  137. }
  138. }
  139. }
  140. }
  141. ]
  142. }
  143. ]
  144. },
  145. "name": "cluster_httpbin_org",
  146. "type": "STRICT_DNS"
  147. },
  148. {
  149. "connect_timeout": "3.000s",
  150. "dns_lookup_family": "V4_ONLY",
  151. "lb_policy": "ROUND_ROBIN",
  152. "load_assignment": {
  153. "cluster_name": "cluster_productpage_9080",
  154. "endpoints": [
  155. {
  156. "lb_endpoints": [
  157. {
  158. "endpoint": {
  159. "address": {
  160. "socket_address": {
  161. "address": "productpage",
  162. "port_value": 9080,
  163. "protocol": "TCP"
  164. }
  165. }
  166. }
  167. }
  168. ]
  169. }
  170. ]
  171. },
  172. "name": "cluster_productpage_9080",
  173. "type": "STRICT_DNS"
  174. }
  175. ],
  176. "listeners": [
  177. {
  178. "address": {
  179. "socket_address": {
  180. "address": "0.0.0.0",
  181. "port_value": 8080,
  182. "protocol": "TCP"
  183. }
  184. },
  185. "filter_chains": [
  186. {
  187. "filters": [
  188. {
  189. "config": {
  190. "access_log": [
  191. {
  192. "config": {
  193. "format": "ACCESS [%START_TIME%] \"%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%\" %RESPONSE_CODE% %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% \"%REQ(X-FORWARDED-FOR)%\" \"%REQ(USER-AGENT)%\" \"%REQ(X-REQUEST-ID)%\" \"%REQ(:AUTHORITY)%\" \"%UPSTREAM_HOST%\"\n",
  194. "path": "/dev/fd/1"
  195. },
  196. "name": "envoy.file_access_log"
  197. }
  198. ],
  199. "http_filters": [
  200. {
  201. "config": {
  202. "grpc_service": {
  203. "envoy_grpc": {
  204. "cluster_name": "cluster_extauth_127_0_0_1_8500"
  205. },
  206. "timeout": "5.000s"
  207. },
  208. "status_on_error": {
  209. "code": 504
  210. },
  211. "use_alpha": true
  212. },
  213. "name": "envoy.ext_authz"
  214. },
  215. {
  216. "name": "envoy.cors"
  217. },
  218. {
  219. "config": {
  220. "domain": "ambassador",
  221. "rate_limit_service": {
  222. "grpc_service": {
  223. "envoy_grpc": {
  224. "cluster_name": "cluster_127_0_0_1_8500"
  225. }
  226. }
  227. },
  228. "request_type": "both",
  229. "timeout": "0.020s"
  230. },
  231. "name": "envoy.rate_limit"
  232. },
  233. {
  234. "name": "envoy.router"
  235. }
  236. ],
  237. "http_protocol_options": {
  238. "accept_http_10": false
  239. },
  240. "normalize_path": true,
  241. "route_config": {
  242. "virtual_hosts": [
  243. {
  244. "domains": [
  245. "*"
  246. ],
  247. "name": "backend",
  248. "routes": [
  249. {
  250. "match": {
  251. "case_sensitive": true,
  252. "prefix": "/ambassador/v0/check_ready",
  253. "runtime_fraction": {
  254. "default_value": {
  255. "denominator": "HUNDRED",
  256. "numerator": 100
  257. },
  258. "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8877"
  259. }
  260. },
  261. "route": {
  262. "cluster": "cluster_127_0_0_1_8877",
  263. "prefix_rewrite": "/ambassador/v0/check_ready",
  264. "priority": null,
  265. "timeout": "10.000s"
  266. }
  267. },
  268. {
  269. "match": {
  270. "case_sensitive": true,
  271. "prefix": "/ambassador/v0/check_alive",
  272. "runtime_fraction": {
  273. "default_value": {
  274. "denominator": "HUNDRED",
  275. "numerator": 100
  276. },
  277. "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8877"
  278. }
  279. },
  280. "route": {
  281. "cluster": "cluster_127_0_0_1_8877",
  282. "prefix_rewrite": "/ambassador/v0/check_alive",
  283. "priority": null,
  284. "timeout": "10.000s"
  285. }
  286. },
  287. {
  288. "match": {
  289. "case_sensitive": true,
  290. "prefix": "/documentation/",
  291. "runtime_fraction": {
  292. "default_value": {
  293. "denominator": "HUNDRED",
  294. "numerator": 100
  295. },
  296. "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8500"
  297. }
  298. },
  299. "route": {
  300. "cluster": "cluster_127_0_0_1_8500",
  301. "prefix_rewrite": "/docs/",
  302. "priority": null,
  303. "timeout": "3.000s"
  304. }
  305. },
  306. {
  307. "match": {
  308. "case_sensitive": true,
  309. "prefix": "/ambassador/v0/",
  310. "runtime_fraction": {
  311. "default_value": {
  312. "denominator": "HUNDRED",
  313. "numerator": 100
  314. },
  315. "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8877"
  316. }
  317. },
  318. "route": {
  319. "cluster": "cluster_127_0_0_1_8877",
  320. "prefix_rewrite": "/ambassador/v0/",
  321. "priority": null,
  322. "timeout": "10.000s"
  323. }
  324. },
  325. {
  326. "match": {
  327. "case_sensitive": true,
  328. "prefix": "/productpage/",
  329. "runtime_fraction": {
  330. "default_value": {
  331. "denominator": "HUNDRED",
  332. "numerator": 100
  333. },
  334. "runtime_key": "routing.traffic_shift.cluster_productpage_9080"
  335. }
  336. },
  337. "route": {
  338. "cluster": "cluster_productpage_9080",
  339. "prefix_rewrite": "/productpage",
  340. "priority": null,
  341. "timeout": "3.000s"
  342. }
  343. },
  344. {
  345. "match": {
  346. "case_sensitive": true,
  347. "prefix": "/openapi/",
  348. "runtime_fraction": {
  349. "default_value": {
  350. "denominator": "HUNDRED",
  351. "numerator": 100
  352. },
  353. "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8500"
  354. }
  355. },
  356. "route": {
  357. "cluster": "cluster_127_0_0_1_8500",
  358. "priority": null,
  359. "timeout": "3.000s"
  360. }
  361. },
  362. {
  363. "match": {
  364. "case_sensitive": true,
  365. "prefix": "/httpbin/",
  366. "runtime_fraction": {
  367. "default_value": {
  368. "denominator": "HUNDRED",
  369. "numerator": 100
  370. },
  371. "runtime_key": "routing.traffic_shift.cluster_httpbin_org"
  372. }
  373. },
  374. "route": {
  375. "cluster": "cluster_httpbin_org",
  376. "host_rewrite": "httpbin.org",
  377. "prefix_rewrite": "/",
  378. "priority": null,
  379. "timeout": "3.000s"
  380. }
  381. },
  382. {
  383. "match": {
  384. "case_sensitive": true,
  385. "prefix": "/docs/",
  386. "runtime_fraction": {
  387. "default_value": {
  388. "denominator": "HUNDRED",
  389. "numerator": 100
  390. },
  391. "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8500"
  392. }
  393. },
  394. "route": {
  395. "cluster": "cluster_127_0_0_1_8500",
  396. "prefix_rewrite": "/docs/",
  397. "priority": null,
  398. "timeout": "3.000s"
  399. }
  400. }
  401. ]
  402. }
  403. ]
  404. },
  405. "server_name": "envoy",
  406. "stat_prefix": "ingress_http",
  407. "use_remote_address": true,
  408. "xff_num_trusted_hops": 0
  409. },
  410. "name": "envoy.http_connection_manager"
  411. }
  412. ],
  413. "use_proxy_proto": false
  414. }
  415. ],
  416. "name": "ambassador-listener-8080"
  417. }
  418. ]
  419. }
  420. }%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement