How to run an inlets exit server on Oracle Cloud Infrastructure
with limited budget💰💵 💴 💶 💷

Cloud Native Pilgrim | Kubernetes Enthusiast | Serverless Believer | Customer Experience Architect @ Pulumi | (he/him) | CK{A,AD} |
Search for a command to run...
with limited budget💰💵 💴 💶 💷

Cloud Native Pilgrim | Kubernetes Enthusiast | Serverless Believer | Customer Experience Architect @ Pulumi | (he/him) | CK{A,AD} |
No comments yet. Be the first to comment.
GPU scheduling in Kubernetes has always felt like buying a mansion when you need a studio apartment. A small inference workload that needs 2GB of GPU memory gets scheduled on an entire 80GB A100, and there's nothing you can do about it. The device pl...

TL;DR: The code https://github.com/dirien/quick-bites Nothing is more controversial in the Kubernetes community than whether to use Helm or Kustomize. I always advocate the philosophy of using the right tool for the right job. It avoids the problem...

TL;DR Le code https://github.com/dirien/quick-bites Introduction This article is part three of my series on secret management on Kubernetes with the help of Pulumi. In my first article, we talked about the Sealed Secrets controller. The second arti...

With AWS Lambda

Disaster Recovery, Data Migration made easy!

For anyone not familiar with inlets. It's a project from Alex Ellis, a CNCF Ambassador and the Founder of OpenFaaS.
Cloud Native Tunnel You can use inlets to connect HTTP and TCP services between networks securely. Through an encrypted websocket, inlets can penetrate firewalls, NAT, captive portals, and other restrictive networks lowering the barrier to entry.
VPNs traditionally require up-front configuration like subnet assignment and ports to be opened in firewalls. A tunnel with inlets can provide an easy-to-use, low-maintenance alternative to VPNs and other site-to-site networking solutions.

I dont know this nice bloke, but soon we will be happy as he is.
Oracles Cloud Infrastructure (OCI) is the nearly perfect place to start an inlets exit node. After you created an account, you will not only get a whopping $300 (250€) in cloud credit, but also some selected resources for free. Forever!
Oracle is calling them Always Free Resources.
So what do we get for free, from a compute point of view?
Micro instances (AMD processor): All tenancies get two Always Free VM instances using the VM.Standard.E2.1.Micro shape, which has an AMD processor.
That is amazing as it is exactly what we need for an inlets exit node.

Unfortunately, inlets is not supporting OCI at the moment. To still enjoy the perks of OCI and inlets we're going to use Terraform to install the exit node. Classic...

We're going completely vanilla. So only terraform and inlets inletsctl is needed.
# Install to local directory (and for Windows users)
curl -sLSf https://inletsctl.inlets.dev | sh
# Install directly to /usr/local/bin/
curl -sLSf https://inletsctl.inlets.dev | sudo sh
brew install terraform
We need the inlets-pro binaries to connect to the exit server
inletsctl download
2021/08/16 01:11:11 https://github.com/inlets/inlets-pro/releases/tag/0.8.9
Starting download of inlets-pro 0.8.9, this could take a few moments.
Download completed, make sure that /usr/local/bin is on your path.
inlets-pro version
Just get the example code from here:
https://github.com/dirien/inlets-oci-terraform
After you created your OCI account, you can create your API keys. These are special type of public keys used to perform any kind of API operations. There are different ways to create this API keys.
To keep in simple, I prefer the UI way:
After this, you will be greeted with a dialog with all the relevant information you need for terraform to run.
Then rename the terraform.tfvars.changme in terraform.tfvars and fill out the infos from above.
tenancy_ocid = xx
user_ocid = xx
private_key_path = xx
fingerprint = xx
region = xx
ssh_public_key = xx
Anyone still here?
Now, that you filled out the information, the terraform OCI provider needs, you can simply run your terraform
commands
terraform init
terraform plan
terrafrom apply
If everything works like planed, you should see following, similar output:
oci_core_instance.inlets-ubuntu-instance: Creation complete after 48s [id=ocid1.instance.oc1.eu-frankfurt-1.antheljtoboqxvycp3pui4xy5rva6nmna2siow2tgukeggpmatvl5nzeskpa]
Apply complete! Resources: 7 added, 0 changed, 0 destroyed.
Outputs:
inlets-connection-string = <sensitive>
Type terraform output inlets-connection-string to see the connection details
inlets-pro tcp client --url wss://158.101.189.144:8123 --token RFMLihTUZ2WQbHkRNPRsATAJDqjgvMx7XywjiwFqB7nUI3HOLOwF8LMw8Nsk79TG --upstream $UPSTREAM --ports $PORTS
Now you can expose every local application via the variables $UPSTREAM and $PORT
inlets-pro tcp client --url wss://158.101.189.144:8123 --token RFMLihTUZ2WQbHkRNPRsATAJDqjgvMx7XywjiwFqB7nUI3HOLOwF8LMw8Nsk79TG --upstream $UPSTREAM --ports $PORTS
2021/08/16 00:43:01 Starting TCP client. Version 0.8.9 - 7df6fc42cfc14dd56d93c32930262202967d234b
2021/08/16 00:43:01 Licensed to: Engin Diri <Engin.Diri@mail.schwarz>, expires: 6 day(s)
2021/08/16 00:43:01 Upstream server: localhost, for ports: 8080
inlets-pro client. Copyright OpenFaaS Ltd 2021
INFO[2021/08/16 00:43:01] Connecting to proxy url="wss://158.101.189.144:8123/connect"
INFO[2021/08/16 00:43:01] Connection established.. OK.

If you don't need the inlets tunnel anymore, just type:
terraform destroy to purge everything.
