Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ kubectl get mappings --all-namespaces
- NAMESPACE NAME PREFIX SERVICE STATE REASON
- default ambassador-devportal-api /openapi/ 127.0.0.1:8500 Running
- default ambassador-devportal /documentation/ 127.0.0.1:8500 Running
- default ambassador-devportal-demo /docs/ 127.0.0.1:8500 Running
- default httpbin /httpbin/ httpbin.org Running
- default productpage /productpage/ productpage:9080 Running
- $
- $ ###############################################################################################################
- $ # I cannot curl the /httpbin in the Ambassador container (even when there is a Mapping for it)
- $ kubectl exec -it ambassador-6f6ccf6dbd-9p5k4 -- curl -v http://localhost:8080/httpbin/ip
- * Trying ::1:8080...
- * TCP_NODELAY set
- * connect to ::1 port 8080 failed: Connection refused
- * Trying 127.0.0.1:8080...
- * TCP_NODELAY set
- * Connected to localhost (127.0.0.1) port 8080 (#0)
- > GET /httpbin/ip HTTP/1.1
- > Host: localhost:8080
- > User-Agent: curl/7.66.0
- > Accept: */*
- >
- * Mark bundle as not supporting multiuse
- < HTTP/1.1 504 Gateway Timeout
- < date: Thu, 12 Dec 2019 19:39:57 GMT
- < server: envoy
- < content-length: 0
- <
- * Connection #0 to host localhost left intact
- $
- $ ###############################################################################################################
- $ # according to the Envoy logs, there is a listener on 8080
- $ kubectl exec -it ambassador-6f6ccf6dbd-9p5k4 -- cat /ambassador/envoy/envoy.json
- {
- "@type": "/envoy.config.bootstrap.v2.Bootstrap",
- "static_resources": {
- "clusters": [
- {
- "connect_timeout": "3.000s",
- "dns_lookup_family": "V4_ONLY",
- "http2_protocol_options": {},
- "lb_policy": "ROUND_ROBIN",
- "load_assignment": {
- "cluster_name": "cluster_127_0_0_1_8500",
- "endpoints": [
- {
- "lb_endpoints": [
- {
- "endpoint": {
- "address": {
- "socket_address": {
- "address": "127.0.0.1",
- "port_value": 8500,
- "protocol": "TCP"
- }
- }
- }
- }
- ]
- }
- ]
- },
- "name": "cluster_127_0_0_1_8500",
- "type": "STRICT_DNS"
- },
- {
- "connect_timeout": "3.000s",
- "dns_lookup_family": "V4_ONLY",
- "lb_policy": "ROUND_ROBIN",
- "load_assignment": {
- "cluster_name": "cluster_127_0_0_1_8877",
- "endpoints": [
- {
- "lb_endpoints": [
- {
- "endpoint": {
- "address": {
- "socket_address": {
- "address": "127.0.0.1",
- "port_value": 8877,
- "protocol": "TCP"
- }
- }
- }
- }
- ]
- }
- ]
- },
- "name": "cluster_127_0_0_1_8877",
- "type": "STRICT_DNS"
- },
- {
- "connect_timeout": "3.000s",
- "dns_lookup_family": "V4_ONLY",
- "http2_protocol_options": {},
- "lb_policy": "ROUND_ROBIN",
- "load_assignment": {
- "cluster_name": "cluster_extauth_127_0_0_1_8500",
- "endpoints": [
- {
- "lb_endpoints": [
- {
- "endpoint": {
- "address": {
- "socket_address": {
- "address": "127.0.0.1",
- "port_value": 8500,
- "protocol": "TCP"
- }
- }
- }
- }
- ]
- }
- ]
- },
- "name": "cluster_extauth_127_0_0_1_8500",
- "type": "STRICT_DNS"
- },
- {
- "connect_timeout": "3.000s",
- "dns_lookup_family": "V4_ONLY",
- "lb_policy": "ROUND_ROBIN",
- "load_assignment": {
- "cluster_name": "cluster_httpbin_org",
- "endpoints": [
- {
- "lb_endpoints": [
- {
- "endpoint": {
- "address": {
- "socket_address": {
- "address": "httpbin.org",
- "port_value": 80,
- "protocol": "TCP"
- }
- }
- }
- }
- ]
- }
- ]
- },
- "name": "cluster_httpbin_org",
- "type": "STRICT_DNS"
- },
- {
- "connect_timeout": "3.000s",
- "dns_lookup_family": "V4_ONLY",
- "lb_policy": "ROUND_ROBIN",
- "load_assignment": {
- "cluster_name": "cluster_productpage_9080",
- "endpoints": [
- {
- "lb_endpoints": [
- {
- "endpoint": {
- "address": {
- "socket_address": {
- "address": "productpage",
- "port_value": 9080,
- "protocol": "TCP"
- }
- }
- }
- }
- ]
- }
- ]
- },
- "name": "cluster_productpage_9080",
- "type": "STRICT_DNS"
- }
- ],
- "listeners": [
- {
- "address": {
- "socket_address": {
- "address": "0.0.0.0",
- "port_value": 8080,
- "protocol": "TCP"
- }
- },
- "filter_chains": [
- {
- "filters": [
- {
- "config": {
- "access_log": [
- {
- "config": {
- "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",
- "path": "/dev/fd/1"
- },
- "name": "envoy.file_access_log"
- }
- ],
- "http_filters": [
- {
- "config": {
- "grpc_service": {
- "envoy_grpc": {
- "cluster_name": "cluster_extauth_127_0_0_1_8500"
- },
- "timeout": "5.000s"
- },
- "status_on_error": {
- "code": 504
- },
- "use_alpha": true
- },
- "name": "envoy.ext_authz"
- },
- {
- "name": "envoy.cors"
- },
- {
- "config": {
- "domain": "ambassador",
- "rate_limit_service": {
- "grpc_service": {
- "envoy_grpc": {
- "cluster_name": "cluster_127_0_0_1_8500"
- }
- }
- },
- "request_type": "both",
- "timeout": "0.020s"
- },
- "name": "envoy.rate_limit"
- },
- {
- "name": "envoy.router"
- }
- ],
- "http_protocol_options": {
- "accept_http_10": false
- },
- "normalize_path": true,
- "route_config": {
- "virtual_hosts": [
- {
- "domains": [
- "*"
- ],
- "name": "backend",
- "routes": [
- {
- "match": {
- "case_sensitive": true,
- "prefix": "/ambassador/v0/check_ready",
- "runtime_fraction": {
- "default_value": {
- "denominator": "HUNDRED",
- "numerator": 100
- },
- "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8877"
- }
- },
- "route": {
- "cluster": "cluster_127_0_0_1_8877",
- "prefix_rewrite": "/ambassador/v0/check_ready",
- "priority": null,
- "timeout": "10.000s"
- }
- },
- {
- "match": {
- "case_sensitive": true,
- "prefix": "/ambassador/v0/check_alive",
- "runtime_fraction": {
- "default_value": {
- "denominator": "HUNDRED",
- "numerator": 100
- },
- "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8877"
- }
- },
- "route": {
- "cluster": "cluster_127_0_0_1_8877",
- "prefix_rewrite": "/ambassador/v0/check_alive",
- "priority": null,
- "timeout": "10.000s"
- }
- },
- {
- "match": {
- "case_sensitive": true,
- "prefix": "/documentation/",
- "runtime_fraction": {
- "default_value": {
- "denominator": "HUNDRED",
- "numerator": 100
- },
- "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8500"
- }
- },
- "route": {
- "cluster": "cluster_127_0_0_1_8500",
- "prefix_rewrite": "/docs/",
- "priority": null,
- "timeout": "3.000s"
- }
- },
- {
- "match": {
- "case_sensitive": true,
- "prefix": "/ambassador/v0/",
- "runtime_fraction": {
- "default_value": {
- "denominator": "HUNDRED",
- "numerator": 100
- },
- "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8877"
- }
- },
- "route": {
- "cluster": "cluster_127_0_0_1_8877",
- "prefix_rewrite": "/ambassador/v0/",
- "priority": null,
- "timeout": "10.000s"
- }
- },
- {
- "match": {
- "case_sensitive": true,
- "prefix": "/productpage/",
- "runtime_fraction": {
- "default_value": {
- "denominator": "HUNDRED",
- "numerator": 100
- },
- "runtime_key": "routing.traffic_shift.cluster_productpage_9080"
- }
- },
- "route": {
- "cluster": "cluster_productpage_9080",
- "prefix_rewrite": "/productpage",
- "priority": null,
- "timeout": "3.000s"
- }
- },
- {
- "match": {
- "case_sensitive": true,
- "prefix": "/openapi/",
- "runtime_fraction": {
- "default_value": {
- "denominator": "HUNDRED",
- "numerator": 100
- },
- "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8500"
- }
- },
- "route": {
- "cluster": "cluster_127_0_0_1_8500",
- "priority": null,
- "timeout": "3.000s"
- }
- },
- {
- "match": {
- "case_sensitive": true,
- "prefix": "/httpbin/",
- "runtime_fraction": {
- "default_value": {
- "denominator": "HUNDRED",
- "numerator": 100
- },
- "runtime_key": "routing.traffic_shift.cluster_httpbin_org"
- }
- },
- "route": {
- "cluster": "cluster_httpbin_org",
- "host_rewrite": "httpbin.org",
- "prefix_rewrite": "/",
- "priority": null,
- "timeout": "3.000s"
- }
- },
- {
- "match": {
- "case_sensitive": true,
- "prefix": "/docs/",
- "runtime_fraction": {
- "default_value": {
- "denominator": "HUNDRED",
- "numerator": 100
- },
- "runtime_key": "routing.traffic_shift.cluster_127_0_0_1_8500"
- }
- },
- "route": {
- "cluster": "cluster_127_0_0_1_8500",
- "prefix_rewrite": "/docs/",
- "priority": null,
- "timeout": "3.000s"
- }
- }
- ]
- }
- ]
- },
- "server_name": "envoy",
- "stat_prefix": "ingress_http",
- "use_remote_address": true,
- "xff_num_trusted_hops": 0
- },
- "name": "envoy.http_connection_manager"
- }
- ],
- "use_proxy_proto": false
- }
- ],
- "name": "ambassador-listener-8080"
- }
- ]
- }
- }%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement