Skip to content

Commit

Permalink
remove setup scripts now that we have brew installation method; updat…
Browse files Browse the repository at this point in the history
…ing help screenshot
  • Loading branch information
jessebot committed Jan 9, 2024
1 parent 7b09d56 commit de54715
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 234 deletions.
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,27 @@ Here's the <a href="https://youtu.be/2E9DVJpv440?feature=shared">same video with


# Installation
B sure to check out our full [installation guide](https://small-hack.github.io/smol-k8s-lab/installation/), but the gist of it is `smol-k8s-lab` requires Python 3.11 (and [pip](https://pip.pypa.io/en/stable/installation/)). If you've already got it and [other pre-reqs](https://small-hack.github.io/smol-k8s-lab/installation/#prerequisites), you should be able to:
B sure to check out our full [installation guide](https://small-hack.github.io/smol-k8s-lab/installation/), but the gist of it is `smol-k8s-lab` can be installed via `pip` or `brew`.

## brew

[`brew`] is the preferred installation method for macOS/Debian/Ubuntu, as this will also install any prerequisites you need, so you don't need to worry about them.

```bash
# tap the special homebrew repo for our formula
brew tap small-hack/homebrew-smol-k8s-lab
# then install
brew install smol-k8s-lab
```

Then you should be able to check the version and cli options with:

```bash
smol-k8s-lab --help
```

## pip
`smol-k8s-lab` requires Python 3.11+ (and [pip](https://pip.pypa.io/en/stable/installation/)). If you've already got both and [other pre-reqs](https://small-hack.github.io/smol-k8s-lab/installation/#prerequisites), you should be able to:

```bash
# install the CLI
Expand All @@ -47,10 +67,10 @@ Checkout our [TUI docs](https://small-hack.github.io/smol-k8s-lab/tui/create_mod

## Beta release of 2.0.0

`v2.0.0b7` is available for testing but docs and screenshots are still under development. ETA is about 1-2 weeks for those tests to be complete and the official `2.0.0` to be launched, which will support a full TUI and a range of new options in the config file. To begin testing that release (or [other pre-releases](https://pypi.org/project/smol_k8s_lab/2.0.0b7/#history)) you can do:
`v2.0.0b8` is available for testing but docs and screenshots are still under development. ETA is about 1-2 weeks for those tests to be complete and the official `2.0.0` to be launched, which will support a full TUI and a range of new options in the config file. To begin testing that release (or [other pre-releases](https://pypi.org/project/smol_k8s_lab/2.0.0b8/#history)) you can do:

```bash
pip install smol_k8s_lab==2.0.0b7
pip install smol_k8s_lab==2.0.0b8
```

This should have actually been 1.0, but I misunderstood semver, and now here we are, with another major version update.
Expand Down
164 changes: 76 additions & 88 deletions docs/assets/images/screenshots/help_text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 25 additions & 10 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,52 @@ nav_order: 2
permalink: /install
---

## Prerequisites
!!! Note
`smol-k8s-lab` is only tested on Debian, Ubuntu, and macOS. It may run on other Linux distros and even WSL, but we do not actively test them at this time.

## Install via `brew`

[brew] is the preferred installation method for macOS/Debian/Ubuntu, as this will also install any prerequisites you need.

```bash
# tap the special homebrew repo for our formula
brew tap small-hack/homebrew-smol-k8s-lab
# then install
brew install smol-k8s-lab
```

Then you should be able to check the version and cli options with:

```bash
smol-k8s-lab --help
```

## Install via `pip`

### Prerequisites

### Required
#### Required

`smol-k8s-lab` cannot function without at least the following installed:

- [Python](https://www.python.org/downloads/) (`>=3.11`), and [`pip`](https://pip.pypa.io/en/stable/installation/)
- [`kubectl`](https://kubernetes.io/docs/tasks/tools/)
- [`helm`](https://helm.sh/docs/intro/install/)
- [`argocd`](https://argo-cd.readthedocs.io/en/stable/cli_installation/)
- Internet access

### Optional
#### Optional

All of these are not Required for core functionality of `smol-k8s-lab`, but they greatly enhance the experience, so they are still recommended.

| application | description |
|-------------|--------------------------------------------------------------------------------------------------------------------------|
| [brew] | If installed, we can install all prerequisites for you (except python/pip, because you need those to run `smol-k8s-lab`) |
| [docker] | needed for k3d, kind, and installing the mastodon app |
| [bw] | only if you want to use Bitwarden to store your passwords |
| [k3d] | only if you want to use k3d |
| [k9s] | only if you want a k8s TUI for viewing an already installed cluster |
| [kind] | only if you want to use kind |
| [mc] | only if you want smol-k8s-lab to create MinIO users and buckets for you |

## Install via `pip`

!!! Note
`smol-k8s-lab` is only tested on Debian, Ubuntu, and macOS. It may run on other Linux distros and even WSL, but we do not actively test them at this time.


`pip` is probably the best way to install `smol-k8s-lab`, but you can also probably use `pipx`:

Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "smol_k8s_lab"
version = "2.0.0b7"
version = "2.0.0b8"
description = "Bootstrap simple projects on Kubernetes with kind, k3d, and k3s. This is a beta release"
authors = ["Jesse Hitch <[email protected]>",
"Max Roby <[email protected]>"]
Expand All @@ -11,7 +11,7 @@ homepage = "https://small-hack.github.io/smol-k8s-lab"
repository = "http://github.com/small-hack/smol-k8s-lab"
documentation = "https://small-hack.github.io/smol-k8s-lab"
keywords = ["kubernetes", "homelab", "kind", "k3s", "k8s"]
classifiers = ["Development Status :: 3 - Alpha",
classifiers = ["Development Status :: 4 - Beta",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: MacOS :: MacOS X",
Expand All @@ -20,7 +20,6 @@ classifiers = ["Development Status :: 3 - Alpha",
"Topic :: System :: Installation/Setup",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)"]
include = ["smol_k8s_lab/config/kind/kind_cluster_config.yaml",
"smol_k8s_lab/config/extras/Brewfile",
"smol_k8s_lab/config/default_config.yaml"]

[tool.poetry.urls]
Expand Down
53 changes: 0 additions & 53 deletions setup.sh

This file was deleted.

9 changes: 0 additions & 9 deletions smol_k8s_lab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ def process_log_config(log_dict: dict = {"level": "warn", "file": ""}):
metavar="CLUSTER_NAME",
type=str,
help=HELP['delete'])
@option("--setup", "-s",
is_flag=True,
help=HELP['setup'])
@option("--interactive", "-i",
is_flag=True,
help=HELP['interactive'])
Expand All @@ -109,7 +106,6 @@ def process_log_config(log_dict: dict = {"level": "warn", "file": ""}):
help=HELP['version'])
def main(config: str = "",
delete: bool = False,
setup: bool = False,
log_file: str = "",
version: bool = False,
interactive: bool = False):
Expand Down Expand Up @@ -148,11 +144,6 @@ def main(config: str = "",
if interactive or tui_enabled:
cluster_name, USR_CFG, SECRETS, bitwarden_credentials = launch_config_tui(config_dict)
else:
if setup:
# installs required/extra tooling: kubectl, helm, k9s, argocd, krew
from .utils.setup_k8s_tools import do_setup
do_setup()

# process all of the config file, or create a new one and also grab secrets
USR_CFG, SECRETS = process_configs(config_dict)

Expand Down
29 changes: 0 additions & 29 deletions smol_k8s_lab/config/extras/Brewfile

This file was deleted.

12 changes: 9 additions & 3 deletions smol_k8s_lab/k8s_distros/kind.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from ruamel.yaml import YAML
from ruamel.yaml.scalarstring import PreservedScalarString as pss
from shutil import which
from sys import exit


yaml = YAML()
Expand All @@ -34,10 +35,15 @@ def create_kind_cluster(cluster_name: str,
# make sure kind is installed first, and if not, install it
if not which("kind"):
msg = ("ʕ•́ᴥ•̀ʔ [b]kind[/b] is [warn]not installed[/warn]. "
"[i]We'll install it for you.[/i] ʕᵔᴥᵔʔ")
"[i]We'll try to install it for you.[/i] ʕᵔᴥᵔʔ")
sub_header(msg)
log.debug("Installing kind with brew...")
subproc(['brew install kind'], spinner=True)
if which("brew"):
log.debug("Installing kind with brew...")
subproc(['brew install kind'], spinner=True)
else:
log.error("Sorry, you don't have brew installed. :( " + \
"Please install [b]kind[/b] and run smol-k8s-lab again")
exit()

log.debug("Creating a kind cluster...")

Expand Down
32 changes: 0 additions & 32 deletions smol_k8s_lab/k8s_tools/setup_k8s_tools.py

This file was deleted.

4 changes: 0 additions & 4 deletions smol_k8s_lab/utils/rich_cli/help_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ def options_help():
'delete':
'Delete an existing cluster by name.',

'setup':
'Install/update extra tools such as argocd, cilium-cli, helm, k9s, krew, '
'kubectl, and more via brew.',

'interactive':
'New! ⚙️ Interactively configures smol-k8s-lab',

Expand Down

0 comments on commit de54715

Please sign in to comment.