Manager for single node Rancher clusters

Related tags

Cryptography bovine
Overview

Bovine

tag crates.io license

Manage single node Rancher clusters with a single binary, bovine.

% bovine run
Pulling [rancher/rancher:latest], this may take awhile...
Rancher container is running: ead7ff0c711a

% bovine list
ead7ff0c711a [rancher/rancher:latest] (running) > Up 5 seconds

% bovine stop --all
Stopped Rancher container: ead7ff0c711a

Background

bovine is simultaneously designed to be an accessible entrypoint into using both Rancher (and Kubernetes) and an efficient manager for experienced users working with single node Rancher clusters.

  • New to Rancher or Kubernetes?
    • bovine aims to be one of the first stepping stones into trying both technologies for the first time.
    • Those familiar with Docker, but unfamiliar with Kubernetes or Rancher, should feel right at home.
    • Creating your first cluster requires no arguments, flags, or setup. Just have Docker running, execute bovine run, navigate to your favorite browser, and access 127.0.0.1.
  • Advanced User?
    • Single node Rancher installations are useful for trying out new Rancher releases, provisioning downstream clusters for development, and general lab usage.
    • bovine is designed for multi-platform use (no need to maintain both Bash and PowerShell scripts).
    • Bring your own Docker images, specify your own Docker socket location, choose some flags, test and your upgrade scenarios without needing to consult the docs.

Prerequisites

The only prerequisite for bovine is the Docker daemon. Customize your Docker installation to your liking since bovine does not require the Docker CLI and can use a custom socket path.

Installation

bovine is designed to work on any tier one Rust platform that can interface with Docker. You can install and upgrade the application by using cargo.

cargo install bovine

You can install cargo via rustup (recommended) or your preferred package manager.

If you do not want to install cargo, you can download a binary from the releases page. The following convenience script can be used on macOS and Linux amd64 systems (requires wget, jq, and curl to be installed):

