exoscale / cli Goto Github PK
View Code? Open in Web Editor NEWCommand-line tool for everything at Exoscale: compute, storage, dns.
License: Apache License 2.0
Command-line tool for everything at Exoscale: compute, storage, dns.
License: Apache License 2.0
Adding the SSH rule with my-ip create two rules when only the one containing my-ip should exist.
% exo firewall show foo
(nothing)
% exo firewall add foo ssh --my-ip
INGRESS CIDR 0.0.0.0/0 tcp 22 (ssh)
CIDR 80.224.112.21/32 tcp 22 (ssh)
https://github.com/ahmetb/kubectx
% kubectx
minikube
% exo lab kube create bar
...
% kubectx
minikube
exo-kube-bar
help. https://kubernetes.io/docs/setup/certificates/#configure-certificates-for-user-accounts
KUBECONFIG=<filename> kubectl config set-cluster default-cluster --server=https://<host ip>:6443 --certificate-authority <path-to-kubernetes-ca> --embed-certs
KUBECONFIG=<filename> kubectl config set-credentials <credential-name> --client-key <path-to-key>.pem --client-certificate <path-to-cert>.pem --embed-certs
KUBECONFIG=<filename> kubectl config set-context default-system --cluster default-cluster --user <credential-name>
KUBECONFIG=<filename> kubectl config use-context default-system
The cli crashes when adding a DNS entry when I execute this command:
$ exo dns add A mydomain.com -a ${DEPLOYMENT_SERVER_IP} -n ${MACHINE_NAME}
I get the following error:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x6a9689]
goroutine 1 [running]:
github.com/exoscale/egoscale.(*Client).dnsRequest(0x0, 0xe81c00, 0xc0001b9680, 0xc000501ac0, 0x16, 0x0, 0x0, 0x0, 0xc93196, 0x3, ...)
/src/vendor/github.com/exoscale/egoscale/dns.go:314 +0x59
github.com/exoscale/egoscale.(*Client).GetDomain(0x0, 0xe81c00, 0xc0001b9680, 0x7ffd4db36741, 0xa, 0x0, 0x0, 0xc000501ba0)
/src/vendor/github.com/exoscale/egoscale/dns.go:157 +0xd4
github.com/exoscale/cli/cmd.glob..func12(0x13d0e80, 0xc0005612c0, 0x1, 0x5, 0x0, 0x0)
/src/cmd/dns_records_add.go:35 +0x19b
github.com/spf13/cobra.(*Command).execute(0x13d0e80, 0xc000561270, 0x5, 0x5, 0x13d0e80, 0xc000561270)
/src/vendor/github.com/spf13/cobra/command.go:762 +0x473
github.com/spf13/cobra.(*Command).ExecuteC(0x13d7e20, 0x20, 0xc000000300, 0xaf252d)
/src/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
github.com/spf13/cobra.(*Command).Execute(0x13d7e20, 0xd2e8d8, 0xc000219e00)
/src/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/exoscale/cli/cmd.Execute(0xe5ed10, 0x5, 0xe7d000, 0x28)
/src/cmd/root.go:92 +0x1c2
main.main()
/src/main.go:34 +0x5e
My CLI is running in a docker container and configured with ENV variables. Other commands such as vm list and create work fine.
allow a more convenient way of specifying the netmask
--netmask 255.255.255.0
--cidrmask 24
exo version
does not display version if no config file is present
current result:
exo version Config File "exoscale" Not Found in "[/Users/acr/.exoscale /Users/acr /Users/acr/github/demo/cli]"
expected result (even if config not set/correct/present):
exo version exo dev n/a (egoscale 0.12.2)
Issue by Fnux
Friday Sep 21, 2018 at 06:48 GMT
Originally opened as exoscale/egoscale#330
Hello,
The exo
command line utility seems very convenient, but the way it stores credentials bothers me: it doesn't make sense to use 2FA to authenticate against portal.exoscale.com while a plaintext file containing API credentials working for any services sits on my disk. Is there a way - or is it planned - to sources these credentials from an external command ? I'd like to source the secret from my password store.
Thank you!
Great job implementing the SOS interface!
It might be useful to consider adding support to update CORS headers with the cli. The following link provides a helpful overview:
https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html
The s3cmd
tool provides setcors
and delcors
commands that provide most of the functionality one might need for typical use cases.
Thanks again!
Issue by pierre-emmanuelJ
Friday Aug 31, 2018 at 16:11 GMT
Originally opened as exoscale/egoscale#308
make like the actual sos upload command
exo sos upload bucket <local path>
testFile done [=================================================] 100 %
Successfully uploaded testFile of size 602 KiB
Env credentials example:
EXOSCALE_SECRET_KEY=XXXXXXXX...
EXOSCALE_API_KEY=EXOXXXX...
EXOSCALE_COMPUTE_ENDPOINT=https://api.exoscale.ch/compute
Panic on exo vm create test1
because gCurrentAccount
is nil
When I verify if it's nil to continue there is an other issue on zone
more than one element found: apikey=EXO5145bd25f0ce3d5cc7ab087a, command=listZones
other issue exo config ask to create new one like with no config file
deleting stuff should have confirmations.
Issue by mcorbin
Thursday Sep 13, 2018 at 10:37 GMT
Originally opened as exoscale/egoscale#319
Add support for managed private network in Egoscale/Exo cli:
startip
, endip
, netmask
parameters.startip
, endip
, netmask
parameters.startip
, endip
, netmask
parameters in the output.ip
parameter.the cli has close to none... sadly.
Issue by greut
Wednesday Jul 04, 2018 at 07:03 GMT
Originally opened as exoscale/egoscale#213
Hi.
After running exo config
the file and dir are readable by anyone.
Considering that it contains secrets, that's not ideal ;-)
$ umask
022
$ exo version
exo v1.0.0 (egoscale v0.11.6)
$ ls -ald /home/ajacoutot/.exoscale{,/exoscale.toml}
drwxr-xr-x 2 ajacoutot ajacoutot 512B Oct 6 17:47 /home/ajacoutot/.exoscale/
-rw-r--r-- 1 ajacoutot ajacoutot 411B Oct 6 17:47 /home/ajacoutot/.exoscale/exoscale.toml
Hello, I have the following error when creating a one node kube cluster. Anything I've missed ?
$ exo lab kube create kube
Creating private SSH key
Deploying "kube" ⠼ done!
Bootstrapping Kubernetes cluster (can take up to several minutes):
Instance system upgrade...
Instance system upgrade: failed
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get update
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
E: Sub-process /usr/bin/dpkg returned an error code (1)
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get update
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
E: Sub-process /usr/bin/dpkg returned an error code (1)
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get update
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
E: Sub-process /usr/bin/dpkg returned an error code (1)
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get update
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
E: Sub-process /usr/bin/dpkg returned an error code (1)
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get update
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
E: Sub-process /usr/bin/dpkg returned an error code (1)
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get update
+ sudo -E DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
E: Sub-process /usr/bin/dpkg returned an error code (1)
cluster bootstrap failed: Process exited with status 100
Issue by marcaurele
Thursday Sep 06, 2018 at 05:41 GMT
Originally opened as exoscale/egoscale#318
When the remote endpoint is not available, it's impossible to add an entry and it crashed the whole import.
[+] Account name [blabla]:
Get http://localhost:8080/client/api?apikey=blablablablablabl&command=listZones&page=1&pagesize=50&response=json&signature=blablablablabl%3D: dial tcp [::1]:8080: connect: connection refused
<program exits & no config written>
It would be great if sos upload
could take an optional flag such as --recursive
or -R
for uploading directories!
Thanks again for the great work!
Read and display that page:
I went throught the config using v1.0.3 and there is a defaultSSHKey = ""
in the config now? Like the sosEndpoint
it shouldn't be there unless needed.
$ exo -A preprod zone
API error Unauthorized 401 (CSErrorCode(0) 0): unable to verify user credentials and/or request signature
It's not possible to interrupt the installation while it's running...
In commands as exo firewall delete
is possible to pass multiple params:
$ exo firewall delete A B C
[+] Are you sure you want to delete the security group: "A" [yN]: y
b0e5f8da-d1b7-47cd-933e-6237a28615d7
[+] Are you sure you want to delete the security group: "B" [yN]: y
e07b16e9-5d58-41a4-af4f-47ade67c2e03
[+] Are you sure you want to delete the security group: "C" [yN]: y
1e849d90-0e02-4f26-b17c-7d630ff80319
This is not true for the exo eip delete
command.
To reproduce:
$ exo eip delete 89.145.165.78 89.145.165.61
[+] sure you want to delete "89.145.165.78" EIP [yN]: y
0xc00017c5e0
Expected behaviour:
$ exo eip delete 89.145.165.78 89.145.165.61
[+] sure you want to delete "89.145.165.78" EIP [yN]: y
# either return the resource uuid as done for other cases or a human readable confirmation message
[+] sure you want to delete "89.145.165.61" EIP [yN]: y
# either return the resource uuid as done for other cases or a human readable confirmation message
> exo.exe sos metadata add yoanyoanyoan a%20b.zip "a&b" "c"
Put https://ppsos-ch-dk-2.exo.io/yoanyoanyoan/a%2520b.zip: net/http: invalid header field name "x-amz-meta-a&b"
Currently it is not possible to modify a VM instance's security groups using the exo
CLI – even when the VM is stopped.
I see 2 different ways to implement this (or maybe even both):
# In the "vm" command group:
exo vm firewall add VM SG1 [SG2 SGn...]
exo vm firewall remove VM SG1 [SG2 SGn...]
# In the "firewall" command group:
exo firewall attach SG VM1 [VM2 VMn...]
exo firewall detach SG VM1 [VM2 VMn...]
Any opinion?
all is in the title
The deb package name is called cli
which is too generic and not informative. Something like exocli
would be more meaningful.
Sometimes running exo lab kube create
fails because the latest version of Kubernetes (retrieved at https://dl.k8s.io/release/stable.txt) is not yet packaged by Ubuntu). For example right now the latest k8s version advertised is 1.13.4
, however creating exokube instances fails because the latest packaged version of the kubelet/kubeadm/kubectl utilities is 1.13.3
.
Adding an optional --version
flag to the exo lab kube create
command would allow users to specify a Kubernetes version (e.g. 1.13.3
) as a temporary workaround.
Hello,
CLI doesn't sniff Content Type on files < 512bytes, leading to objects served with a "Content-Type: application/octet-stream".
Please find a PR that should fix the problem : #129
Alex
I've installed the exo cli (1.0.7) on my mac and tried to spin up a one node kube.
The deployment step went fine but it seems the api-server is not started.
Any idea what I'm missing ?
$ exo lab kube create 1ptikub
Creating private SSH key
Deploying "1ptikub" ⠼ done!
Bootstrapping Kubernetes cluster (can take up to several minutes):
Instance system upgrade... success!
Docker Engine installation... success!
Kubernetes cluster node installation... success!
Kubernetes cluster node initialization... success!
Your Kubernetes cluster is ready. What to do now?
1. Install the "kubectl" command, if you don't have it already:
https://kubernetes.io/docs/tasks/tools/install-kubectl/
2. Execute the following command:
eval $(exo lab kube env "1ptikub")
You might want to persist this change by adding it to your shell startup
configuration (e.g. ~/.bashrc, ~/.zshrc).
3. Check that your cluster is reachable:
kubectl cluster-info
4. When you're done with your cluster, you can either:
* stop it using the "exo lab kube stop" command
* restart it later using the "exo lab kube start" command
* delete it permanently using the "exo lab kube delete" command
The error I got when running a kubectl command
$ eval $(exo lab kube env "1ptikub")
$ kubectl cluster-info
Kubernetes master is running at https://185.19.28.89:6443
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Unable to connect to the server: dial tcp 185.19.28.89:6443: i/o timeout
exo vm create test
exo vm create test2
exo ssh test
more than one element found: apikey=xxxx, command=listVirtualMachines, expires=2018-12-11T17%3A02%3A33%2B0100, name=test, response=json, signatureversion=3
Issue by sebgoa
Tuesday Sep 04, 2018 at 11:03 GMT
Originally opened as exoscale/egoscale#311
I like the simplicity of exo vm create foobar
but it creates a new SSH key:
$ exo vm create barbaz
Creating private SSH key
Deploying "barbaz" 100 % [======================================] done
What to do now?
1. Connect to the machine
> exo ssh barbaz
ssh -i "/Users/sebastiengoasguen/.exoscale/instances/2c5b53cb-c469-4209-8970-18f6ac913b88/id_rsa" [email protected]
2. Put the SSH configuration into ".ssh/config"
> exo ssh barbaz --info
Host barbaz
HostName 185.19.30.86
User ubuntu
IdentityFile /Users/sebastiengoasguen/.exoscale/instances/2c5b53cb-c469-4209-8970-18f6ac913b88/id_rsa
Tip of the day:
You're the sole owner of the priva
Why not use the default SSH key - if there is one-
The cmd/firewall.go:getMyCIDR()
function returns an IPv6 even if called with isIpv6
argument set to false
. This is because the net.Dial("udp", ...)
call uses OS TCP/IP stack priority which is IPv6 before IPv4, so if the host on which the code runs happens to have IPv6 working the OpenDNS resolution will actually happen over IPv6 and therefore return an IPv6 address instead of IPv4.
A way to fix this would be to call net.Dial() with udp4
instead of udp
when isIpv6=false
, and udp6
when isIpv6=true
. Example for the following code:
package main
import (
"context"
"fmt"
"net"
"github.com/exoscale/egoscale"
)
func main() {
fmt.Println(getMyCIDR(false))
}
func getMyCIDR(isIpv6 bool) (*egoscale.CIDR, error) {
cidrMask := 32
dnsServer := "resolver1.opendns.com"
if isIpv6 {
dnsServer = "resolver2.ipv6-sandbox.opendns.com"
cidrMask = 128
}
resolver := net.Resolver{
Dial: func(ctx context.Context, network, address string) (net.Conn, error) {
return net.Dial("udp", dnsServer+":53")
},
PreferGo: true,
}
ips, err := resolver.LookupIPAddr(context.Background(), "myip.opendns.com")
if err != nil {
return nil, err
}
if len(ips) < 1 {
return nil, fmt.Errorf("no IP addresses were found using OpenDNS")
}
return egoscale.ParseCIDR(fmt.Sprintf("%s/%d", ips[0].IP, cidrMask))
}
Returns 2a01:cb04::/32 <nil>
By calling net.Dial("udp4", ...)
, I get 86.247.71.58/32 <nil>
.
If you're OK with the suggested fix I can submit a PR.
To reproduce:
$ exo eip delete 89.145.165.61
[+] sure you want to delete "89.145.165.61" EIP [yN]: y
0xc00017c5e0
Expected behaviour:
$ exo eip delete 89.145.165.61
[+] sure you want to delete "89.145.165.61" EIP [yN]: y
# either return the resource uuid as done for other cases or a human readable confirmation message
fix and documentation the auto completion build, installation and usage.
% EXOSCALE_TRACE= exo runstatus list
Content-Type: application/json
{"detail":"Invalid Authorization header"}
json: cannot unmarshal string into Go value of type []string
exo vm template register
called without any argument tries to register a template – and obviously fails:
$ exo vm template register
Registering the template. failure!
RegisterCustomTemplate.Checksum (string) field is required, got ""
It should print and usage error message and the command usage help.
Allowing any args in the API gives the false impression that they do something.
% exo api vm list keyword=bar
2018/11/28 09:17:18 GET /compute?apikey=EXO9d45a5d9bf68d5689a0eeb55&command=listVirtualMachines&expires=2018-11-28T09%3A27%3A18%2B0100&response=json&signature=...&signatureversion=3 HTTP/1.1
% exo api vm list --keyword=bar
2018/11/28 09:18:14 GET /compute?apikey=EXO9d45a5d9bf68d5689a0eeb55&command=listVirtualMachines&expires=2018-11-28T09%3A28%3A14%2B0100&keyword=bar&response=json&signature=...signatureversion=3 HTTP/1.1
there is already some cmd to show info like:
exo sos acl list
exo sos header list
exo sos metadata list
but why not add exo sos show <bucket> <object name>
to show info like on the web consol (object url) and why not acl, header, meta to have the info quicker
first:
unknown flag
go run main.go -A preprod api vm ls
unknown shorthand flag: 'A' in -A
exit status 1
and with long flag version
go run main.go --account preprod api vm ls
API error ParamError 431 (InvalidParameterValueException 4350): could not find account preprod in domain XXXX-xXXXXX-XXXX-XXXXX
exit status 1
but without api it's working good
go run main.go --account preprod vm ls
...
....
I have 2 custom templates. One is named Linux Debian mcorbin 80 64-bit
, the other Linux Debian mcorbin 50 64-bit
.
cs listTemplates templatefilter="self"
returns both templates, but not the CLI:
$ exo -A prod vm template list --mine
┼────────────────────────────────┼──────┼──────────────┼──────────────────────────────────────┼──────────┼
│ OPERATING SYSTEM │ DISK │ RELEASE DATE │ ID │ CATEGORY │
┼────────────────────────────────┼──────┼──────────────┼──────────────────────────────────────┼──────────┼
│ Linux Debian mcorbin 80 64-bit │ │ 2019-05-27 │ 80056bac-d7cb-4703-a48a-f75cc3d4c1ac │ self │
┼────────────────────────────────┼──────┼──────────────┼──────────────────────────────────────┼──────────┼
[CH3649]
We have standard exo tab output:
% exo vm ls
┼───────┼────────────────┼────────────────┼─────────┼──────────┼──────────────────────────────────────┼
│ NAME │ SECURITY GROUP │ IP ADDRESS │ STATUS │ ZONE │ ID │
┼───────┼────────────────┼────────────────┼─────────┼──────────┼──────────────────────────────────────┼
│ test3 │ default │ 89.145.162.134 │ Running │ de-fra-1 │ 1c288f5d-4f21-4f6b-8ff1-31f071e975f7 │
│ test2 │ default │ 89.145.162.74 │ Running │ de-fra-1 │ 53a75824-4d0f-4a6c-98c2-0603abe2cda8 │
│ test1 │ default │ 89.145.161.66 │ Running │ de-fra-1 │ d5767a87-7a56-47b5-8712-9efed5e1deb7 │
┼───────┼────────────────┼────────────────┼─────────┼──────────┼──────────────────────────────────────┼
We have Markdown output:
% exo vm ls | cat
NAME | SECURITY GROUP | IP ADDRESS | STATUS | ZONE | ID |
---|---|---|---|---|---|
test3 | default | 89.145.162.134 | Running | de-fra-1 | 1c288f5d-4f21-4f6b-8ff1-31f071e975f7 |
test2 | default | 89.145.162.74 | Running | de-fra-1 | 53a75824-4d0f-4a6c-98c2-0603abe2cda8 |
test1 | default | 89.145.161.66 | Running | de-fra-1 | d5767a87-7a56-47b5-8712-9efed5e1deb7 |
{
"vm": [
{
"name": "test1",
"security-group": "default",
"ip-address": "89.145.161.66",
"status": "running",
"zone": "de-fra-1",
"id": "d5767a87-7a56"
},
{
"name": "test2",
"security-group": "default",
"ip-address": "89.145.161.66",
"status": "running",
"zone": "de-fra-1",
"id": "d5767a87-7a56"
},
{
"name": "test3",
"security-group": "default",
"ip-address": "89.145.161.66",
"status": "running",
"zone": "de-fra-1",
"id": "d5767a87-7a56"
}
]
}
I was play around with the openbsd template.
I was able to successfully upload the template:
$exo vm template add --url http://redacted/exoscale-openbsd-6.5-2019-04-29-ac2a63.qcow2 --checksum ac2a63055f323f4073fc1b4bc726fed1 --description openbsd --name "OpenBSD 6.5 64-bit" --username root
Registering the template.................................... success.
┼──────────┼────────────────────┼──────────────────────────────────────┼
│ ZONE │ NAME │ ID │
┼──────────┼────────────────────┼──────────────────────────────────────┼
│ at-vie-1 │ OpenBSD 6.5 64-bit │ f1129815-8b61-49c1-a9a8-6376e1b5fb59 │
┼──────────┼────────────────────┼──────────────────────────────────────┼
but when I try to list --mine
I got:
$ exo vm template list --mine
Malformed Windows/OpenBSD. "openbsd"
Issue by greut
Friday Aug 03, 2018 at 13:01 GMT
Originally opened as exoscale/egoscale#265
% exo dns add A
required flag(s) "address" not set
since it requires a domain name shouldn't it display the usage at this stage?
bug on exo sos upload
I have tested the download (okay with file uploaded from the web console)
$ sha1sum big.video.mkv
87431f013c576b6faa45f105fb7f6946891dcc2c big.video.mkv
$ exo sos upload buckettest big.video.mkv
done! 100 % big.video.mkv
$ exo sos download buckettest big.video.mkv testdownload.mkv
Successfully downloaded "big.video.mkv" into "testdownload.mkv"
$ sha1sum testdownload.mkv
f65c9d28f2715034eee0921eb157643100eab74e testdownload.mkv
BUG: checksum are different
Download is okay!
$ exo sos download buckettest big.video.mkv testdownload1.mkv
Successfully downloaded "big.video.mkv" into "testdownload1.mkv"
$ exo sos download buckettest big.video.mkv testdownload2.mkv
Successfully downloaded "big.video.mkv" into "testdownload2.mkv"
$ exo sos download buckettest big.video.mkv testdownload3.mkv
Successfully downloaded "big.video.mkv" into "testdownload3.mkv"
$ sha1sum testdownload*.mkv
f65c9d28f2715034eee0921eb157643100eab74e testdownload1.mkv
f65c9d28f2715034eee0921eb157643100eab74e testdownload2.mkv
f65c9d28f2715034eee0921eb157643100eab74e testdownload3.mkv
all download are valid!
Listing objects in buckets is great but gives this kind of output:
[2018-06-28 12:17:19 UTC] 411 KiB FILENAME_1
[2018-06-28 12:17:18 UTC] 418 KiB FILENAME_2
...
It would be nice to have an option to have the output as filename only, in order to use the list in subsequent commands without having to manipulate the string.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.