Gefyra on Amazon EKS
Prerequisites
- You have the aws command installed and configured
- Follow the installation of Gefyra for your preferred platform
Additionally, you need an account for the Amazon Web Services including the permission to create a new cluster. Make sure your aws is using the right project configuration and/or profile.
Setup a cluster
- The easiest way to create a new cluster is using
aws:
aws eks create-cluster --name gefyra --kubernetes-version 1.22 --role-arn arn:aws:iam::111122223333:role/myAmazonEKSClusterRole --resources-vpc-config subnetIds=subnet-ExampleID1,subnet-ExampleID2,securityGroupIds=sg-ExampleID1
This may take a long time. You can check the cluster status with:
> aws eks describe-cluster --name gefyra --query "cluster.status"
"ACTIVE"
- Depending on your way of creating the cluster, you may have to add a
NodeGroupto the cluster, so you can actually run workloads. - Pull the
kubectlconfiguration to connect to the cluster, with:
aws eks update-kubeconfig --name gefyra
Now you should be able to run any kubectl command in that cluster.
- Apply some workload, for example from the testing directory of this repo:
kubectl apply -f https://raw.githubusercontent.com/gefyrahq/gefyra/main/testing/workloads/hello_dd.yaml
- Important: before Gefyra can connect from outside the cluster, you must set the security group of the nodes to allow UDP traffic on port 31820.
Find out the security group of the cluster. Then, create the required inbound traffic rule:
> aws eks describe-cluster --name gefyra --query "cluster.resourcesVpcConfig.clusterSecurityGroupId"
<security-group-id>
aws ec2 authorize-security-group-ingress --group-id "<security-group-id>" --protocol udp --port 31820 --cidr 0.0.0.0/0
Running Gefyra
- At first, we need a host IP of one of our nodes. You can get them by running
kubectl get nodes -o wide | awk {'print $1" " $2 " " $7'} | column -t
Pick one of them from the EXTERNAL-IP column.
- Now you can run
gefyra up --host <IP>
- Run a local container with Gefyra (Zero Image Build):
# 1. Create a local response file
mkdir -p /tmp/local-server
echo "<h1>Hello from Gefyra. Live local code served directly into EKS!</h1>" > /tmp/local-server/index.html
# 2. Run the local container in Gefyra
gefyra run \
-i python:3.12-alpine \
-N mypyserver \
-v /tmp/local-server:/app \
-c "python3 -m http.server 8000 -d /app" \
-d
- Exec into the running container and verify cluster access:
docker exec -it mypyserver sh
wget -O- hello-nginx
exit
- Mount the workload and create a bridge to intercept traffic with your local container:
# 1. Mount the deployment with Carrier2
gefyra mount create --target deployment/hello-nginxdemo/hello-nginx --name mymount
# 2. Bridge traffic to your local container
gefyra bridge create --mount mymount -p 80:8000 -t mypyserver --match-path-prefix /
- List active mounts and bridges:
gefyra bridge list
gefyra mount list
- Remove the bridge and unmount the workload to reset the cluster:
# Delete the bridge
gefyra bridge delete <bridge-id>
# Unmount the workload and restore original container image
gefyra mount delete mymount
Cleaning up
Remove Gefyra's components from the cluster with gefyra down
Google Cloud Platform (GCP)
Bridge local containers into a remote GKE cluster with Gefyra — WireGuard over UDP 31820, firewall rules, and live staging development.
SysEleven MetaKube
Use Gefyra with SysEleven MetaKube — European managed Kubernetes with OpenStack/Octavia load balancers for WireGuard connectivity.