Skip to content
openkubesPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

OpenKubes OK Lab

OpenKubes OK Lab uses Cluster API (CAPI) and Bring Your Own Host (BYOH) to operate Kubernetes clusters on existing Linux hosts. The lifecycle covers enrollment, provisioning, scaling, protection, reset, host reuse, and in-place upgrades. The artifact tooling builds, verifies, distributes, and preloads bundles for connected and air-gapped workflows.

Start with an offline plan

Install Git, Make, Bash, and Python 3.12 or newer with PyYAML. From the source checkout:

python3 -m venv "$HOME/ok-lab-venv"
"$HOME/ok-lab-venv/bin/python" -m pip install PyYAML
make init WORKSPACE="$HOME/ok-lab-demo" MANAGEMENT_MODE=existing PYTHON="$HOME/ok-lab-venv/bin/python"
make -C "$HOME/ok-lab-demo" provision-plan

The example uses a synthetic inventory. The plan checks the requested topology and prints the intended objects without contacting a cluster or enrolling hosts. Replace the sample values in the private workspace before operating a deployment. The workspace links to this checkout, so keep the checkout available.

Day-0 deployment covers existing management clusters and the prepared-gateway path. It explains how to set up a trusted inventory, pin the management API CA and SSH host keys, and prepare operator access to compatible Ubuntu amd64 hosts and a workload API endpoint. Host provisioning and management infrastructure can come from your own environment.

Lifecycle and artifact workflows

  • Follow the lifecycle guide for provisioning, scaling, protection, reset, verification, recovery, and enrollment retirement.
  • Follow the in-place upgrade guide for the version gates, authorizations, and recovery steps. The kubeadm profile lists the supported input shape and current placement restrictions.
  • Follow the artifact bundle guide for dependency discovery, reproducible inputs, and verified OCI and non-OCI distribution to a registry you control. The runtime preload guide covers the Linux amd64 staging path.

For commands that reproduce BYOH binaries or render or run its pinned tooling, clone the public companion repository into a location you choose and set the explicit checkout path:

git clone https://github.com/openkubes/ok-baremetal-byoh.git "$HOME/ok-baremetal-byoh"
export OK_LAB_BYOH_REPO="$HOME/ok-baremetal-byoh"

Keep the locked commits available on the checkout's origin/main. The builders verify the commit, tree, and relevant artifact digests. For Kustomize-dependent commands, run make -C "$OK_LAB_BYOH_REPO" kustomize in the companion checkout or set OK_LAB_KUSTOMIZE to a verified executable of the pinned version. Follow the workflow guide for Docker, cosign, and other tool requirements. You can also stage previously verified component bundles from your own environment. The source distribution supplies the build and verification code and pins. Prebuilt release bundles have a separate distribution scope.

Scaleway adapter and recovery

The optional Scaleway OpenTofu adapter provisions a management gateway and VM or Elastic Metal workload hosts. Each stack uses its own local state. Both stacks share a deployment lock. The CLI currently requires local state. The provider-neutral lifecycle above also works with existing hosts and needs no cloud account.

Use OpenTofu 1.13.9, Python, OpenSSH, and WireGuard tools. Choose your own project, regions and zones, addresses, and SSH keys. Protect inputs and evidence in a private operator directory. The adapter verifies its chosen state backend, holds the relevant change lock, and applies only a saved, explicitly approved plan.

export OK_LAB_HOME="$HOME/ok-lab-scaleway"
umask 077
mkdir -p "$OK_LAB_HOME/mgmt" "$OK_LAB_HOME/workload-example-lab"
cp stacks/mgmt/mgmt.tfvars.example "$OK_LAB_HOME/mgmt/mgmt.tfvars"
cp stacks/workload/workload.tfvars.example "$OK_LAB_HOME/workload-example-lab/workload.tfvars"

Supply Scaleway credentials using OK_LAB_SCW_ACCESS_KEY_MGMT and OK_LAB_SCW_SECRET_KEY_MGMT or the supported Keychain entry for the secret. For a separate workload Scaleway credential, set the corresponding _WORKLOAD variables. Keep credentials outside the checkout.

Fill in the copied inputs. Run bin/lab mgmt init and bin/lab mgmt plan. Review the plan before applying it with bin/lab mgmt apply --plan <evidence-dir> --approve <manifest-sha256> and the typed confirmation. Pin the gateway SSH fingerprint from an independent source and verify gateway readiness. Then use bin/lab workload example-lab init, sync, and plan for the workload stack. Its inputs come from the management contract, so repeat sync after approved management changes. See bin/lab --help and Day-0 deployment for the subsequent provider and enrollment workflow.

The optional clusters/ha1 example starts with one control plane and no workers. Follow the HA scale plan to move directly from one to three control planes. Verify all three etcd members are healthy before adding workers. Use the provider-neutral Day-0 profile when deploying from your own inventory.

After an interrupted apply, retain the evidence and inspect state before preparing a fresh plan. Restore missing local state from a verified backup before continuing. Use force-unlock only after confirming the state lock is stale. Review lifecycle cleanup and workload destruction before planning management destruction.

The adapter incorporates work from OpenKubes OK-RKE2. See Third-party notices for the upstream revision, attribution, and Cilium render provenance. OKLab's own contributions are released under Apache-2.0.

Qualification

Run bash tests/run.sh for development checks. It reports optional checks skipped when the environment lacks their dependencies, including the public BYOH checkout set by OK_LAB_BYOH_REPO. Use bash tests/run.sh --release for the release gate, which requires every check to run.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages