Coder Social home page Coder Social logo

carina-cli's Introduction

Carina CLI Docker Image

This is a Dockerization of the Carina CLI, which is used to manage your Rackspace Carina clusters from the command-line.

Access Credentials

The are several ways to pass your Carina credentials to your container:

  • You can pass the CARINA_USERNAME and CARINA_APIKEY environment variables with the -e arguments of docker run
  • You can pass --username and --api-key after the image argument

...but, the more secure and convenient way is to attach a /secrets file into the container.

Create a file in your host filesystem that contains export VAR=VALUE lines, such as this secrets file in the current directory:

export CARINA_USERNAME=me@there
export CARINA_APIKEY=...api key goes here...

Run the CLI container and attach that file to /secrets in the container:

docker run --rm -v $(pwd)/secrets:/secrets itzg/carina-cli ls

Obtaining Credentials Output

As a convenience, this image exposes a /carina volume and sets $CARINA_HOME to that path. You can either attach that volume to a host directory or use --volumes-from in a downstream container, such as

docker run --name carina-credentials -v $(pwd)/secrets:/secrets itzg/carina-cli credentials my-cluster

docker run --volumes-from carina-credentials ...

Notice that I did not include the --rm flag on the upstream container, so that the container remains present for downstream attachment.

From the downstream container, your cluster credentials (the Docker client certificates) are available at the path

/carina/clusters/<carina username>/<cluster name>

General Usage of the CLI

For general use of the CLI, please refer to the Carina client documentation

Saving carina-cli output in a host directory

The following technique is more tedious than running the carina-cli directly, but does let you run via an image rather than downloading the binary. NOTE: the example shown here assumes the CARINA_* environment variables have been previously set.

docker run -v $HOME/.carina:/carina -u $(id -u) \
  -e CARINA_USERNAME -e CARINA_APIKEY \
  itzg/carina-cli \
  credentials YOUR_CLUSTER

carina-cli's People

Contributors

itzg avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.