This repository provides a solution for creating a reverse SSH tunnel between a local service and the Firefly Relay frontend. The reverse SSH tunnel allows the local service to securely expose a local port to the Firefly Relay frontend, enabling communication between them.
A reverse SSH tunnel establishes a secure connection from a remote server to a local server, allowing traffic to be forwarded from the local server to the remote server. In the context of Firefly Relay, this enables the local service to communicate with the Firefly Relay frontend by forwarding traffic through the established reverse SSH tunnel.
-
Install Helm on your local machine.
-
Clone this repository:
helm repo add flytube https://gofireflyio.github.io/flytube
- Fill in the required values in
values.yaml
file:
env:
user: "<supplied username>"
remoteHost: "firefly-relay.firefly.ai "
remotePort: 22
sourcePort: 8080
targetHost: "<target host ip/>"
targetPort: 80
sleepDuration: 5
image:
repository: flytube
tag: 1.0.0
resources:
limits:
cpu: "1"
memory: "512Mi"
requests:
cpu: "500m"
memory: "256Mi"
- Copy supplied certificates into the
certs
directory. - Deploy the application using Helm:
helm install flytube firefly/flytube --values values.yaml --namespace=firefly --create-namespace
-
Install Terraform on your local machine.
-
Update the variables in
terraform.tfvars
file with the desired values. -
Add a module call to the flytube terraform module.
provider "aws" {
region = var.aws_region
}
module "ec2_instance" {
source = "github.com/gofireflyio/flytube//flytube-terraform?ref=v0.1.0"
instance_ami = "ami-12345678"
instance_type = "t2.micro"
key_pair_name = "my-keypair"
security_group_id = "sg-12345678"
user = "myuser"
remote_host = "firefly-relay.firefly.ai"
remote_port = 22
source_port = 8080
target_host = "target-host"
target_port = 80
certificate_path = "secrets/ssh-certificate"
certificate_pem = "GIVEN_BY_FIREFLY"
sleep_duration = var.sleep_duration
aws_region = var.aws_region
}
- Initialize the Terraform working directory:
terraform init
- View the Terraform execution plan:
terraform plan
- Provision the EC2 instance:
terraform apply
The configuration options for the application can be modified by updating the values in the values.yaml
file for Docker Helm installation or the terraform.tfvars
file for Terraform installation.
This project is licensed under the MIT License.