OK, let me backtrack slightly from my last answer.
I’ve discussed this issue with my colleagues, @NICOLA and @Daniel Strebel and combining our experiences, the current situation looks like this:
It doesn’t seem that Anthos BareMetal with MetalLB at GCE nodes can directly expose traffic against public static IP. The reason being: it’s VxLAN implementation that cannot cross L2 boundary [either via L2/ARP or BGP]
For Details, See https://metallb.universe.tf/installation/clouds/
We might try to ask ABM/MetalLB experts, but our analysis leads to this conclusion.
Now, saying that, I believe the question to expose the Apigee API externally [to the Internet] can be solved by many different ways at GCP.
More complex one, production-ready, scalable, with CloudArmour for WAF, is described here:
https://cloud.google.com/apigee/docs/api-platform/get-started/install-cli#external, Configuring External Routing. Please, don’t be distracted by the fact that it’s Apigee X [not Hybrid] documentation. The starting point is the same: we have an Apigee Endpoint we want to expose to the internet.
More simple one, suitable for quick experiments, demo-friendly, cheap-and-cheerful way consists of those steps:
- Reconfigure the metallb pool to the original one, so that you can successfully call your APIs from abm-ws VM.
-
We are going to use abm-ws as a proxy machine. and Envoy to implement reverse tcp proxy
-
We exploit the fact that abm-ws already has docker installed.
-
Make sure that abm-ws has https_server network tag and Firewalls/Allow HTTPS traffic checkbox ticked.
?. Log into abm-ws VM.
?. Create an envoy.yaml file:
admin:
address:
socket_address: { address: 127.0.0.1, port_value: 9901 }
static_resources:
listeners:
- name: apigee_listener
address:
socket_address: { address: 0.0.0.0, port_value: 443 }
filter_chains:
- filters:
- name: envoy.tcp_proxy
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
stat_prefix: ingress_tcp
cluster: "apigee"
clusters:
- name: apigee
connect_timeout: 0.25s
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: apigee-endpoints
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 10.200.0.51
port_value: 443
Change endpoint.address.socket_address.address as appropriate.
?. pull an envoy image
docker pull envoyproxy/envoy:v1.18-latest
?. Run envoy
docker run --rm -d -p 443:443 -p 9901:9901 --name envoy -v $(pwd)/envoy.yaml:/etc/envoy/envoy.yaml -e ENVOY_UID=$(id -u) envoyproxy/envoy:v1.18-latest
?. Make a note of public IP of abm-ws VM. Now you can execute request from anywhere:
curl -k [https://$RUNTIME_HOST_ALIAS/ping](https://$RUNTIME_HOST_ALIAS/ping) -v --resolve $RUNTIME_HOST_ALIAS:443:$RUNTIME_IP
* Added bm-poc-yyy-hybrid-apigee.net:443:34.xxx.yy.zzz to DNS cache
* Hostname bm-poc-yyy-hybrid-apigee.net was found in DNS cache
* Trying 34.xxx.yyy.zzz...
* TCP_NODELAY set
* Connected to bm-poc-yyy-hybrid-apigee.net (34.xxx.yy.zzz) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
...
* Server certificate:
* subject: CN=api.exco.com
* start date: May 18 23:40:41 2021 GMT
* expire date: Jun 17 23:40:41 2021 GMT
* issuer: CN=api.exco.com
* SSL certificate verify result: self signed certificate (18), continuing anyway.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fe3ce00ce00)
> GET /ping HTTP/2
> Host: bm-poc-yyy-hybrid-apigee.net
> User-Agent: curl/7.64.1
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 2147483647)!
< HTTP/2 200
< host: bm-poc-yyy-hybrid-apigee.net
< user-agent: curl/7.64.1
...
< date: Thu, 03 Jun 2021 21:28:17 GMT
< server: istio-envoy
<
* Connection #0 to host bm-poc-yyy-hybrid-apigee.net left intact
pong
* Closing connection 0