Access to cluster network - mudler/ekcp GitHub Wiki
There are different ways to access directly to your cluster network:
By default EKCP sets up in the docker-compose a gorouter, and you can enable dynamic routes registration by passing ROUTE_REGISTER=true to the environment of the EKCP API.
This allows you to be able to reach any cluster port 80 with a custom domain, by passing the connection to the gorouter proxy. In order to accomplish this you have to set up your env to point to http://<ekcp_ip>:8081 ( e.g. http_proxy=http://...:8081 ).
Another way is to use kubectl port-forward to reach directly your services (see kubectl port-forward --help).
You can expose all the network of the cluster, and make it accessible locally by deploying a socks5 (yes! a socks5 server!) in your cluster, open a port locally with kubectl port-forward and point your applications to consume it.
$> cat > socks-server.yml <<EOF
#https://github.com/weaveworks/build-tools/blob/master/socks/connect.sh
---
apiVersion: v1
kind: Pod
metadata:
name: socksproxy
namespace: default
spec:
containers:
- name: socksproxy
image: weaveworks/socksproxy
ports:
- name: socks
containerPort: 8000
- name: http
containerPort: 8080
EOF
Deploy the sock server:
$> kubectl apply -f socks-server.yml
Bind a local port to the remote sock server with kube:
$> kubectl port-forward -n default pod/socksproxy 2224:8000
Consume the socks server in your apps:
$> https_proxy=socks5://127.0.0.1:2224 curl http://my-pod.cluster.domain