Carina™ client
Command line client for Carina by Rackspace, a container service that's currently in Beta.
Installation
To download and install the carina
CLI, use the appropriate instructions for your operating system.
OS X with Homebrew
If you're using Homebrew, run the following commands:
$ brew update
$ brew install carina
Linux and OS X (without Homebrew)
Downloads for the latest release of carina
are available in releases for 64-bit Linux and OS X. You can use curl
to download the binary, move it to a directory on your $PATH
, and make it executable:
$ curl -L https://download.getcarina.com/carina/latest/$(uname -s)/$(uname -m)/carina -o carina
$ mv carina ~/bin/carina
$ chmod u+x ~/bin/carina
Windows with Chocolatey
If you are using Chocolatey, run the following command:
> choco install carina
Windows (without Chocolatey)
Downloads for the latest release of carina
are available in releases. For quick installation, open PowerShell and run the following command:
> wget 'https://download.getcarina.com/carina/latest/Windows/x86_64/carina.exe' -OutFile carina.exe
Be sure to move carina.exe
to a directory on your %PATH%
.
Getting started
$ export CARINA_USERNAME=trythingsout
$ export CARINA_APIKEY=$RACKSPACE_APIKEY
$ carina list
ClusterName Flavor Nodes AutoScale Status
mycluster container1-4G 1 false active
$ carina create newone
newone container1-4G 1 false new
$ carina create another --wait --autoscale
another container1-4G 1 true active
$ carina list
ClusterName Flavor Nodes AutoScale Status
mycluster container1-4G 1 false active
newone container1-4G 1 false active
another container1-4G 1 true active
$ carina credentials another
#
# Credentials written to "/Users/rgbkrk/.carina/clusters/trythingsout/another"
#
source "/Users/rgbkrk/.carina/clusters/trythingsout/another/docker.env"
# Run the command above to get your Docker environment variables set
$ eval "$( carina env another )"
$ echo Conencted to: $CARINA_CLUSTER_NAME
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ docker run -d --name whoa -p 8080:8080 whoa/tiny
0e857826144194fd089310279915b1a052de9fb878d6d4f61420a0c64ee06c53
$ curl $( docker port whoa 8080 )
👊 I know kung fu 👊
Usage
usage: carina [<flags>] <command> [<args> ...]
command line interface to launch and work with Docker Swarm clusters
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--version Show application version.
--username=USERNAME Carina username - can also set env var CARINA_USERNAME
--api-key=CARINA_APIKEY
Carina API Key - can also set env var CARINA_APIKEY
--endpoint="https://app.getcarina.com"
Carina API endpoint
Commands:
help [<command>...]
Show help.
create [<flags>] <cluster-name>
Create a swarm cluster
--wait wait for swarm cluster to come online (or error)
--nodes=1 number of nodes for the initial cluster
--autoscale whether autoscale is on or off
get <cluster-name>
Get information about a swarm cluster
list
List swarm clusters
grow --nodes=NODES <cluster-name>
Grow a cluster by the requested number of nodes
--nodes=NODES number of nodes to increase the cluster by
credentials [<flags>] <cluster-name>
download credentials
--path=<cluster-name>
path to write credentials out to
rebuild [<flags>] <cluster-name>
Rebuild a swarm cluster
--wait wait for swarm cluster to come online (or error)
delete <cluster-name>
Delete a swarm cluster
Environment Variables
When you source the result of carina env
a few helpful environment variables are set for you:
DOCKER_HOST
, DOCKER_CERT_PATH
and DOCKER_TLS_VERIFY
are used by the Docker client to connect to your cluster.
DOCKER_VERSION
is designed to work with the Docker Version Manager (dvm). Run dvm use
and it will use that environment variable to load the right Docker client binary into the current session.
CARINA_CLUSTER_NAME
helps you remember which cluster is currently connected
Building
The build script assumes you're running go 1.5 or later. If not, upgrade or use
something like gimme.
make carina
This creates carina
in the current directory (there is no make install
currently).
If you want it to build on prior releases of go, we'd need a PR to change up how
the Makefile
sets the LDFLAGS
conditionally based on Go version.
Releasing
Prerequisites
The release script relies on github-release. Get it, configure it.
This script assumes you have pulled down this repository via go get github.com/getcarina/carina
and are currently working out of the ${GOPATH}/src/github.com/getcarina/carina
directory.
It's also important that you have a "release" remote set up to point at the main repository.
git remote add release git@github.com:getcarina/carina.git
Make sure you're on master
then run release.sh
with the next tag and release name.
./release.sh v0.2.0 "Acute Aquarius"
How do you pick the release name?
Naming things
The hardest problem in computer science is picking names. For releases, we take
an adjective combined with the next constellation from an
alphabetical list of constellations.
It can be alliterative if you like.