Get cloud instances with your favourite software pre-loaded

cloud-provision

Get cloud instances with your favourite software pre-loaded

This Golang package can be used to provision cloud hosts using a simple CRUD-style API along with a cloud-init user-data script. It could be used to automate anything from k3s clusters, to blogs, or CI runners. We use it to create the cheapest possible hosts in the cloud with a public IP address.

provision.go

type Provisioner interface {
	Provision(BasicHost) (*ProvisionedHost, error)
	Status(id string) (*ProvisionedHost, error)
	Delete(HostDeleteRequest) error
}

Where is this package used?

Feel free to send a PR to add your project

This package is used by:

  • inletsctl - Go CLI to create/delete exit-servers and inlets/-pro tunnels
  • inlets-operator - Kubernetes operator to automate exit-servers and inlets/-pro tunnels via CRDs and Service definitions

Try an example program

The tester app takes in a cloud-config file and provisions a host with Nginx - polling until it is ready for access.

#cloud-config
packages:
  - nginx
runcmd:
  - systemctl enable nginx
  - systemctl start nginx

See the example here: Tester app

Rules for adding a new provisioner

The first rule about the provision package is that we don't do SSH. Key management and statefulness are out of scope. Cheap servers should be treated like cattle, not pets. ssh may well be enabled by default, but is out of scope for management. For instance, with DigitalOcean, you can get a root password if you need to log in. Configure as much as you can via cloud-init / user-data.

  • Use the Ubuntu 16.04 LTS image
  • Select the cheapest plan and update the README with the estimated monthly cost
  • For inlets OSS open just the required ports
  • For inlets-pro you must open all ports since the client advertises, not the server
  • This API is event-driven and is expected to use polling from the Kubernetes Operator or inletsctl CLI, not callbacks or waits
  • Do not use any wait or blocking calls, all API calls should return ideally within < 1s
  • Document how you chose any image or configuration, so that the code can be maintained, so that means links and // comments
  • All provisioning code should detect the correct "status" for the provider and set the standard known value
  • Always show your testing in PRs.

Finally please add an example to the documentation for your provider in the inlets/docs repo.

If you would like to add a provider please propose it with an Issue, to make sure that the community are happy to accept the change, and to maintain the code on an ongoing basis.

Maintainers for each provider

