A command-line interface to manage your Ocean CD resources.
Ocean CD provides DevOps and Infrastructure teams with out-of-the-box processes to reimplement and share complex and mission-critical pieces of CD across different environments, such as progressive delivery and verification of the software deployments. Service owners are able to promote service changes to production without code or re-inventing deployment strategies. Developers are able to commit with confidence, now that the deployment phases are managed and visible.
Ocean CD provides a central place to observe the deployment (e.g., state, progress, and resources). These visibility features allow quick identification of issues during and after the deployment process and ensure reliability at scale.
You will set up external verifications, the method Ocean CD uses to integrate your unique test outcomes as part of an orchestrated release process, and define webhook API notifications to communicate between Ocean CD and your external DevOps-related tools.
Ocean CD performs automated Rollback, a mission-critical feature not covered out of the box by Kubernetes. You will be able to define the failure policy which determines the type of rollback that will be employed
To learn more about Ocean CD please go to the complete documentation.
oceancd
is available via Homebrew, and as a binary from the releases page:
brew install spotinst/tap/oceancd
To build Ocean CD CLI from the source you have to:
-
Download the suitable for your operating system release from releases page:
For example, to download version v0.0.11 on Linux, type:
curl -OL https://github.com/spotinst/spot-oceancd-cli/releases/download/v0.11.0/oceancd-linux-amd64-0.11.0.tar.gz
-
Unzip the file and make it executable:
tar -xf oceancd-linux-amd64-0.11.0.tar.gz -C /usr/local/bin chmod +x /usr/local/bin/oceancd
-
Add the
/usr/local/bin
path if thePATH
variable doesn't contain it:PATH=$PATH:/usr/local/bin
-
Ensure the version you installed is up-to-date:
oceancd version
-
Download the suitable for your operating system release from releases page.
-
Create the
C:\oceancd\bin
folder and unzip the executable file into it. -
Edit the
PATH
for your account:setx PATH "C:\oceancd\bin;%PATH%"
-
Ensure the version you installed is up-to-date:
oceancd version
To upgrade the latest CLI version please run the following command:
brew upgrade spotinst/tap/oceancd
Using oceancd
requires having the Spotinst access token that might be generated by going to Spotinst Account -> My account -> API -> Generate token
and cluster ID that might be found in the Name
column at Spotinst Account -> Settings -> Clusters
.
Run oceancd configure
to set up an Ocean CD profile. Then you will be prompted with four pieces of information:
- Spotinst access token
- profile
- cluster ID
- namespace
After answering the prompt the profile will be created at ~/spotinst/.oceancd.ini
. The attempt to create a profile will rewrite the profile's info if the same named profile already exists.
All the pieces might be specified by using the corresponding flags:
$ oceancd configure \
--clusterId example-cluster-id \
--namespace example-namespace \
--profile custom-profile \
--token 0260949e76ddb3ead1d3f7518831f594 \
--url https://custom.api.spotinst.com
The following profile will be created:
$ cat ~/spotinst/.oceancd.ini
[custom-profile]
token = 0260949e76ddb3ead1d3f7518831f594
url = https://custom.api.spotinst.com
clusterId = example-cluster-id
namespace = example-namespace
For more information run the help command oceancd configure -h
.
The currently supported shells are:
- Bash
- Zsh
- fish
- PowerShell
To enable autocompletion generate code using the oceancd complete
command run and put it into the file for configuring user environments (for example: ~/.bash_profile
for Mac OS, ~/.bashrc
for Linux, etc).
For example, for macOS bash
run the following code:
## import the bash autocompletion profile
echo '[[ -r /usr/local/etc/profile.d/bash_completion.sh ]] && . /usr/local/etc/profile.d/bash_completion.sh' >>~/.bash_profile
## enable oceancd autocompletion
echo 'source <(oceancd completion bash)' >>~/.bash_profile
## apply changes
. ~/.bash_profile
Using oceancd
allows to manage and monitor rollouts, workloads, and Ocean CD entities (Cluster, Strategy, RolloutSpec, VerificationProvider, VerificationTemplate).
The following command describes available API resources:
oceancd api-resources
The output is similar to the following:
NAME (5) SHORTNAMES NAMESPACED KIND
strategies stg,stgs No Strategy
rolloutSpecs rs Yes RolloutSpec
clusters No Cluster
verificationProviders vp,vps No VerificationProvider
verificationTemplates vt,vts No VerificationTemplate
By default oceancd
uses the default profile contained at ~/spotinst/.oceancd.ini
. The default behavior might be changed by using the --profile
flag:
oceancd get stgs --profile=prod
To retrieve info about Ocean CD entities that are available for your Spotinst account, apply or delete them use the corresponding get
, apply
, and delete
commands.
See the following example:
oceancd apply -f ./strategy-example.json
Enter the following code into the terminal to list all the Clusters defined within the "prod" Spotinst account, in JSON
format:
oceancd get cluster -o json --profile=prod
See the samples' page for the config examples.
The oceancd rollout
consists of multiple subcommands which can perform changes on a SpotDeployment rollout, namely:
- stop progressing the actual and rollback the previous rollout
- retrieve details about a rollout, especially in live mode
- manually pause the progressing rollout
- partly or fully promote a rollout circumvent the established conditions and verifications
To display info about current and new SpotDeployment versions, the status of the rollout, result of verifications, phase's status, etc, run the following:
oceancd rollout get ROLLOUT_ID
The following flags are supported for the oceancd rollout get
subcommand:
--watch
- watch live updates to the rollout--timeout-seconds int
- sets a timeout after specified seconds--no-color
- prevents output colorizing
For more details run oceancd rollout -h
.
Using oceancd workload
command gives the next possibilities:
- restart currently running pods
- roll back to one of the last 20 revisions
For example, rolling-back of the third
revision of SpotDeployment with the demo-oceancd
name might be performed by running the following code:
oceancd workload rollback demo-oceancd 3
The output is the following:
Successfully rolled back workload demo-oceancd
The oceancd operator
consists of multiple subcommands to manage OceanCD Operator Manager
install
installs OceanCD Operator Managerupgrade
upgrades OceanCD Operator Manager version and config mapdelete
deletes OceanCD Operator Manager
The following flags are supported for the oceancd operator install
subcommand:
--clusterId
- The cluster id name for the new OceanCD cluster--config
- The configuration applied to OceanCD resources and their dependencies--create-namespace
- Should it create OceanCD namespace. Default true
For more details run oceancd operator -h
.
Here are all the supported global flags:
--profile string sets the used credentials profile
--token string sets unique spot token for API authentication
--url string sets API url
We use GitHub issues for tracking bugs and feature requests. Please use these community resources for getting help:
Code is licensed under the Apache License 2.0.