Getting Started
initialize
onctl init
on your project folder. This will create a.onctl
directory and create files related to each cloud configuration. The directory will look like this.
❯ tree
.
├── aws.yaml
├── azure.yaml
├── hetzner.yaml
├── <cloud provider>.yaml
└── onctl.yaml
1 directory, 3 files
onctl.yaml
file is the main configuration file and holds the all non-cloud specific parameters.- each provider has it's own configuration yaml file to define things specific things like (azure resourceGroups)
- change each configuration file depending on your needs.
set cloud provider
- set
ONCTL_CLOUD
environment 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:~#