Owner
inlets
The Cloud Native Tunnel
inlets
Comments
  • Scaleway STARDUST1-S Instance Type Support

    Scaleway STARDUST1-S Instance Type Support

    Scaleway now has a STARDUST1-S Instance Type "STARDUST1-S" 1 vCPU, 1 GB of RAM, 1 IPv4 address, 10GB storage, up-to 100Mbps Bandwidth. €0.0025/hour.

    Having support for this would be by far the lowest cost option to use with inlets for European customers. It would be nice to add support for Amsterdam regions as well.

  • Add OVHcloud as new cloud provisioner

    Add OVHcloud as new cloud provisioner

    This PR introdcue OVHcloud as new cloud provisoner for inlets*

    OVH

    https://www.ovh.com/

    OVH, legally OVH Groupe SAS, is a French cloud computing company which offers VPS, dedicated servers and other web services. As of 2016 OVH owned the world's largest data center in surface area. As of 2019, it was the largest hosting provider in Europe, and the third largest in the world based on physical servers.[1]

    Signed-off-by: Engin Diri [email protected]

    [1] https://en.wikipedia.org/wiki/OVHcloud

  • Upgrade Azure SDK to latest resource manager SDK

    Upgrade Azure SDK to latest resource manager SDK

    Signed-off-by: Ze Chen [email protected]

    This change is to upgrade the Azure management modules SDK (services/**/mgmt/**) to Azure resource management SDK (sdk/resourcemanager/**/arm**).

    This is the migration guide I followed to make this change: https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/MIGRATION_GUIDE.md

    How this was tested

    Added local path of cloud-provision into inletsctl/go.mod

    replace github.com/inlets/cloud-provision =>/home/testuser/go/src/github.com/zechenbit/cloud-provision 
    

    Run inletsctl

    inletsctl_create create --provider=azure --subscription-id=<id> --region=eastus --access-token-file=client_cred_owner.json
    Using provider: azure
    Requesting host: festive-raman6 in eastus, from azure
    2022/10/03 18:13:07 Provisioning host with Azure
    2022/10/03 18:13:07 Creating resource group inlets-festive-raman6
    2022/10/03 18:13:10 Resource group created inlets-festive-raman6
    2022/10/03 18:13:10 Creating deployment deployment-8f9948dc-8c4d-4fff-93b7-1077ff5c6a7c
    Host: inlets-festive-raman6|deployment-8f9948dc-8c4d-4fff-93b7-1077ff5c6a7c, status: active
    [1/500] Host: inlets-festive-raman6|deployment-8f9948dc-8c4d-4fff-93b7-1077ff5c6a7c, status: Running
    .......
    [20/500] Host: inlets-festive-raman6|deployment-8f9948dc-8c4d-4fff-93b7-1077ff5c6a7c, status: Running
    [21/500] Host: inlets-festive-raman6|deployment-8f9948dc-8c4d-4fff-93b7-1077ff5c6a7c, status: active
    inlets Pro TCP (0.9.9) server summary:
      IP: 20.163.153.184
      Auth-token: 3WzZaHNahhOvRNtkhwQ9fcSYhm0dTuzRy1iJ1C8482SAiWEABodPaflBPU1VRZfn
    
    Command:
    
    # Obtain a license at https://inlets.dev/pricing
    # Store it at $HOME/.inlets/LICENSE or use --help for more options
    
    # Give a single value or comma-separated
    export PORTS="8000"
    
    # Where to route traffic from the inlets server
    export UPSTREAM="localhost"
    
    inlets-pro tcp client --url "wss://20.163.153.184:8123" \
      --token "3WzZaHNahhOvRNtkhwQ9fcSYhm0dTuzRy1iJ1C8482SAiWEABodPaflBPU1VRZfn" \
      --upstream $UPSTREAM \
      --ports $PORTS
    
    To delete:
      inletsctl delete --provider azure --id "inlets-festive-raman6|deployment-8f9948dc-8c4d-4fff-93b7-1077ff5c6a7c"
    
    

    Run inlets-pro

    export PORTS="8000"
    export UPSTREAM="localhost"
    
    /usr/local/bin/inlets-pro tcp client --url "wss://20.163.153.184:8123" \
      --token "3WzZaHNahhOvRNtkhwQ9fcSYhm0dTuzRy1iJ1C8482SAiWEABodPaflBPU1VRZfn" \
      --upstream $UPSTREAM \
      --ports $PORTS
    
    2022/10/03 18:29:15 Licensed to: **************
    2022/10/03 18:29:15 Upstream server: localhost, for ports: 8000
    inlets-pro TCP client. Copyright OpenFaaS Ltd 2022
    INFO[2022/10/03 18:29:17] Connecting to proxy                           url="wss://20.163.153.184:8123/connect"
    INFO[2022/10/03 18:29:18] Connection established                        client_id=7a1039939f3943c58150c8a3d17a1cc0
    
  • GCE: the iam.serviceAccountUser role is unused

    GCE: the iam.serviceAccountUser role is unused

    The GCE provisioner requires a GCP service account with two roles:

    • roles/compute.admin
    • roles/iam.serviceAccountUser

    The first role makes sense, but the second one was a surprise to me. Looking at gce.go, I discovered that the VM is created with a "service account VM" (a service account that is mounted into the VM and allows for GCP API calls):

    https://github.com/inlets/cloud-provision/blob/9626406375488183630d2b3904deeaf12445531e/provision/gce.go#L94-L101

    Should we drop this mounted service account and update the documentation (see sections inlets-operator and inletsctl) to only require roles/compute.admin?

  • Linode: Remove 'inlets-' prefix on label

    Linode: Remove 'inlets-' prefix on label

    The Linode provider add a prefix to the label

    https://github.com/inlets/cloud-provision/blob/f58cc468f6b080abbf246d88415aee7eefd52406/provision/linode.go#L90

    which could conflict with the max lable length of the Linode API (https://www.linode.com/docs/api/linode-instances/)

    Should be removed and to be sure trimmed down to 32 chars.

  • Equinix Metal Provisiner Errors

    Equinix Metal Provisiner Errors

    Hi,

    i get following errors, when using the Equinix Metal Provisioner:

    1. Default Region am1 does not exist
    Using provider: equinix-metal
    Requesting host: reverent-khayyam0 in ams1, from equinix-metal
    2021/07/27 06:31:29 [DEBUG] POST https://api.equinix.com/metal/v1/projects/xx/devices
    POST https://api.equinix.com/metal/v1/projects/xxx/devices: 422 ams1 is not a valid facility 
    
    1. You can not create an Equinix Metal Server without an SSH Key anymore:
    Using provider: equinix-metal
    Requesting host: magical-johnson8 in fr2, from equinix-metal
    2021/07/27 06:36:30 [DEBUG] POST https://api.equinix.com/metal/v1/projects/xxx/devices
    POST https://api.equinix.com/metal/v1/projects/xxx/devices: 422 must have at least one SSH key or explicitly send no_ssh_keys option 
    

    See -> https://feedback.equinixmetal.com/platform/p/allow-to-deploy-servers-without-ssh-key And new API for the no_ssh_keys option -> https://metal.equinix.com/developers/api/devices/#devices-createdevice

    For issue 2 we need to update the Go lib -> 0.17.0

  • Add sessionToken param to NewEC2Provisioner

    Add sessionToken param to NewEC2Provisioner

    Currently the session token field is defaulted to "". This makes it impossible to use temporary session creds in inletsctl as AWS expects key, secret & token.

    This change adds a new parameter to NewEC2Provisioner to pass the session token through which is subsequenty used in NewStaticCredentials.

    Signed-off-by: Richard Gee [email protected]

  • Add delete by IP on OVHcloud provisioner

    Add delete by IP on OVHcloud provisioner

    Signed-off-by: Engin Diri [email protected]

    Valuable Feedback from @jsiebens

    @dirien @alexellis fyi, deleting an instance by IP instead of ID is missing in this new provider

    in the #10 PR.

    This PR adds the missing functionality.

  • Add Network and Region to instance

    Add Network and Region to instance

    To create a civo instance, you need to assign a default network to it. Otherwise, it will not create the instance.

    In addition, we need to handle the region too, as different regions have different default networks.

    This issue popped up during handling the https://github.com/inlets/inletsctl/issues/95

    Signed-off-by: Engin Diri [email protected]

  • Linode: Remove Startupscripts

    Linode: Remove Startupscripts

    When deleting an exit sever on linode, we should remove the startupscript too.

    If a sever can not be created, for whatever reasons we should also delete any orphan startupscripts. image

  • EC2, Enable authentication using default credential chain

    EC2, Enable authentication using default credential chain

    Signed-off-by: Tim Luimes [email protected]

    Enables the ability for the ec2 client session to be authenticated using methods provided by the aws SDK's default credential chain when the accessKey and secretKey aren't provided.

    https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html "When you initialize a new service client without providing any credential arguments, the SDK uses the default credential provider chain to find AWS credentials. The SDK uses the first provider in the chain that returns credentials without an error. The default provider chain looks for credentials in the following order:

    Environment variables.

    Shared credentials file.

    If your application uses an ECS task definition or RunTask API operation, IAM role for tasks.

    If your application is running on an Amazon EC2 instance, IAM role for Amazon EC2."

  • [Suggestion] Remove inlets specific references from the provisioners

    [Suggestion] Remove inlets specific references from the provisioners

    At this moment, many provisioners have some specific, hard-coded references to inlets. Like tags or firewall rules. Referring to this repository: https://github.com/inlets/provision-cloudinit-go, removing those references and making the provisioners more generic, they can be used as a library by others.

    Expected Behaviour

    Most provisioners create cloud host with hard-coded inlets references, like tags.

    Current Behaviour

    The provisioners can be used by others without creating inlets tags.

    Possible Solution

    Pass the inlets references to the provisioners as arguments. I'm aware this can be a tedious task, as there are many provisioners and they all have a target cloud specific implementation.

    Steps to Reproduce (for bugs)

    N/A

    Context

    Playing around with the provisioners as a library, I've noticed that the cloud hosts are tagged with "inlets"., while I was creating other, non-inlets relared hosts.

    Your Environment

    • inlets version inlets --version N/A
    • Docker/Kubernetes version docker version / kubectl version: N/A
    • Operating System and version (e.g. Linux, Windows, MacOS): N/A
    • Link to your project or a code example to reproduce issue: https://github.com/inlets/provision-cloudinit-go
Cell is a Go package that creates new instances by string in running time.

Cell Cell is a Go package that creates new instances by string in running time. Getting Started Installing To start using CELL, install Go and run go

Dec 20, 2021
A comprehensive list of alternatives to your favorite software

alternativeto A comprehensive list of alternatives to your favorite software. Please do not edit this file directly. Instead, follow the steps outline

Jun 16, 2022
✔️ Get random data for your app from a third-party source.

Random Data Securely produced random data for application testing. FAQ What would i use this data for? You can use this information to test your apps

Jul 5, 2022
Easy way to get credentials of your clusters in GCP and stay connected

Easy way to get credentials of your clusters in GCP and stay connected. Don't lose time with alias or annotations with projects names and clusters. Use k8skey

Nov 9, 2021
Project developed for the course Software Systems Analysis and Design (SSAD) at IU in F21 semester.

Go knowledge yield summary Project description Project developed for the course Software Systems Analysis and Design (SSAD) at IU in F21 semester. Eva

Sep 17, 2022
System software of computers

SSoC System software of computers BSUIR labs Project structure Client client client/components client/components/client client/components/command clie

Jan 5, 2022
Graceful - shutdown package when a service is turned off by software function

graceful Graceful shutdown package when a service is turned off by software func

Dec 29, 2022
this allows you to get the real link of bit.ly
this allows you to get the real link of bit.ly

check the real url from a url shortener (bit.ly) Also you can use it as an API example with deno const rawResponse = await fetch("https://anti-url-s

Feb 19, 2022
redis-util business-friendly encapsulation of redis operations, such as the common cache set get operation

redis-util 方便业务使用的redis操作封装,比如常见的缓存set get操作, 一行代码搞定,不像开源库需要写好多行 使用方法

Oct 22, 2021
Simple utility to get/set the PWM duty cycle and to measure the RPM for a fan connected to the 4-pin header on the CM4IO.

cm4iofan Simple utility to get/set the PWM duty cycle and to measure the RPM for a fan connected to the 4-pin header on the CM4IO. Requirements Enable

Mar 31, 2022
get windows system call number dynamically, it doesn't need the system call table.

GetSyscallID get windows system call number dynamically, it doesn't need the system call table. Try download go get github.com/akkuman/getsyscallid/cm

Jun 1, 2022
GoApiRandom - Api to get random numbers

GoApiRandom - Api to get random numbers

Jan 18, 2022
Hotswap provides a solution for reloading your go code without restarting your server, interrupting or blocking any ongoing procedure.
Hotswap provides a solution for reloading your go code without restarting your server, interrupting or blocking any ongoing procedure.

Hotswap provides a solution for reloading your go code without restarting your server, interrupting or blocking any ongoing procedure. Hotswap is built upon the plugin mechanism.

Jan 5, 2023
gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools.

gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools. Table of Contents Introduction

Jan 5, 2023
流媒体NetFlix解锁检测脚本 / A script used to determine whether your network can watch native Netflix movies or not
流媒体NetFlix解锁检测脚本 / A script used to determine whether your network can watch native Netflix movies or not

netflix-verify 流媒体NetFlix解锁检测脚本,使用Go语言编写 在VPS网络正常的情况下,哪怕是双栈网络也可在几秒内快速完成IPv4/IPv6的解锁判断 鸣谢 感谢 @CoiaPrant 指出对于地域检测更简便的方法 感谢 @XmJwit 解决了IPV6 Only VPS无法下载脚

Dec 29, 2022
Visualize your Go data structures using graphviz

memviz How would you rather debug a data structure? "Pretty" printed Visual graph (*test.fib)(0xc04204a5a0)({ index: (int) 5, prev: (*test.fib)(0xc0

Dec 22, 2022
Dynamically generated Last.fm stats for your profile readme

GitHub Readme Last.fm Stats Dynamically generated last.fm stats in your profile readme Contents Usage Options Demo Development & Deployment Issues, Re

Oct 12, 2022
gProfiler combines multiple sampling profilers to produce unified visualization of what your CPU
gProfiler combines multiple sampling profilers to produce unified visualization of what your CPU

gProfiler combines multiple sampling profilers to produce unified visualization of what your CPU is spending time on, displaying stack traces of your processes across native programs1 (includes Golang), Java and Python runtimes, and kernel routines.

Dec 27, 2022
this is an api that execute your deno code and send you the output

this a simple api that execute your deno code and send you the output, has not limit per request example request: in deno: const rawResponse = await f

Dec 23, 2022