Giter VIP home page Giter VIP logo

banzai-cli's Introduction

This is a command-line interface for the Banzai Cloud Pipeline platform.

Installation

Use the following command to quickly install the CLI:

$ curl https://getpipeline.sh | sh

The script automatically chooses the best distribution package for your platform.

Available packages:

You can also select the installation method (one of auto, deb, rpm, brew, tar or go) explicitly:

$ curl https://getpipeline.sh | sh -s -- deb

On macOS, you can directly Homebrew:

$ brew install banzaicloud/tap/banzai-cli

Alternatively, fetch the source and compile it using go get:

$ go get github.com/banzaicloud/banzai-cli/cmd/banzai

Logging in

To use the command you will have to log in. You can either log in interactively using a web browser, or provide an API endpoint and a token manually.

For interactive login, just run banzai login, and follow the instructions given.

Use

See command reference in the official documentation.

Use Docker image

Logging in

$ docker run --rm -v $(PWD)/banzai-cli:/root/ ghcr.io/banzaicloud/banzai-cli login --token <your-pipeline-token> -e https://try.pipeine.banzai.cloud/pipeline

Select organization

$ docker run --rm -ti -v $(PWD)/banzai-cli:/root/ ghcr.io/banzaicloud/banzai-cli organization select

List clusters

$ docker run --rm -ti -v $(PWD)/banzai-cli:/root/ ghcr.io/banzaicloud/banzai-cli cluster list

Run cluster shell

$ docker run --rm -ti -v $(PWD)/banzai-cli:/root/ ghcr.io/banzaicloud/banzai-cli cluster shell

banzai-cli's People

Contributors

akijakya avatar asdwsda avatar bonifaido avatar borgee avatar colin014 avatar ecsy avatar fekete-robert avatar kflautner avatar kozmagabor avatar kristofgyuracz avatar lalyos avatar lpuskas avatar matyix avatar pbalogh-sa avatar pepov avatar pregnor avatar sagikazarmark avatar sancyx avatar siliconbrain avatar stoader avatar tarokkk avatar tothandras avatar waynz0r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

banzai-cli's Issues

org list/select

List available organizations, let the user select one, and store the choice.

Deploy secrets to Kubernets cluster

  banzai cluster install secret [flags]

Aliases:
  secret, s

Flags:
  -c, --cluster-name string   Name of the cluster to install the secret
  -f, --file string           Template descriptor file
  -h, --help                  help for secret
  -m, --merge                 Set true to merge existing secret
  -s, --secret-name string    Name of the secret to install```

Example:
```banzai cluster install secret -s mySecretName -c myClusterName <<EOF
{
  "namespace": "default",
  "sourceSecretName": "mysql76rvg-mysql-root-password",
  "spec": {
    "ROOT_USER": {
      "source": "username"
    },
    "ROOT_PASSWORD": {
      "source": "password"
    }
  }
}
EOF```

Add `spotguide lint` command

Check things like below in the git repo of the current working directory:

  • Every Spotguide file must be within a .banzaicloud directory
  • Must contain a README.md file providing a simple description/documentation for the Spotguide
  • Must contain an icon.svg file
  • Must contain a CI/CD configuration template in pipeline.yaml
  • Must contain Spotguide configuration (eg. name) and questionnaire in spotguide.yaml

Add a (--file|-f) flag to cluster create command

Currently the cluster create command accepts a cluster descriptor on the standard input, but in that case the command runs in non-interactive mode.

Passing the file with a flag to the command would be nice with keeping the interactive mode.

CP: add tags to ec2 resources created

Generate a set of tags based on the local username and hostname to provider_config of the ec2 installation. Handle it in the installer (and attach the uuid too).

List/get deployments

Add a 'deployment' subcommand for:

  • list deployments that are running on a cluster
  • get deployment - get the details of a deployment identified by release name
  • add deployment - add deployment to a cluster
  • delete deployment - delete a deployment identified by release name
  • update deployment - update deployment identified by release name

Implement secret create

Interactive flow:

  • select type from available types
  • ask for each required and optional field
  • ask for tags
  • offer editing

Non-interactively: read request from stdin

Fix goreleaser config and build

Currently goreleaser config is not up to date with the latest spec.

Also, currently it's not integrated into the circle CI build.

Secret select

Let them select one "default" secret for each context.

Split from #5

In case of Pipeline endpoint doesn't exist the response isnt'n valid.

It should be better if in this case the response shows that the Pipeline endpoint is nat a real endpoint.

bug:
./build/banzai login (docker-desktop/vault)
? Pipeline endpoint: https://not.a.real.endpoint
? Pipeline token: xxxxxxxxxxxx
2019/07/11 10:48:23 could not list organizations: 404 Not Found

expected:
./build/banzai login (docker-desktop/vault)
? Pipeline endpoint: https://not.a.real.endpoint
? Pipeline token: xxxxxxxxxxxx
2019/07/11 11:28:08 given URL is not a Pipeline API endpoint: 404 Not Found

List and get cluster

Let the user list all clusters, and get the details of one of them by name/id.

wrap helm in `banzai cluster shell`

Take care of providing a suitable helm command in the PATH of the shell executed by the banzai cluster shell command.

  • Create a directory, add it to the beginning of $PATH, and place a helm wrapper there (this might be a symlink to the banzai-cli, or a single line shell-script that calls an internal banzai-cli endpoint).
  • If the wrapped helm is called (or maybe even in advance in a background branch), ask the cluster for the version of tiller installed, and find in a cache or download the same version of helm.
  • Create or use another directory for the cluster, set it up as $HELM-HOME, and set up the repositories that are provided by the Pipeline API.
  • After that, exec helm with the original parameters.

Provide an option (--disable-helm-wrapper) to switch off this whole behavior.

extract aws credentials from local config

Find user's aws-cli credentials in env vars and in ~/.aws/credentials' default section and use for installation/secret creation. Ask for approval. (Preparation step, will be used later by the AWS "demo" installer.)

Add command to support SSH to Node

Step required to SSH onto nodes (PKE cluster):

  • Download the SSH secret (id_rsa)
  • Grab the Node IP (public ip or via jump host)
  • Parameter SSH command generate ssh config file with the private key and host (+ optionally ProxyJump)

`cluster import` command

Add a banzai cluster import command that creates a BYOC cluster on Pipeline from the current Kubeconfig. In interactive mode it should ask for confirmation after printing some basic information like k get nodes, and offer running or skipping of the default posthooks (fixme?).

config/context handling

Save pipeline credentials and endpoint data to workspaces (~/.banzai/workspaces/*) instead of the general config file. Add a command to select default/current workspace, and a global command line option + env var to override the workspace selection. Merge in the config file in the current workspace.
banzai login should offer to create and select a new workspace if you are already logged in.

Easy-to-use port-forward command

Give a command like banzai cluster p[ort-]f[orward] where the user can choose interactively a clustert, a namespace, a service/deploymentet/pod and an exposed pod, then optionally open it in a browser.

Table selector

Contribute a generic solution for the selector of the survey project, to allow users to select a row from a table. Use it for selecting clusters, secrets etc.

Originally posted by @orymate in #79

cp up provider selection

offer aws and kind in addition to local kubecontext in banzai cp up

  • if values file is provided, run non-interactively
  • if no values file,
    • ask for provider, credentials (use local aws creds or exit with error)
    • write values file (omit credentials)

Response for cluster create broken

Summary after creating cluster is broken:

723 modern-go-application #(template: Status:1:2: executing "Status" at <.Status>: can't evaluate field Status in type client.CreateClusterResponse202)

thanks @sagikazarmark for reporting

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.