/kubernetes

ArgoCD-based configuration for the OCF Kubernetes cluster

Primary LanguagePython

ocf/kubernetes

This is the git repository for the Open Computing Facility's Kubernetes cluster. The repository is a transpire toplevel repository built through GitHub Actions CI and pushed to ocf/cluster, which is then deployed by ArgoCD. The goal is for every non-dynamic Kubernetes object to be generated by a transpire module.

Deploying Software

  1. Create a new Python file in apps/ with a function objects() that yields Kubernetes objects (dicts or python-kubernetes objects are both accepted). See the other Python files in that folder for examples. Helper functions are provided for Helm charts, although not all software will use helm charts. a. If you need to build your own container image, do so in another git repository. Instructions coming soon (TM).
  2. (Root Required) Go to ArgoCD and run a sync. Before you click sync, look at the diff to sanity check what will change. We do not automatically sync configuration for safety reasons.

Code-Test Loop

Install the latest version of transpire. transpire is alpha-level software, so you may need to track the main branch. There are a few ways to install it (pip, nix), but the quickest way to get started is pip install git+https://github.com/ocf/transpire.git@main.

Then, make changes and use some subset of the following commands to test your changes...

# print all YAML objects to stdout (may want to pipe to less, bat, etc.)
transpire object print $APP_NAME

# apply it to the current cluster your kubectl points to
transpire object apply $APP_NAME

Folder Structure

Our deployment follows the following directory structure...

- apps
    - cilium
    - notes
    - ... (any software)
    - versions.toml (all software versions)
- cluster.toml (transpire configuration)

Bootstrapping

A bootstrap script is provided to help bring up new clusters when needed. It installs the bare minimum required to run ArgoCD, provided Kubernetes is already running without a CNI, and KUBECONFIG is pointed at the right place.

./bootstrap.sh

Contributing

The Open Computing Facility (OCF) is an all-volunteer student organization dedicated to free computing for all University of California, Berkeley students, faculty, and staff. Students from all backgrounds are encouraged to join as staff! If you're not a student, or just want to make a one time contribution, please use the standard GitHub pull request workflow. Thanks for helping out :)