Getting Started
initialize
onctl initis required before using onctl. It creates a.onctldirectory with a single configuration file. The directory will look like this.
❯ tree
.
└── onctl.yaml
1 directory, 1 file
onctl.yamlis the single source of truth for every configurable parameter for every provider (global settings, hetzner, aws, gcp, azure, fc), each grouped under its own section, pre-filled with working defaults.- edit the values you want to change; CLI flags (
onctl create --help) still override whatever is in this file.gcp.projectandazure.subscriptionIdship as placeholders and must be set to use those providers.
set cloud provider
- set
ONCTL_CLOUDenvironment variables to the name of the cloud provider. Supported values;- azure
- hetzner
- aws
export ONCTL_CLOUD=hetzner
!!! note
If you don't set ONCTL_CLOUD environment variable, onctl tool will try to find credentials on your shell and use the first one it finds.
spin up a virtual machine
- We're ready. Let's create a Virtual Machine (Instance)
❯ onctl up -n onctl-test
Using: hetzner
Creating SSHKey: onctl-xxx...
SSH Key already exists (onctl-xxx)
Starting server...
Server IP: x.x.x.x
Vm started.
ssh access
- Just use ssh command to ssh into the virtual machine.
❯ onctl ssh onctl-test
Using: hetzner
.
.
.
root@onctl-test:~#