GithubHelp home page GithubHelp logo

gridscale / gscloud Goto Github PK

View Code? Open in Web Editor NEW
17.0 10.0 9.0 7.39 MB

The official command-line interface for the gridscale API

Home Page: https://gridscale.io/

License: MIT License

Go 97.65% Makefile 0.64% Shell 0.65% Ruby 0.89% Dockerfile 0.16%
command-line kubernetes

gscloud's Introduction

gscloud

gscloud is a command-line tool that lets you manage your virtual infrastructure on gridscale.io.

gscloud is written in Go, so everything you need is just the gscloud binary. Compile it all by yourself or get the official release from the release page.

Create and destroy servers

Examples

See examples to get some first impressions.

Installation

Official releases for Windows, macOS, Linux, FreeBSD

Download packaged binaries from the releases page.

OpenBSD

TODO

Build from source

See here on how to build gscloud from source.

Configuration

You can use gscloud make-config to generate a new config file. Make sure to add your user ID and API token here.

Default locations:

  • Linux: $XDG_CONFIG_HOME/gridscale/config.yaml or $HOME/.config/gridscale/config.yaml
  • Mac: ~/Library/Application Support/gridscale/config.yaml
  • Windows: %APPDATA% or "C:\\Users\\%USER%\\AppData\\Roaming"

Example config:

projects:
- name: default
  userId: 2727b9ab-65ff-4d1e-af5e-d08d682bd1fa
  token: 6eb139b3b6515515a6f358d3a635e9b38f05935782602d4fd5c1b5716af54526
- name: liveaccount
  userId: 2727b9ab-65ff-4d1e-af5e-d08d682bd1fa
  token: 6eb139b3b6515515a6f358d3a635e9b38f05935782602d4fd5c1b5716af54526
  url: https://api.gridscale.io

Following environment variables can also be used instead of config file:

  • GRIDSCALE_UUID - corresponds to userId
  • GRIDSCALE_TOKEN - corresponds to token
  • GRIDSCALE_URL - corresponds to url Note: If the config file and the environment variables are used at the same time, the config file will be ignored and the environment variables will be used.

Kubernetes

You can use gscloud to retrieve the kubeconfig of your managed Kubernetes cluster via gscloud kubernetes cluster save-kubeconfig --credential-plugin --cluster <CLUSTER_UUID>

That way, gscloud will use the gridscale credentials configured in your gscloud configuration to obtain a kubeconfig for your cluster and add that as a new context to your ~/.kube/config.

If you execute the command with --credential-plugin, as given in the example above, gscloud will register itself as the credential plugin for the context and thereby automatically renew the kubeconfig for you, once it has expired. If you do not pass in --credential-plugin, the certificate will expire and can be renewed by running gscloud manually again.

When using gscloud in the context of a pipeline, the use of --credential-plugin is discouraged, as it can lead to colliding kubeconfig renewals, unless gscloud's cache directory is persisted across steps as an artifact.

Exit codes

gscloud returns zero exit code on success, non-zero on failure. Following exit codes map to these failure modes:

  1. The requested command failed.
  2. Reading the configuration file failed.
  3. The configuration could not be parsed.
  4. The project specified does not exist in the configuration file.

Shell completions

Generate shell completion scripts for zsh and bash.

  • bash
$ gscloud completion bash >> ~/.bash_profile
  • zsh
$ gscloud completion zsh >> ~/.zshrc

Install man-pages

Generate man-pages and install them. Example:

$ sudo gscloud manpage /usr/local/share/man/man1/

Contributing

Please create an issue if you have questions, want to start a discussion, or want to start work on something.

Pull requests are always welcome. Make sure to create an issue first to signal others that you are working on something. Also make sure to take a look at the Development Notes.

Have fun!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.