Skip to content

Instantly share code, notes, and snippets.

@gosuri
Last active December 8, 2019 15:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gosuri/44f0530712eb9e0997bc494576ad3579 to your computer and use it in GitHub Desktop.
Save gosuri/44f0530712eb9e0997bc494576ad3579 to your computer and use it in GitHub Desktop.
Using Inlets on Akash

Thanks to awesome @alexellis for this contribution:

  1. Set an Inlets Token
export INLETS_TOKEN=abcd1234
  1. Deploy Inlets on Akash using the below config:
cat > inlets.yml <<EOF
---
version: "1.0"

services:
  inlets:
    image: inlets/inlets:2.6.1
    args:
     - server
     - --control-port=8081
     - --port=8081
     - --token=$INLETS_TOKEN
    expose:
      - port: 8081
        as: 80
        to:
          - global: true

profiles:
  compute:
    inlets:
      cpu: "0.25"
      memory: "512Mi"
      disk: "1G"

  placement:
    global:
      pricing:
        inlets: 500u

deployment:
  inlets:
    global:
      profile: inlets
      count: 1

EOF

Deploy:

akash deployment create inlets.yml
  1. Start an inlets client with the domain mapping you got from previous step to your local service. For example, if the akash domain mapping is m6bsdofuf3dzl4mdxq6w6y.marx.akashtest.net and your local service is running on port 3000, run the below:
inlets client --remote ws://m6bsdofuf3dzl4mdxq6w6y.marx.akashtest.net:80 --upstream http://127.0.0.1:3000 --token $INLETS_TOKEN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment