This repo shows how envoy can be used as a generic forward proxy on Kubernetes. "Generic" means that it will allow proxying any host, not a predefined set of hosts.
@alejandropal @dvillanustre Sorry for the delayed response, I was very busy this week. Please note that orig_dst cluster can only work in the same pod/container. In your case you cannot use it.
I would recommend you the following - create a regular cluster with www.google.com as a target. Check that it works.
@vadimeisenbergibm
@vadimeisenbergibm - Good rep.., attach the docker-compose file , also looks like there is an issue with https://github.com/vadimeisenbergibm/envoy-generic-forward-proxy/tree/master/envoy_forward_proxy/envoy_config.json file. help me in correcting it. FYI, i am trying set-up envoy as front-proxy in docker.
PFB docker-compose.yml
version: '2' services: envoy: build: context: . dockerfile: Dockerfile ports:
Logs:
Building envoy Step 1/8 : FROM/envoy-dev:latest
latest: Pulling from envoy-dev
34667c7e4631: Already exists
d18d76a881a4: Already exists
119c7358fbfc: Already exists
2aaf13f3eff0: Already exists
1750bd4d707f: Pull complete
6dbf34881af8: Pull complete
597e8e616785: Pull complete
59b3f5a6b6e2: Pull complete
978686368e74: Pull complete
Digest: sha256:954a3a1b4865600ca2bf869b2a80f948430e008870872c10b0267fb19e18932a
Status: Downloaded newer image for :latest
---> 32d7dd074ce0
Step 2/8 : ENV HOME /root
---> Running in 97127650ef1d
Removing intermediate container 97127650ef1d
---> e64cbfb49113
Step 3/8 : WORKDIR $HOME
Removing intermediate container aa9af3c46d93
---> 34e05d10fd28
Step 4/8 : COPY envoy_config.json $HOME
---> 8f1d665d61d6
Step 5/8 : EXPOSE 10000
---> Running in 5de2b2bfe7b2
Removing intermediate container 5de2b2bfe7b2
---> 3630f4a0ea32
Step 6/8 : EXPOSE 80
---> Running in 5e7d241323ce
Removing intermediate container 5e7d241323ce
---> 038dcd95de8a
Step 7/8 : EXPOSE 443
---> Running in 3b9eea0ef36a
Removing intermediate container 3b9eea0ef36a
---> 571ad62d1dbc
Step 8/8 : CMD envoy -c envoy_config.json
---> Running in c1a5d97df97d
Removing intermediate container c1a5d97df97d
---> 6dae250a9168
Successfully built 6dae250a9168 Successfully tagged envoy_envoy:latest WARNING: Image for service envoy was built because it did not already exist. To rebuild this image you must use
docker-compose build
ordocker-compose up --build
. Creating envoy_envoy_1 ... done Attaching to envoy_envoy_1 envoy_1 | [2019-07-02 09:53:18.776][6][info][main] [source/server/server.cc:205] initializing epoch 0 (hot restart version=10.200.16384.127.options=capacity=16384, num_slots=8209 hash=228984379728933 363 size=2654312) envoy_1 | [2019-07-02 09:53:18.776][6][info][main] [source/server/server.cc:207] statically linked extensions: envoy_1 | [2019-07-02 09:53:18.776][6][info][main] [source/server/server.cc:209] access_loggers: envoy.file_access_log,envoy.http_grpc_access_log envoy_1 | [2019-07-02 09:53:18.776][6][info][main] [source/server/server.cc:212] filters.http: envoy.buffer,envoy.cors,envoy.ext_authz,envoy.fault,envoy.filters.http.grpc_http1_reverse_bridge,envoy .filters.http.header_to_metadata,envoy.filters.http.jwt_authn,envoy.filters.http.rbac,envoy.filters.http.tap,envoy.grpc_http1_bridge,envoy.grpc_json_transcoder,envoy.grpc_web,envoy.gzip,envoy.health_c heck,envoy.http_dynamo_filter,envoy.ip_tagging,envoy.lua,envoy.rate_limit,envoy.router,envoy.squash envoy_1 | [2019-07-02 09:53:18.776][6][info][main] [source/server/server.cc:215] filters.listener: envoy.listener.original_dst,envoy.listener.original_src,envoy.listener.proxy_protocol,envoy.listen er.tls_inspector envoy_1 | [2019-07-02 09:53:18.776][6][info][main] [source/server/server.cc:218] filters.network: envoy.client_ssl_auth,envoy.echo,envoy.ext_authz,envoy.filters.network.dubbo_proxy,envoy.filters.ne twork.mysql_proxy,envoy.filters.network.rbac,envoy.filters.network.sni_cluster,envoy.filters.network.thrift_proxy,envoy.filters.network.zookeeper_proxy,envoy.http_connection_manager,envoy.mongo_proxy, envoy.ratelimit,envoy.redis_proxy,envoy.tcp_proxy envoy_1 | [2019-07-02 09:53:18.776][6][info][main] [source/server/server.cc:220] stat_sinks: envoy.dog_statsd,envoy.metrics_service,envoy.stat_sinks.hystrix,envoy.statsd envoy_1 | [2019-07-02 09:53:18.776][6][info][main] [source/server/server.cc:222] tracers: envoy.dynamic.ot,envoy.lightstep,envoy.tracers.datadog,envoy.zipkin envoy_1 | [2019-07-02 09:53:18.776][6][info][main] [source/server/server.cc:225] transport_sockets.downstream: envoy.transport_sockets.alts,envoy.transport_sockets.tap,raw_buffer,tls envoy_1 | [2019-07-02 09:53:18.776][6][info][main] [source/server/server.cc:228] transport_sockets.upstream: envoy.transport_sockets.alts,envoy.transport_sockets.tap,raw_buffer,tls envoy1 | [2019-07-02 09:53:18.776][6][info][main] [source/server/server.cc:234] buffer implementation: old (libevent) envoy1 | [2019-07-02 09:53:18.777][6][critical][main] [source/server/server.cc:90] error initializing configuration 'envoy_config.json': Unable to parse JSON as proto (INVALID_ARGUMENT:(cluster_mana ger) clusters: Cannot find field.): { envoy_1 | "listeners": [ envoy_1 | { envoy_1 | "address": "tcp://0.0.0.0:80", envoy_1 | "filters": [ envoy_1 | { envoy_1 | "type": "read", envoy_1 | "name": "http_connection_manager", envoy_1 | "config": { envoy_1 | "codec_type": "auto", envoy_1 | "stat_prefix": "forward_http", envoy_1 | "http1_settings": { envoy_1 | "allow_absolute_url": trueOriginally posted by @ravikumarkgit in https://github.com/vadimeisenbergibm/envoy-generic-forward-proxy/issues/1#issuecomment-507571239