All Projects → nickgerace → bovine

nickgerace / bovine

Licence: Apache-2.0 license
Manager for single node Rancher clusters

Programming Languages

rust
11053 projects
Makefile
30231 projects

Projects that are alternatives of or similar to bovine

Kadalu
A lightweight Persistent storage solution for Kubernetes / OpenShift using GlusterFS in background.
Stars: ✭ 239 (+368.63%)
Mutual labels:  rancher
microservices4vaadin
Sample application to show the secured integration of microservices and vaadin
Stars: ✭ 30 (-41.18%)
Mutual labels:  rancher
check rancher2
Monitoring plugin to check Docker / Kubernetes clusters managed by Rancher 2.x
Stars: ✭ 19 (-62.75%)
Mutual labels:  rancher
terraform-provider-rancher
Terraform Rancher provider
Stars: ✭ 35 (-31.37%)
Mutual labels:  rancher
rancher-cloud-controller-manager
A kubernetes cloud-controller-manager for the rancher cloud
Stars: ✭ 44 (-13.73%)
Mutual labels:  rancher
rancher-plugin
rancher jenkins plugin deploy or upgrade service
Stars: ✭ 42 (-17.65%)
Mutual labels:  rancher
K3d
Little helper to run Rancher Lab's k3s in Docker
Stars: ✭ 3,090 (+5958.82%)
Mutual labels:  rancher
cattlectl
gain control over your ranch
Stars: ✭ 33 (-35.29%)
Mutual labels:  rancher
kconnect
Kubernetes Connection Manager CLI
Stars: ✭ 168 (+229.41%)
Mutual labels:  rancher
faas-rancher
[DEPRECATED] Enable Rancher as a backend for Functions as a Service (OpenFaaS) https://github.com/alexellis/faas
Stars: ✭ 30 (-41.18%)
Mutual labels:  rancher
dashboard
The Rancher UI
Stars: ✭ 264 (+417.65%)
Mutual labels:  rancher
waldur-homeport
Waldur HomePort is web-based client for the Waldur MasterMind.
Stars: ✭ 22 (-56.86%)
Mutual labels:  rancher
action-setup-kube-tools
Github Action that setup Kubernetes tools (kubectl, kustomize, helm, kubeconform, conftest, yq, rancher, tilt, skaffold) very fast and cache them on the runner. Please [✩Star] if you're using it!
Stars: ✭ 45 (-11.76%)
Mutual labels:  rancher
k3d-action
A GitHub Action to run lightweight ephemeral Kubernetes clusters during workflow. Fundamental advantage of this action is a full customization of embedded k3s clusters. In addition, it provides a private image registry and multi-cluster support.
Stars: ✭ 137 (+168.63%)
Mutual labels:  rancher
nextmoov
We are nextmoov — a Belgian Digital Agency that reinvents the way we work.
Stars: ✭ 13 (-74.51%)
Mutual labels:  rancher
Asky
Asky开源架构:极简、轻量、极致性能《Asky零基础1小时学编程 dnc+vue+tidb+redis+rabbitMQ+ES》QQ群 779699538
Stars: ✭ 213 (+317.65%)
Mutual labels:  rancher
multipass-k3s
Use multipass instances to create your k3s cluster
Stars: ✭ 50 (-1.96%)
Mutual labels:  rancher
spring-cloud-microservices-on-kubernetes
My Best Practices in development and deployment of Spring Cloud Microservices on Kubernetes.
Stars: ✭ 19 (-62.75%)
Mutual labels:  rancher
ui-driver-hetzner
Rancher UI driver for the Hetzner Cloud docker driver.
Stars: ✭ 238 (+366.67%)
Mutual labels:  rancher
ansible-role-rke2
Ansible Role to install RKE2 Kubernetes.
Stars: ✭ 118 (+131.37%)
Mutual labels:  rancher

DEPRECATION NOTICE

This repository has been deprecated due to HA Rancher being preferred over its single node mode, even for developer use. If there's interest in unarchiving the repository, please let me know. Thank you for understanding.

Bovine

release crates.io build 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

Description

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. It works by communicating directly with the Docker daemon in order to create, upgrade, stop, delete, and manage 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

There are three primary methods for installing bovine.

Cargo (recommended)

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

cargo install --locked bovine

Keeping the crate up to date is easy with cargo-update.

cargo install cargo-update
cargo install-update -a

cargo can be installed with rustup (recommended) or your preferred package manager.

Homebrew Install (macOS only)

You can use Homebrew to install the tap.

brew install nickgerace/nickgerace/bovine

Note: this tap may not work with Linuxbrew.

Binary from Release

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

When a new version of Rancher comes out using the latest tag (the default for bovine run), you may need to force pull the image.

% bovine run --force-pull

When using localhost tunneling (e.g ngrok), you may need to set --no-cacerts for provisioning to function properly.

% bovine run -n

If you are working with Rancher >=v2.6, you may need to find the bootstrap password in order to access the dashboard.

% bovine bootstrap-password --wait

You can also set the bootstrap password upon startup.

% bovine run -b <password>

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": "1.0.0",
    "os/arch": "linux/x86_64"
  },
  "docker": {
    "version": "20.10.9",
    "os/arch": "linux/amd64",
    "api-version": "1.41",
    "linux-kernel-version": "5.10.0-1049-oem",
    "git-commit": "79ea9d3"
  }
}

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": "1.0.0",
    "os/arch": "linux/x86_64"
  },
  "docker": {
    "version": "20.10.9",
    "os/arch": "linux/amd64",
    "api-version": "1.41",
    "linux-kernel-version": "5.10.0-1049-oem",
    "git-commit": "79ea9d3",
    "docker-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": "1.0.0",
    "os/arch": "linux/x86_64"
  },
  "docker": {
    "error": "could not connect to docker (check if docker is running)"
  }
}

Windows

If you are having issues with the native Windows binary, the following tips may help:

  • PowerShell 7.1+ might need to be installed and used when executing the bovine binary.
  • Instead of accessing localhost, users may have to navigate to host.docker.internal in their browser of choice.
  • Rancher does not support native Windows images for its local cluster at this time, so Docker must be configured to deploy Linux containers.

Other

You may notice that bovine runs Rancher containers in privileged mode. This is required as of Rancher v2.5 (and is not a bovine requirement). More information can be found in the official docs.

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.

Disclaimer

bovine is not an official SUSE or Rancher Labs product at this time. While it is intended for "real world use" among other purposes described throughout this README, it is independently maintained.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].