(
    OS=$(uname -s | tr '[:upper:]' '[:lower:]')
    if [ "$OS" = "linux" ]; then OS=linux-gnu; fi
    LATEST=$(curl -s https://api.github.com/repos/nickgerace/bovine/releases/latest | jq -r ".tag_name")
    wget -O bovine https://github.com/nickgerace/bovine/releases/download/$LATEST/bovine-$OS-amd64
    chmod +x bovine
    sudo mv bovine /usr/local/bin/bovine
)

Usage

By default, bovine run will create and run a Rancher container with common settings. See all options with the following command:

% bovine run --help

For more information, consult the official Rancher single node documentation.

What about saving your settings for future use? You can do it with valid JSON. Let's save it to a file.

% bovine run --dry-run > dry.json

You can also obtain the config and status for a container, whether it is running or not. Since this information is bundled into JSON, let's save it to another file.

% bovine get ead7ff0c711a > get.json

We've probably built a lot of Rancher containers while testing out these commands. Let's start over from the beginning.

% bovine stop --all --delete
Stopped Rancher container: ead7ff0c711a
Deleted Rancher container: ead7ff0c711a
Deleted volumes for container: ead7ff0c711a
Container not modified (may have already been stopped): d39cca6514d8
Deleting Rancher container: d39cca6514d8
Deleted volumes for container: d39cca6514d8

There's a new version of Rancher out! Let's upgrade our stable Rancher instance to latest.

% bovine upgrade bc3ad1bf4fd7 latest
Stopped Rancher container: bc3ad1bf4fd7
Created temporary container for volume backup: b6f3adef1c23
Image found locally: [rancher/rancher:latest]
Rancher container is running: 9cf5f2ead13d
Upgrade from [rancher/rancher:stable] to [rancher/rancher:latest] complete

Forgot the name of your one and only bovine container? No problem.

% bovine upgrade $(bovine list --short) latest

Troubleshooting

If we need to examine a live cluster, we can follow its container logs.

% bovine logs 8fccc0c04184 --follow

We can also dump the logs into a file.

% bovine logs 8fccc0c04184 > bovine.log

If you have found a bug that's likely to be unrelated to Rancher, you can pin down your version information to dive deeper. Let's print that information out, just to get the hang of it.

% bovine version
bovine:
  version: 0.1.0
  os/arch: macos/x86_64
docker:
  version: 20.10.7
  os/arch: linux/amd64
  api version: 1.41
  linux kernel version: 5.10.25-linuxkit
  git commit: b0f5bc3

If you are using a custom socket path, bovine will confirm that the information was gathered from there. Let's try it on a Linux host.

% bovine --docker-socket-path /foo/bar/docker.sock version
bovine:
  version: 0.1.0
  os/arch: linux/x86_64
docker:
  version: 20.10.7
  os/arch: linux/amd64
  api version: 1.41
  linux kernel version: 5.8.0-63-generic
  git commit: b0f5bc3
  socket path: /foo/bar/docker.sock

Maybe Docker is the issue in your troubleshooting session? bovine will print some version information anyway, just in case.

% bovine version
bovine:
  version: 0.1.0
  os/arch: macos/x86_64
docker:
  could not connect to docker (check if docker is running)

Why should I use this instead of my current workflow?

Let's talk freely here. Isn't this just a glorified version of Bash scripts with docker CLI commands? bovine does ultimately leverage the Docker daemon as its "engine", but there's more to its design than that. Some notes that may provide context:

  • bovine may use other container runtimes in the future.
    • In this scenario, users would have the option to choose between multiple runtimes (depending on the host OS).
  • Multi-platform support is essential, but especially so for an application focused on being a "first step" into trying out Rancher and/or Kubernetes.
  • Error handling, maintainability, UX, and "refactorability" are central to its design.
  • Even if the above points were non-existent, bovine tries to make the Kubernetes and/or Rancher experience easier for newcomers.
    • Sometimes, a small abstraction makes the difference between a user trying out and hesitantly skipping underlying software.
  • bovine provides one-button automation, such as stopping, deleting, and removing volumes for containers without affecting other containers and without checking IDs.
Comments
  • Add release action

    Add release action

    Add GitHub action for release. The release action must dynamically switch between pre-release and release based on the tag. For example, 0.1.0 should be a release and 0.1.0-rc.1 should be a pre-release.

    opened by nickgerace 6
  • Convenience script needs to specify linux-gnu rather than linux

    Convenience script needs to specify linux-gnu rather than linux

    Since there may be a linux-musl option in the future, the linux binary uses linux-gnu as its OS name. Thus, the convenience script needs to use it as well.

    opened by nickgerace 1
  • Add upgrade step for cargo install to README

    Add upgrade step for cargo install to README

    Add upgrade step for cargo install to README. Delete EXTRA doc. Remove docs directory. Add cargo install step to RELEASE doc.

    Linked Issue(s)

    Closes #52

    opened by nickgerace 0
  • Use `INFO` logging rather than printing to STDOUT

    Use `INFO` logging rather than printing to STDOUT

    When using RUST_LOG or the debug flag, bovine will currently include both direct print statements and formatted logs. In order to maintain a consistent experience, we should use INFO logging instead and remove all instance of direct print statements (e.g. println!).

    Exceptions: printing formatted logs. We do not want to "double log".

    Bonus: we will also be able to use RUST_LOG=info rather than RUST_LOG=off, which is a more common default.

    opened by nickgerace 0
  • Potential segfault in `localtime_r` invocations (bollard --> chrono)

    Potential segfault in `localtime_r` invocations (bollard --> chrono)

    Likely minimal impact for users. At the time of writing this issue, no safe upgrade is available.

    Crate:         chrono
    Version:       0.4.19
    Title:         Potential segfault in `localtime_r` invocations
    Date:          2020-11-10
    ID:            RUSTSEC-2020-0159
    URL:           https://rustsec.org/advisories/RUSTSEC-2020-0159
    Solution:      No safe upgrade is available!
    Dependency tree: 
    chrono 0.4.19
    ├── bollard-stubs 1.41.0
    │   └── bollard 0.11.0
    │       └── bovine 1.0.2
    └── bollard 0.11.0
    
    cargo-audit 
    opened by nickgerace 0
  • Potential segfault in the time crate (bollard --> chrono --> time)

    Potential segfault in the time crate (bollard --> chrono --> time)

    Minimal impact for users, but this issue will be used to track it.

    Relevant PR: https://github.com/chronotope/chrono/pull/578

    Crate:         time
    Version:       0.1.43
    Title:         Potential segfault in the time crate
    Date:          2020-11-18
    ID:            RUSTSEC-2020-0071
    URL:           https://rustsec.org/advisories/RUSTSEC-2020-0071
    Solution:      Upgrade to >=0.2.23
    Dependency tree: 
    time 0.1.43
    └── chrono 0.4.19
        ├── bollard-stubs 1.41.0
        │   └── bollard 0.11.0
        │       └── bovine 1.0.2
        └── bollard 0.11.0
    
    cargo-audit 
    opened by nickgerace 0
  • Add containerd backend support

    Add containerd backend support

    Add support for all essential commands and functionality for containerd. This must eventually work on all macOS amd64, macOS arm64, Windows amd64, and Linux amd64.

    opened by nickgerace 1
  • Add ability to read in config file

    Add ability to read in config file

    Preferably with JSON or TOML, bovine should have a config file option that defaults to a named file in current working directory (e.g. bovine.json) and can be specified via a flag.

    opened by nickgerace 0
Releases(1.0.3)
Owner
Nick Gerace
Hacking away at something.
Nick Gerace
Simple node and rust script to achieve an easy to use bridge between rust and node.js

Node-Rust Bridge Simple rust and node.js script to achieve a bridge between them. Only 1 bridge can be initialized per rust program. But node.js can h

Pure 5 Apr 30, 2023
Sample lightning node command-line app built on top of Ldk Node (similar to ldk-sample).

ldk-node-sample Sample lightning node command-line app built on top of Ldk Node (similar to ldk-sample ). Installation git clone https://github.com/op

optout 3 Nov 21, 2023
experimental package manager for node.js

pacquet Experimental package manager for node.js written in rust. Disclaimer: This is mostly a playground for me to learn Rust and understand how pack

pnpm 349 Aug 22, 2023
Yi Token by Crate Protocol: the primitive for auto-compounding single token staking pools.

yi Yi Token by Crate Protocol: the primitive for auto-compounding single token staking pools. About Yi is a Solana primitive for building single-sided

Crate Protocol 12 Apr 7, 2022
Most useful information about your system in a single command.

mymy Access the most common information about your system using a single command. Mymy is a command line tool that provides the most helpful informati

Théo Crevon 5 Apr 4, 2023
Retina is a network analysis framework that supports 100+ Gbps traffic analysis on a single server with no specialized hardware.

Retina Retina is a network analysis framework that enables operators and researchers to ask complex questions about high-speed (>100gbE) network links

Stanford Security Research 73 Jun 21, 2023
Single and multi-threaded custom ingestion crate for Stellar Futurenet, written in Rust.

rs-ingest Ingestion library written in rust for Futurenet rs-ingest Ingestion library written in rust for Futurenet Features Running offline Single-th

Xycloo Labs 3 Aug 14, 2023
Polkadot Node Implementation

Polkadot Implementation of a https://polkadot.network node in Rust based on the Substrate framework. NOTE: In 2018, we split our implementation of "Po

Parity Technologies 6.5k Jan 6, 2023
⋰·⋰ Feeless is a Nano cryptocurrency node, wallet, tools, and Rust crate.

⋰·⋰ Feeless What is Feeless? Feeless is a Nano cryptocurrency node, wallet, tools, and Rust crate. This is not the official project for Nano, only an

null 127 Dec 5, 2022
Statemint Node Implementation

Statemint Implementation of Statemint, a blockchain to support generic assets in the Polkadot and Kusama networks. Statemint will allow users to: Depl

Parity Technologies 72 Oct 30, 2022
Basilisk node - cross-chain liquidity protocol built on Substrate

Basilisk node Local Development Follow these steps to prepare a local Substrate development environment ??️ Simple Setup Install all the required depe

Galactic Council 52 Dec 27, 2022
A node API for the dprint TypeScript and JavaScript code formatter

dprint-node A node API for the dprint TypeScript and JavaScript code formatter. It's written in Rust for blazing fast speed. Usage Pass a file path an

Devon Govett 431 Dec 24, 2022
Substrate Node for Anmol Network

Anmol Substrate Node ?? ??️ ?? Anmol is the First Cross-Chain NFT Toolkit, on Polkadot. Introducing: Moulds NFT Breeding Multi-Chain NFT Migration ink

Anmol Network 12 Aug 28, 2022
Minimal Substrate node configured for smart contracts via pallet-contracts.

substrate-contracts-node This repository contains Substrate's node-template configured to include Substrate's pallet-contracts ‒ a smart contract modu

Parity Technologies 73 Dec 30, 2022
Trinci blockchain node

TRINCI TRINCI Blockchain Node. Requirements The required dependencies to build correctly the project are the following: clang libclang-dev (ver. 11 su

Affidaty S.p.A. 5 Sep 26, 2022
Substrate Node Template Generator

Substrate Node Template Generator A tool to generate stand-alone node templates of a customized Substrate clients used in "Substrate Library Extension

Parity Technologies 2 Feb 11, 2022
Subsocial full node with Substrate/Polkadot pallets for decentralized communities: blogs, posts, comments, likes, reputation.

Subsocial Node by DappForce Subsocial is a set of Substrate pallets with web UI that allows anyone to launch their own decentralized censorship-resist

DappForce 74 Nov 24, 2022
Node implementation for aleph blockchain built with Substrate framework

This repository contains the Rust implementation of Aleph Zero blockchain node based on the Substrate framework. Aleph Zero is an open-source layer 1

Aleph Zero Foundation 55 Dec 15, 2022
Ecoball Node is the Official Rust implementation of the Ecoball protocol.

Ecoball Node is the Official Rust implementation of the Ecoball protocol. It is a fork of OpenEthereum - https://github.com/openethereum/

Ecoball Chain 2 Jun 9, 2022